From c20b9801d42a01351ea7dfc3d37ce7c6c80550b5 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Mon, 1 Mar 2021 15:05:46 +0100 Subject: [PATCH] Don't allocate the windows console default --- CMakeLists.txt | 2 +- src/engine/client/client.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5f84cac4..67173ed11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1890,7 +1890,7 @@ if(CLIENT) # Target set(TARGET_CLIENT ${CLIENT_EXECUTABLE}) - add_executable(${TARGET_CLIENT} + add_executable(${TARGET_CLIENT} WIN32 ${CLIENT_SRC} ${CLIENT_ICON} ${CLIENT_MANIFEST} diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 87e9323c3..a59442f7c 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -4270,10 +4270,12 @@ int main(int argc, const char **argv) // ignore_convention if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention { Silent = true; + } + else if(str_comp("-c", argv[i]) == 0 || str_comp("--console", argv[i]) == 0) // ignore_convention + { #if defined(CONF_FAMILY_WINDOWS) - FreeConsole(); + AllocConsole(); #endif - break; } } @@ -4367,6 +4369,11 @@ int main(int argc, const char **argv) // ignore_convention pConsole->ExecuteFile(CONFIG_FILE); } +#if defined(CONF_FAMILY_WINDOWS) + if(g_Config.m_ClShowConsole) + AllocConsole(); +#endif + // execute autoexec file File = pStorage->OpenFile(AUTOEXEC_CLIENT_FILE, IOFLAG_READ, IStorage::TYPE_ALL); if(File) @@ -4408,11 +4415,6 @@ int main(int argc, const char **argv) // ignore_convention pClient->Engine()->InitLogfile(); -#if defined(CONF_FAMILY_WINDOWS) - if(!g_Config.m_ClShowConsole) - FreeConsole(); -#endif - // run the client dbg_msg("client", "starting..."); pClient->Run();