diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-09-13 08:21:35 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-09-13 08:21:35 +0000 |
| commit | 700f2ff694a67b21272b81a7ca80ba5572e794d9 (patch) | |
| tree | 1b30e220aac51ed530d94bc110985cf3f90cba94 /Source/Core/Common | |
| parent | 52ea8a0fd10f6f4103befb091c1fdc20c2caf8f7 (diff) | |
Lots of code and warning cleanup. OGL/D3D: Moved to a shared config class in VideoCommon. This lets VideoCommon code read the config without ugly hacks. Fixed various config race conditions by keeping a copy (g_ActiveConfig) of the g_Config struct which is updated once per frame.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4256 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/ConsoleListener.cpp | 21 | ||||
| -rw-r--r-- | Source/Core/Common/Src/MemoryUtil.cpp | 2 |
2 files changed, 11 insertions, 12 deletions
diff --git a/Source/Core/Common/Src/ConsoleListener.cpp b/Source/Core/Common/Src/ConsoleListener.cpp index 987eb275b6..e16afb13f3 100644 --- a/Source/Core/Common/Src/ConsoleListener.cpp +++ b/Source/Core/Common/Src/ConsoleListener.cpp @@ -104,25 +104,24 @@ bool ConsoleListener::IsOpen() void ConsoleListener::BufferWidthHeight(int BufferWidth, int BufferHeight, int ScreenWidth, int ScreenHeight, bool BufferFirst) { #ifdef _WIN32 - bool SB, SW; - + BOOL SB, SW; if (BufferFirst) { // Change screen buffer size COORD Co = {BufferWidth, BufferHeight}; - SB = (bool)SetConsoleScreenBufferSize(hConsole, Co); + SB = SetConsoleScreenBufferSize(hConsole, Co); // Change the screen buffer window size SMALL_RECT coo = {0,0,ScreenWidth, ScreenHeight}; // top, left, right, bottom - SW = (bool)SetConsoleWindowInfo(hConsole, TRUE, &coo); + SW = SetConsoleWindowInfo(hConsole, TRUE, &coo); } else { // Change the screen buffer window size SMALL_RECT coo = {0,0, ScreenWidth, ScreenHeight}; // top, left, right, bottom - SW = (bool)SetConsoleWindowInfo(hConsole, TRUE, &coo); + SW = SetConsoleWindowInfo(hConsole, TRUE, &coo); // Change screen buffer size COORD Co = {BufferWidth, BufferHeight}; - SB = (bool)SetConsoleScreenBufferSize(hConsole, Co); + SB = SetConsoleScreenBufferSize(hConsole, Co); } #endif } @@ -158,7 +157,7 @@ COORD ConsoleListener::GetCoordinates(int BytesRead, int BufferWidth) { COORD Ret = {0, 0}; // Full rows - int Step = floor((float)BytesRead / (float)BufferWidth); + int Step = (int)floor((float)BytesRead / (float)BufferWidth); Ret.Y += Step; // Partial row Ret.X = BytesRead - (BufferWidth * Step); @@ -195,7 +194,7 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool const int MAX_BYTES = 1024 * 16; int ReadBufferSize = MAX_BYTES - 32; DWORD cAttrRead = ReadBufferSize; - int BytesRead = 0; + DWORD BytesRead = 0; int i = 0; int LastAttrRead = 0; while (BytesRead < BufferSize) @@ -215,10 +214,10 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool LastAttrRead = cAttrRead; } // Letter space - int LWidth = (int)floor((float)Width / 8.0) - 1.0; - int LHeight = (int)floor((float)Height / 12.0) - 1.0; + int LWidth = (int)(floor((float)Width / 8.0f) - 1.0f); + int LHeight = (int)(floor((float)Height / 12.0f) - 1.0f); int LBufWidth = LWidth + 1; - int LBufHeight = floor((float)BufferSize / (float)LBufWidth); + int LBufHeight = (int)floor((float)BufferSize / (float)LBufWidth); // Change screen buffer size LetterSpace(LBufWidth, LBufHeight); diff --git a/Source/Core/Common/Src/MemoryUtil.cpp b/Source/Core/Common/Src/MemoryUtil.cpp index 478b31248a..bf826beaff 100644 --- a/Source/Core/Common/Src/MemoryUtil.cpp +++ b/Source/Core/Common/Src/MemoryUtil.cpp @@ -150,7 +150,7 @@ std::string MemUsage() if (NULL == hProcess) return "MemUsage Error"; if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc))) - Ret = StringFromFormat("%s K", ThS(pmc.WorkingSetSize / 1024, true, 7).c_str()); + Ret = StringFromFormat("%s K", ThS((int)(pmc.WorkingSetSize / 1024), true, 7).c_str()); CloseHandle(hProcess); return Ret; |
