forked from focus-creative-games/il2cpp_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsole.cpp
More file actions
51 lines (42 loc) · 1.41 KB
/
Console.cpp
File metadata and controls
51 lines (42 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "os/c-api/il2cpp-config-platforms.h"
#include "os/Console.h"
#include "os/c-api/Console-c-api.h"
#include "os/File.h"
#include "utils/StringUtils.h"
extern "C"
{
#if !RUNTIME_TINY
int32_t UnityPalConsoleInternalKeyAvailable(int32_t ms_timeout)
{
return il2cpp::os::Console::InternalKeyAvailable(ms_timeout);
}
int32_t UnityPalConsoleSetBreak(int32_t wantBreak)
{
return il2cpp::os::Console::SetBreak(wantBreak);
}
int32_t UnityPalConsoleSetEcho(int32_t wantEcho)
{
return il2cpp::os::Console::SetEcho(wantEcho);
}
int32_t UnityPalConsoleTtySetup(const char* keypadXmit, const char* teardown, uint8_t* control_characters, int32_t** size)
{
return il2cpp::os::Console::TtySetup(keypadXmit, teardown, control_characters, size);
}
#endif
#if IL2CPP_TINY
void STDCALL UnityPalConsoleWrite(const char* message, bool newline)
{
il2cpp::os::FileHandle* fileHandle = il2cpp::os::File::GetStdOutput();
int unused;
if (message == NULL)
{
il2cpp::os::File::Write(fileHandle, "", 0, &unused);
}
else
{
std::string formattedMessage = il2cpp::utils::StringUtils::Printf("%s%s", message, newline ? il2cpp::os::Console::NewLine() : "");
il2cpp::os::File::Write(fileHandle, formattedMessage.c_str(), (int)formattedMessage.size(), &unused);
}
}
#endif
}