From 3baf5223302363139e59691fd3d1c658312facf4 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 6 Sep 2010 21:55:09 +0200 Subject: added the option to hide the console window on the client, too. Fixes #48 --- src/engine/client/client.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/engine/client/client.cpp') diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 6ddf364f..42dd4a9e 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -25,6 +25,12 @@ #include "client.h" +#if defined(CONF_FAMILY_WINDOWS) + #define _WIN32_WINNT 0x0500 + #define NOGDI + #include +#endif + void CGraph::Init(float Min, float Max) { @@ -1997,6 +2003,17 @@ extern "C" int SDL_main(int argc, const char **argv) // ignore_convention int main(int argc, const char **argv) // ignore_convention #endif { +#if defined(CONF_FAMILY_WINDOWS) + for(int i = 1; i < argc; i++) // ignore_convention + { + if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention + { + ShowWindow(GetConsoleWindow(), SW_HIDE); + break; + } + } +#endif + // init the engine dbg_msg("client", "starting..."); m_Client.InitEngine("Teeworlds"); -- cgit 1.4.1