From f46c64c02f4ae500ed06fd86a24f623536c676ef Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Thu, 7 Aug 2008 02:49:56 +0000 Subject: [PATCH] fixed(ogl): resolution detection on widnows, configdlg.cpp compile problems on non-windows, and fixed the recently broked texfmtoverlay ... >_< git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@145 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp | 13 ++--- Source/Plugins/Plugin_VideoOGL/Src/Globals.h | 54 +++++++++---------- .../Plugin_VideoOGL/Src/TextureMngr.cpp | 2 + Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 8 +-- 4 files changed, 32 insertions(+), 45 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 5c8a8a152c..acbe221cfa 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -93,20 +93,12 @@ void ConfigDialog::CreateGUIControls() wxStaticText *FSText = new wxStaticText(m_PageVideo, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0); wxArrayString arrayStringFor_FullscreenCB; m_FullscreenCB = new wxComboBox(m_PageVideo, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator); -#ifdef MACOSX m_FullscreenCB->SetValue(wxString::FromAscii(g_Config.iFSResolution)); -#else - m_FullscreenCB->SetValue(g_Config.iFSResolution); -#endif + wxStaticText *WMText = new wxStaticText(m_PageVideo, ID_WMTEXT, wxT("Windowed resolution:"), wxDefaultPosition, wxDefaultSize, 0); wxArrayString arrayStringFor_WindowResolutionCB; m_WindowResolutionCB = new wxComboBox(m_PageVideo, ID_WINDOWRESOLUTIONCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator); - -#ifdef MACOSX m_WindowResolutionCB->SetValue(wxString::FromAscii(g_Config.iWindowedRes)); -#else - m_WindowResolutionCB->SetValue(g_Config.iWindowedRes); -#endif //page2 m_ForceFiltering = new wxCheckBox(m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (May cause small glitches)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -291,6 +283,7 @@ void ConfigDialog::DumpTexturesChange(wxCommandEvent& event) void ConfigDialog::TexturePathChange(wxFileDirPickerEvent& event) { - //note: if a user inputs an incorrect path, this event wil not be fired. + //note: if a user inputs an incorrect path(by typing, not by choosing from + // the combobox, this event wil not be fired. strcpy(g_Config.texDumpPath,event.GetPath().mb_str()); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h index 782624b9b2..629dcfc188 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h @@ -154,43 +154,39 @@ struct Config void Load(); void Save(); - int iAdapter; - char iFSResolution[16]; - int iMultisampleMode; - - int iPostprocessEffect; - int iCompileDLsLevel; - + //video + bool bFullscreen; bool renderToMainframe; - int iLog; // CONF_ bits - bool bFullscreen; - bool bWireFrame; - bool bOverlayStats; - bool bDumpTextures; - bool bOldCard; - bool bShowShaderErrors; - //enhancements + char iFSResolution[16]; + char iWindowedRes[16]; + bool bForceFiltering; bool bForceMaxAniso; - bool bPreUpscale; - int iPreUpscaleFilter; - - bool bTruform; - int iTruformLevel; - - char iWindowedRes[16]; - int aa; // anti-aliasing level - - char psProfile[16]; - char vsProfile[16]; - - bool bTexFmtOverlayEnable; + bool bTexFmtOverlayEnable; bool bTexFmtOverlayCenter; + bool bOverlayStats; + bool bDumpTextures; + char texDumpPath[280]; int iSaveTargetId; - char texDumpPath[280]; + //currently unused: + int aa; // anti-aliasing level + int iLog; // CONF_ bits + int iAdapter; + int iMultisampleMode; + char psProfile[16]; + char vsProfile[16]; + int iPostprocessEffect; + int iCompileDLsLevel; + bool bPreUpscale; + int iPreUpscaleFilter; + bool bTruform; + int iTruformLevel; + bool bOldCard; + bool bWireFrame; + bool bShowShaderErrors; }; extern Config g_Config; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 28c0932347..98cd90cce7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -87,6 +87,7 @@ void TextureMngr::Init() { temp = (u8*)AllocateMemoryPages(TEMP_SIZE); nTex2DEnabled = nTexRECTEnabled = 0; + TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter); } void TextureMngr::Invalidate() @@ -95,6 +96,7 @@ void TextureMngr::Invalidate() for (;iter!=textures.end();iter++) iter->second.Destroy(); textures.clear(); + TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter); } void TextureMngr::Shutdown() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 710bc5d0c2..4f159ff31c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -70,16 +70,13 @@ void DllConfig(HWND _hParent) DWORD iModeNum = 0; DEVMODE dmi; - + int x = 0, y = 0; ZeroMemory(&dmi, sizeof(dmi)); dmi.dmSize = sizeof(dmi); - - int x = 0, y = 0; while(EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0) { - //TODO check against all older resolutions, not just the previous - if(x != dmi.dmPelsWidth && y != dmi.dmPelsHeight && dmi.dmBitsPerPel == 32) + if((x != dmi.dmPelsWidth && y != dmi.dmPelsHeight) && (dmi.dmPelsWidth > x)) { char szBuffer[100]; sprintf(szBuffer,"%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight); @@ -90,7 +87,6 @@ void DllConfig(HWND _hParent) } ZeroMemory(&dmi, sizeof(dmi)); } - frame.ShowModal(); win.SetHWND(0);