diff options
| author | Petr Mrázek | 2011-06-25 08:05:17 +0200 |
|---|---|---|
| committer | Petr Mrázek | 2011-06-25 08:05:17 +0200 |
| commit | 722531f590a9f099b671c641d4c5afe3a2658b20 (patch) | |
| tree | 3c8115d78f53e7ea1ade8245b3a465c694a894a7 /library/Console-windows.cpp | |
| parent | 6fd7d42f0093ec5d057f35cd0a652c9ad254fc30 (diff) | |
| download | dfhack-722531f590a9f099b671c641d4c5afe3a2658b20.tar.gz dfhack-722531f590a9f099b671c641d4c5afe3a2658b20.tar.bz2 dfhack-722531f590a9f099b671c641d4c5afe3a2658b20.tar.xz | |
Added destructor code for PluginManager, console color reset funstion.
Diffstat (limited to 'library/Console-windows.cpp')
| -rw-r--r-- | library/Console-windows.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/Console-windows.cpp b/library/Console-windows.cpp index 63035c6d..3655b66d 100644 --- a/library/Console-windows.cpp +++ b/library/Console-windows.cpp @@ -50,6 +50,7 @@ duthomhas::stdiobuf * stream_o = 0; HANDLE g_hConsoleOut; // Handle to debug console HWND ConsoleWindow; +WORD default_attributes; // FIXME: prime candidate for being a singleton... indeed. Console::Console() @@ -68,6 +69,7 @@ Console::Console() // set the screen buffer to be big enough to let us scroll text GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); + default_attributes = coninfo.wAttributes; coninfo.dwSize.Y = MAX_CONSOLE_LINES; // How many lines do you want to have in the console buffer SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize); @@ -119,6 +121,13 @@ void Console::color(int index) SetConsoleTextAttribute(hConsole, index); } +void Console::reset_color( void ) +{ + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hConsole, default_attributes); +} + + void Console::cursor(bool enable) { if(enable) |
