Don't allocate the windows console default

This commit is contained in:
Jupeyy 2021-03-01 15:05:46 +01:00
parent 020d8c8913
commit c20b9801d4
2 changed files with 10 additions and 8 deletions

View file

@ -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}

View file

@ -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();