From 1365abfbff9f32b47d84a1283fa11d25e4d82cab Mon Sep 17 00:00:00 2001 From: daco65 Date: Tue, 26 Aug 2008 13:15:25 +0000 Subject: [PATCH] OGL resolution fixing in Windows. report if anything went wrong (worked great here for me) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@326 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 905bd4155d..33c063caae 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -74,21 +74,29 @@ void DllConfig(HWND _hParent) DWORD iModeNum = 0; DEVMODE dmi; - unsigned int x = 0, y = 0; ZeroMemory(&dmi, sizeof(dmi)); dmi.dmSize = sizeof(dmi); + std::string resos[100]; + int i = 0; - while (EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0) + while(EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0) { - if((x != dmi.dmPelsWidth || y != dmi.dmPelsHeight) && (dmi.dmPelsWidth >= x)) - { char szBuffer[100]; sprintf(szBuffer,"%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight); - frame.AddFSReso(szBuffer); - frame.AddWindowReso(szBuffer); - x = dmi.dmPelsWidth; - y = dmi.dmPelsHeight; - } + //making a string cause char*[] to char was a baaad idea + std::string strBuffer(szBuffer); + //create a check loop to check every pointer of resos to see if the res is added or not + int b = 0; + bool resFound = false; + while(b < i && !resFound) + { + //is the res already added? + resFound = (resos[b] == strBuffer); + b++; + } + if(!resFound) + //and add the res + { resos[i] = strBuffer; i++; frame.AddFSReso(szBuffer); frame.AddWindowReso(szBuffer); } ZeroMemory(&dmi, sizeof(dmi)); } frame.ShowModal();