mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Removing Debug Console
This commit is contained in:
parent
4521994088
commit
09b86dcb35
1 changed files with 0 additions and 45 deletions
|
@ -33,7 +33,6 @@ extern int IsLevelLoading;
|
||||||
extern GameFlow* g_GameFlow;
|
extern GameFlow* g_GameFlow;
|
||||||
extern GameScript* g_GameScript;
|
extern GameScript* g_GameScript;
|
||||||
extern GameConfiguration g_Configuration;
|
extern GameConfiguration g_Configuration;
|
||||||
DWORD DebugConsoleThreadID;
|
|
||||||
DWORD MainThreadID;
|
DWORD MainThreadID;
|
||||||
bool BlockAllInput = true;
|
bool BlockAllInput = true;
|
||||||
int skipLoop = -1;
|
int skipLoop = -1;
|
||||||
|
@ -191,12 +190,6 @@ void HandleScriptMessage(WPARAM wParam)
|
||||||
|
|
||||||
LRESULT CALLBACK WinAppProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WinAppProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if (msg == WM_USER + 0)
|
|
||||||
{
|
|
||||||
HandleScriptMessage(wParam);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disables ALT + SPACE
|
// Disables ALT + SPACE
|
||||||
if (msg == WM_SYSCOMMAND && wParam == SC_KEYMENU)
|
if (msg == WM_SYSCOMMAND && wParam == SC_KEYMENU)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -388,44 +381,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
UpdateWindow(WindowsHandle);
|
UpdateWindow(WindowsHandle);
|
||||||
ShowWindow(WindowsHandle, nShowCmd);
|
ShowWindow(WindowsHandle, nShowCmd);
|
||||||
|
|
||||||
//Create debug script terminal
|
|
||||||
if (Debug)
|
|
||||||
{
|
|
||||||
MainThreadID = GetWindowThreadProcessId(WindowsHandle, NULL);
|
|
||||||
AllocConsole();
|
|
||||||
HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE);
|
|
||||||
DWORD consoleModeIn;
|
|
||||||
int hCrt = _open_osfhandle((long)handle_in, _O_BINARY);
|
|
||||||
FILE* hf_in = _fdopen(hCrt, "r");
|
|
||||||
setvbuf(hf_in, NULL, _IONBF, 512);
|
|
||||||
GetConsoleMode(handle_in, &consoleModeIn);
|
|
||||||
consoleModeIn = consoleModeIn | ENABLE_LINE_INPUT;
|
|
||||||
SetConsoleMode(handle_in, consoleModeIn);
|
|
||||||
freopen_s(&hf_in, "CONIN$", "r", stdin);
|
|
||||||
|
|
||||||
HANDLE ConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
int SystemOutput = _open_osfhandle(intptr_t(ConsoleOutput), _O_TEXT);
|
|
||||||
FILE* COutputHandle = _fdopen(SystemOutput, "w");
|
|
||||||
freopen_s(&COutputHandle, "CONOUT$", "w", stdout);
|
|
||||||
|
|
||||||
LPTHREAD_START_ROUTINE readConsoleLoop = [](LPVOID params) -> DWORD {
|
|
||||||
DWORD read;
|
|
||||||
CHAR buffer[4096];
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
BOOL success = ReadFile(params, &buffer, 4096, &read, NULL);
|
|
||||||
if (success && read > 2)
|
|
||||||
{
|
|
||||||
//Only send the actual written message minus \r\n
|
|
||||||
string msg(buffer, read-2);
|
|
||||||
SendMessage(WindowsHandle, WM_USER, (WPARAM)&msg, NULL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
CreateThread(NULL, 0, readConsoleLoop, handle_in, 0, &DebugConsoleThreadID);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetCursor(NULL);
|
SetCursor(NULL);
|
||||||
ShowCursor(FALSE);
|
ShowCursor(FALSE);
|
||||||
hAccTable = LoadAccelerators(hInstance, (LPCSTR)0x65);
|
hAccTable = LoadAccelerators(hInstance, (LPCSTR)0x65);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue