diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp index 8788bc7c3a..4f749eef51 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp @@ -85,11 +85,6 @@ void Config::Load() iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0); iniFile.Get("Hacks", "ProjectionHax2", &bProjectionHax2, 0); iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0); - iniFile.Get("Hacks", "ScreenSize", &bScreenSize, false); - iniFile.Get("Hacks", "ScreenWidth", &iScreenWidth, 100); - iniFile.Get("Hacks", "ScreenHeight", &iScreenHeight, 100); - iniFile.Get("Hacks", "ScreenLeft", &iScreenLeft, 0); - iniFile.Get("Hacks", "ScreenTop", &iScreenTop, 0); } void Config::Save() @@ -131,11 +126,6 @@ void Config::Save() iniFile.Set("Hacks", "ProjectionHax1", bProjectionHax1); iniFile.Set("Hacks", "ProjectionHax2", bProjectionHax2); iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToRAM); - iniFile.Set("Hacks", "ScreenSize", bScreenSize); - iniFile.Set("Hacks", "ScreenWidth", iScreenWidth); - iniFile.Set("Hacks", "ScreenHeight", iScreenHeight); - iniFile.Set("Hacks", "ScreenLeft", iScreenLeft); - iniFile.Set("Hacks", "ScreenTop", iScreenTop); iniFile.Save(FULL_CONFIG_DIR "gfx_opengl.ini"); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.h b/Source/Plugins/Plugin_VideoOGL/Src/Config.h index f392f4b7d3..2f701aca92 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.h @@ -72,10 +72,6 @@ struct Config bool bProjectionHax2; bool bCopyEFBToRAM; - // Screen size - int iScreenWidth, iScreenHeight, iScreenLeft, iScreenTop; - bool bScreenSize; - int iLog; // CONF_ bits int iSaveTargetId; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 2a7bbabb77..6b96a30fce 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -55,13 +55,6 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog) EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_PROJECTIONHACK2,ConfigDialog::AdvancedSettingsChanged) - // Screen size - EVT_COMMAND_SCROLL(IDS_WIDTH, ConfigDialog::AdvancedSettingsChangedScroll) - EVT_COMMAND_SCROLL(IDS_HEIGHT, ConfigDialog::AdvancedSettingsChangedScroll) - EVT_COMMAND_SCROLL(IDS_LEFT, ConfigDialog::AdvancedSettingsChangedScroll) - EVT_COMMAND_SCROLL(IDS_TOP, ConfigDialog::AdvancedSettingsChangedScroll) - EVT_CHECKBOX(IDC_SCREEN_SIZE, ConfigDialog::AdvancedSettingsChanged) - EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged) EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH, ConfigDialog::TexturePathChange) @@ -345,60 +338,7 @@ void ConfigDialog::CreateGUIControls() sHacks->Add(m_SafeTextureCache, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5); sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks")); - sbHacks->Add(sHacks); - - - // ----------------------------------------------- - // Screen size - // --------------------- - // Controls - m_TextScreenWidth = new wxStaticText(m_PageAdvanced, wxID_ANY, wxT("Width: 000")); - m_TextScreenHeight = new wxStaticText(m_PageAdvanced, wxID_ANY, wxT("Height: 000")); - m_TextScreenLeft = new wxStaticText(m_PageAdvanced, wxID_ANY, wxT("Left: -000")); - m_TextScreenTop = new wxStaticText(m_PageAdvanced, wxID_ANY, wxT("Top: -000")); - - m_SliderWidth = new wxSlider(m_PageAdvanced, IDS_WIDTH, 100, 50, 150, wxDefaultPosition, wxSize(75, -1)); - m_SliderHeight = new wxSlider(m_PageAdvanced, IDS_HEIGHT, 100, 50, 150, wxDefaultPosition, wxSize(75, -1)); - m_SliderLeft = new wxSlider(m_PageAdvanced, IDS_LEFT, 0, -100, 100, wxDefaultPosition, wxSize(75, -1)); - m_SliderTop = new wxSlider(m_PageAdvanced, IDS_TOP, 0, -100, 100, wxDefaultPosition, wxSize(75, -1)); - m_ScreenSize = new wxCheckBox(m_PageAdvanced, IDC_SCREEN_SIZE, wxT("Adjust screen size and position"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - - // Default values - m_SliderWidth->SetValue(g_Config.iScreenWidth); - m_SliderHeight->SetValue(g_Config.iScreenHeight); - m_SliderLeft->SetValue(g_Config.iScreenLeft); - m_SliderTop->SetValue(g_Config.iScreenTop); - m_ScreenSize->SetValue(g_Config.bScreenSize); - - // Sizers - wxBoxSizer *m_SizerScreenSizeWidth = new wxBoxSizer(wxHORIZONTAL); - m_SizerScreenSizeWidth->Add(m_TextScreenWidth, 0, wxEXPAND | (wxTOP), 3); - m_SizerScreenSizeWidth->Add(m_SliderWidth, 0, wxEXPAND | (wxLEFT), 0); - m_SizerScreenSizeWidth->Add(m_TextScreenLeft, 0, wxEXPAND | (wxLEFT), 5); - m_SizerScreenSizeWidth->Add(m_SliderLeft, 0, wxEXPAND | (wxLEFT), 0); - - wxBoxSizer *m_SizerScreenSizeHeight = new wxBoxSizer(wxHORIZONTAL); - m_SizerScreenSizeHeight->Add(m_TextScreenHeight, 0, wxEXPAND | (wxTOP), 3); - m_SizerScreenSizeHeight->Add(m_SliderHeight, 0, wxEXPAND | (wxLEFT), 0); - m_SizerScreenSizeHeight->Add(m_TextScreenTop, 0, wxEXPAND | (wxLEFT), 5); - m_SizerScreenSizeHeight->Add(m_SliderTop, 0, wxEXPAND | (wxLEFT), 0); - - wxStaticBoxSizer * m_SizerScreenSize = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Screen size and position")); - m_SizerScreenSize->Add(m_ScreenSize, 0, wxEXPAND | (wxALL), 5); - m_SizerScreenSize->Add(m_SizerScreenSizeWidth, 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); - m_SizerScreenSize->Add(m_SizerScreenSizeHeight, 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); - - // Tool tips - m_ScreenSize->SetToolTip(wxT("Use the adjusted screen size.")); - // ------------------------------- - - // ----------------------------------------------- - // Row 4: Hacks and Screen size - // --------------------- - wxBoxSizer *m_SizerHacksScreenSize = new wxBoxSizer(wxHORIZONTAL); - m_SizerHacksScreenSize->Add(sbHacks, 0, wxEXPAND | (wxTOP), 0); - m_SizerHacksScreenSize->Add(m_SizerScreenSize, 0, wxEXPAND | (wxLEFT), 7); - // ------------------------------- + sbHacks->Add(sHacks, 0, wxEXPAND | (wxTOP), 0); // Sizers sAdvanced = new wxBoxSizer(wxVERTICAL); @@ -438,7 +378,7 @@ void ConfigDialog::CreateGUIControls() sAdvanced->Add(sbInfo, 0, wxEXPAND | wxALL, 5); sAdvanced->Add(sbRendering, 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); sAdvanced->Add(sbUtilities, 1, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); - sAdvanced->Add(m_SizerHacksScreenSize, 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); + sAdvanced->Add(sbHacks, 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5); m_PageAdvanced->SetSizer(sAdvanced); sAdvanced->Layout(); @@ -501,28 +441,6 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event) UpdateGUI(); } -// Apparently we need a scroll event version of this for the sliders -void ConfigDialog::AdvancedSettingsChangedScroll(wxScrollEvent& event) -{ - switch (event.GetId()) - { - // Screen size - case IDS_WIDTH: - g_Config.iScreenWidth = m_SliderWidth->GetValue(); - break; - case IDS_HEIGHT: - g_Config.iScreenHeight = m_SliderHeight->GetValue(); - break; - case IDS_LEFT: - g_Config.iScreenLeft = m_SliderLeft->GetValue(); - break; - case IDS_TOP: - g_Config.iScreenTop = m_SliderTop->GetValue(); - break; - } - - UpdateGUI(); -} void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event) { @@ -580,10 +498,6 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event) case ID_SAFETEXTURECACHE: g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked(); break; - // Screen size - case IDC_SCREEN_SIZE: - g_Config.bScreenSize = m_ScreenSize->GetValue(); - break; // Extented frame buffer case ID_RADIO_COPYEFBTORAM: TextureMngr::ClearRenderTargets(); @@ -619,10 +533,4 @@ void ConfigDialog::UpdateGUI() m_Fullscreen->Enable(!g_Config.renderToMainframe); m_FullscreenCB->Enable(!g_Config.renderToMainframe); m_WindowResolutionCB->Enable(!g_Config.renderToMainframe); - - // Update screen size labels - m_TextScreenWidth->SetLabel(wxString::Format(wxT("Width: %i"), g_Config.iScreenWidth)); - m_TextScreenHeight->SetLabel(wxString::Format(wxT("Height: %i"), g_Config.iScreenHeight)); - m_TextScreenLeft->SetLabel(wxString::Format(wxT("Left: %i"), g_Config.iScreenLeft)); - m_TextScreenTop->SetLabel(wxString::Format(wxT("Top: %i"), g_Config.iScreenTop)); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h index 0a84fc334d..b66007751c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h @@ -167,11 +167,6 @@ class ConfigDialog : public wxDialog ID_PROJECTIONHACK2, ID_RADIO_COPYEFBTORAM, ID_RADIO_COPYEFBTOGL, - - // Screen size - IDS_WIDTH, IDS_LEFT, - IDS_HEIGHT, IDS_TOP, - IDC_SCREEN_SIZE }; void OnClose(wxCloseEvent& event); @@ -180,7 +175,6 @@ class ConfigDialog : public wxDialog void AboutClick(wxCommandEvent& event); void GeneralSettingsChanged(wxCommandEvent& event); void AdvancedSettingsChanged(wxCommandEvent& event); - void AdvancedSettingsChangedScroll(wxScrollEvent& event); void TexturePathChange(wxFileDirPickerEvent& event); }; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index f73945d9b2..6638a7b6c3 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -697,7 +697,7 @@ bool Renderer::SetScissorRect() { /* I don't know how this works with other options so I'm limiting it to this to test it, if you want to add support for other modes or make this solution more general please do */ - if(g_Config.bStretchToFit && !g_Config.bKeepAR) + if(g_Config.bStretchToFit && !g_Config.bKeepAR && !g_Config.bUseXFB) { int WidthDifference = 640 - (int)(rc_right - rc_left); int HeightDifference = 480 - (int)(rc_bottom - rc_top); @@ -1274,29 +1274,8 @@ void UpdateViewport() } // ------------------------------------- - // ----------------------------------------------------------------------- - // Adjust the screen size. If someone figures out how to correctly adjust the screen size as the GC or Wii does, this may not be needed. - // ------------------ - if (g_Config.bScreenSize) - { - // Calculate width and height as a fraction of the current - float Width = (float)GLWidth * ((float)g_Config.iScreenWidth / 100.0); - float Height = (float)GLHeight * ((float)g_Config.iScreenHeight / 100.0); - - // Adjust X and Y - GLx = GLx + g_Config.iScreenLeft; - GLy = GLy - g_Config.iScreenTop; - - GLWidth = (int)Width; - GLHeight = (int)Height; - - //Console::Print("W:%i H:%i W:%f H:%f Wid:%i Hei:%i x:%i y:%i\n", g_Config.iScreenWidth, g_Config.iScreenHeight, Width, Height, GLWidth, GLHeight, GLx, GLy); - } - // ------------------------------------- - - - // I'm limiting it to this modes to test it - if(g_Config.bStretchToFit && !g_Config.bKeepAR) + // I'm limiting it to these modes to test it + if(g_Config.bStretchToFit && !g_Config.bKeepAR && !g_Config.bUseXFB) { GLWidth = GLWidth + (GLScissorW - 640); GLHeight = GLHeight + (GLScissorH - 480); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/XFB.cpp b/Source/Plugins/Plugin_VideoOGL/Src/XFB.cpp index 2342216848..06815e7973 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/XFB.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/XFB.cpp @@ -16,7 +16,17 @@ // http://code.google.com/p/dolphin-emu/ -// Preliminary non-working code. +///////////////////////////////////////////////////////////////////////// +// File description +/* --------------- + +This file handles the External Frame Buffer (XFB). The XFB is a storage point when the picture is resized +by the system to the correct display format for output to the TV. In most cases its function can be +supplemented by the equivalent adjustments in glScissor and glViewport (or their DirectX equivalents). But +for some homebrew games these functions are necessary because the homebrew game communicate directly with +them. + +///////////////////////////////////*/ #include "Globals.h" #include "GLUtil.h"