summaryrefslogtreecommitdiffstats
path: root/source/MCLogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/MCLogger.cpp')
-rw-r--r--source/MCLogger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/MCLogger.cpp b/source/MCLogger.cpp
index 94a2ea1c7..b0ec4efd5 100644
--- a/source/MCLogger.cpp
+++ b/source/MCLogger.cpp
@@ -10,6 +10,9 @@
cMCLogger * cMCLogger::s_MCLogger = NULL;
+#ifdef _WIN32
+ HANDLE g_Console = GetStdHandle(STD_OUTPUT_HANDLE);
+#endif
@@ -145,8 +148,7 @@ void cMCLogger::Error(const char* a_Format, va_list a_ArgList)
void cMCLogger::SetColor( unsigned char a_Color )
{
#ifdef _WIN32
- HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
- SetConsoleTextAttribute( hConsole, a_Color );
+ SetConsoleTextAttribute(g_Console, a_Color);
#else
(void)a_Color;
#endif