about summary refs log tree commit diff
path: root/src/engine/client/client.cpp
diff options
context:
space:
mode:
authorghost <ghost91@gmx.net>2010-09-06 21:55:09 +0200
committeroy <Tom_Adams@web.de>2010-09-07 19:32:33 +0200
commit3baf5223302363139e59691fd3d1c658312facf4 (patch)
tree251d43ce7059f1b74e48d4c8178aa0dd309c362d /src/engine/client/client.cpp
parenteecdff0cf5c5153cc55c74e6227a2fd9b7068923 (diff)
downloadzcatch-3baf5223302363139e59691fd3d1c658312facf4.tar.gz
zcatch-3baf5223302363139e59691fd3d1c658312facf4.zip
added the option to hide the console window on the client, too. Fixes #48
Diffstat (limited to 'src/engine/client/client.cpp')
-rw-r--r--src/engine/client/client.cpp17
1 files changed, 17 insertions, 0 deletions
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 <windows.h>
+#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");