diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 66828dab8d..c24370b8e2 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -132,6 +132,7 @@ void SConfig::SaveSettings() ini.Set("Display", "RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos); ini.Set("Display", "RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth); ini.Set("Display", "RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight); + ini.Set("Display", "RenderWindowAutoSize", m_LocalCoreStartupParameter.bRenderWindowAutoSize); ini.Set("Display", "ProgressiveScan", m_LocalCoreStartupParameter.bProgressive); ini.Set("Display", "NTSCJ", m_LocalCoreStartupParameter.bNTSCJ); @@ -256,6 +257,7 @@ void SConfig::LoadSettings() ini.Get("Display", "RenderWindowYPos", &m_LocalCoreStartupParameter.iRenderWindowYPos, -1); ini.Get("Display", "RenderWindowWidth", &m_LocalCoreStartupParameter.iRenderWindowWidth, 640); ini.Get("Display", "RenderWindowHeight", &m_LocalCoreStartupParameter.iRenderWindowHeight, 480); + ini.Get("Display", "RenderWindowAutoSize", &m_LocalCoreStartupParameter.bRenderWindowAutoSize, false); ini.Get("Display", "ProgressiveScan", &m_LocalCoreStartupParameter.bProgressive, false); ini.Get("Display", "NTSCJ", &m_LocalCoreStartupParameter.bNTSCJ, false); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index 0f43597463..23e82231ac 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -56,6 +56,7 @@ SCoreStartupParameter::SCoreStartupParameter() bAutoHideCursor(false), bUsePanicHandlers(true), iRenderWindowXPos(-1), iRenderWindowYPos(-1), iRenderWindowWidth(640), iRenderWindowHeight(480), + bRenderWindowAutoSize(false), bFullscreen(false), bRenderToMain(false), bProgressive(false), iTheme(0), diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 98b103dde6..c5b796d4da 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -102,6 +102,7 @@ struct SCoreStartupParameter std::string strFullscreenResolution; int iRenderWindowXPos, iRenderWindowYPos; int iRenderWindowWidth, iRenderWindowHeight; + bool bRenderWindowAutoSize; bool bFullscreen, bRenderToMain; bool bProgressive; diff --git a/Source/Core/Core/Src/Host.h b/Source/Core/Core/Src/Host.h index fa4d31ddd6..b73c52c556 100644 --- a/Source/Core/Core/Src/Host.h +++ b/Source/Core/Core/Src/Host.h @@ -47,7 +47,7 @@ void Host_UpdateBreakPointView(); void Host_ShowJitResults(unsigned int address); void Host_SetDebugMode(bool enable); void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height); -void Host_RequestRenderWindowSize(int& width, int& height); +void Host_RequestRenderWindowSize(int width, int height); bool Host_RendererHasFocus(); void Host_SetWaitCursor(bool enable); diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index e9cc1a5f08..ef679516fc 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -38,6 +38,8 @@ #include #endif +#define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text, wxDefaultPosition, wxDefaultSize) + extern CFrame* main_frame; // keep these in sync with CConfigMain::InitializeGUILists @@ -108,6 +110,7 @@ EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::CoreSettingsChanged) EVT_CHOICE(ID_DISPLAY_FULLSCREENRES, CConfigMain::DisplaySettingsChanged) EVT_TEXT(ID_DISPLAY_WINDOWWIDTH, CConfigMain::DisplaySettingsChanged) EVT_TEXT(ID_DISPLAY_WINDOWHEIGHT, CConfigMain::DisplaySettingsChanged) +EVT_CHECKBOX(ID_DISPLAY_AUTOSIZE, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_DISPLAY_FULLSCREEN, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_DISPLAY_HIDECURSOR, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_DISPLAY_RENDERTOMAIN, CConfigMain::DisplaySettingsChanged) @@ -329,6 +332,7 @@ void CConfigMain::InitializeGUIValues() FullscreenResolution->SetStringSelection(wxString::FromAscii(startup_params.strFullscreenResolution.c_str())); WindowWidth->SetValue(startup_params.iRenderWindowWidth); WindowHeight->SetValue(startup_params.iRenderWindowHeight); + WindowAutoSize->SetValue(startup_params.bRenderWindowAutoSize); Fullscreen->SetValue(startup_params.bFullscreen); HideCursor->SetValue(startup_params.bHideCursor); RenderToMain->SetValue(startup_params.bRenderToMain); @@ -399,6 +403,7 @@ void CConfigMain::InitializeGUITooltips() FullscreenResolution->SetToolTip(_("Select resolution for fullscreen mode")); WindowWidth->SetToolTip(_("Window width for windowed mode")); WindowHeight->SetToolTip(_("Window height for windowed mode")); + WindowAutoSize->SetToolTip(_("Auto size the window to match the game's output resolution adjusted by the EFB scale.\nIt is best to set the aspect ratio to stretch when using this.")); Fullscreen->SetToolTip(_("Start the rendering window in fullscreen mode.")); HideCursor->SetToolTip(_("Hide the cursor when it is over the rendering window\n and the rendering window has focus.")); RenderToMain->SetToolTip(_("Render to main window.")); @@ -453,7 +458,6 @@ void CConfigMain::CreateGUIControls() SkipIdle = new wxCheckBox(GeneralPage, ID_IDLESKIP, _("Enable Idle Skipping (speedup)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, _("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); // Framelimit - wxStaticText* FramelimitText = new wxStaticText(GeneralPage, ID_FRAMELIMIT_TEXT, _("Framelimit :"), wxDefaultPosition, wxDefaultSize); Framelimit = new wxChoice(GeneralPage, ID_FRAMELIMIT, wxDefaultPosition, wxDefaultSize, arrayStringFor_Framelimit, 0, wxDefaultValidator); UseFPSForLimiting = new wxCheckBox(GeneralPage, ID_FRAMELIMIT_USEFPSFORLIMITING, _("Use FPS For Limiting"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -469,7 +473,7 @@ void CConfigMain::CreateGUIControls() sbBasic->Add(SkipIdle, 0, wxALL, 5); sbBasic->Add(EnableCheats, 0, wxALL, 5); wxBoxSizer* sFramelimit = new wxBoxSizer(wxHORIZONTAL); - sFramelimit->Add(FramelimitText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + sFramelimit->Add(TEXT_BOX(GeneralPage, _("Framelimit :")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sFramelimit->Add(Framelimit, 0, wxALL | wxEXPAND, 5); sFramelimit->Add(UseFPSForLimiting, 0, wxALL | wxEXPAND, 5); sbBasic->Add(sFramelimit, 0, wxALL | wxEXPAND, 5); @@ -490,14 +494,12 @@ void CConfigMain::CreateGUIControls() // Display page // General display settings sbDisplay = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Emulator Display Settings")); - wxStaticText* FullscreenResolutionText = new wxStaticText(DisplayPage, wxID_ANY, _("Fullscreen Display Resolution:"), wxDefaultPosition, wxDefaultSize, 0); FullscreenResolution = new wxChoice(DisplayPage, ID_DISPLAY_FULLSCREENRES, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenResolution, 0, wxDefaultValidator, arrayStringFor_FullscreenResolution[0]); - wxStaticText *WindowSizeText = new wxStaticText(DisplayPage, wxID_ANY, _("Window Size:"), wxDefaultPosition, wxDefaultSize, 0); WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString, wxDefaultPosition, wxSize(70, -1)); WindowWidth->SetRange(0,3280); - wxStaticText *WindowXText = new wxStaticText(DisplayPage, wxID_ANY, wxT("x"), wxDefaultPosition, wxDefaultSize, 0); WindowHeight = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWHEIGHT, wxEmptyString, wxDefaultPosition, wxSize(70, -1)); WindowHeight->SetRange(0,2048); + WindowAutoSize = new wxCheckBox(DisplayPage, ID_DISPLAY_AUTOSIZE, _("Auto"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); Fullscreen = new wxCheckBox(DisplayPage, ID_DISPLAY_FULLSCREEN, _("Start Renderer in Fullscreen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); HideCursor = new wxCheckBox(DisplayPage, ID_DISPLAY_HIDECURSOR, _("Hide Mouse Cursor")); RenderToMain = new wxCheckBox(DisplayPage, ID_DISPLAY_RENDERTOMAIN, _("Render to Main Window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -515,8 +517,6 @@ void CConfigMain::CreateGUIControls() // Interface Language // At the moment this only changes the language displayed in m_gamelistctrl // If someone wants to control the whole GUI's language, it should be set here too - wxStaticText* InterfaceLangText = new wxStaticText(DisplayPage, ID_INTERFACE_LANG_TEXT, - _("Language:"), wxDefaultPosition, wxDefaultSize); InterfaceLang = new wxChoice(DisplayPage, ID_INTERFACE_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_InterfaceLang, 0, wxDefaultValidator); // Hotkey configuration @@ -524,14 +524,16 @@ void CConfigMain::CreateGUIControls() // Populate the settings wxBoxSizer* sDisplayRes = new wxBoxSizer(wxHORIZONTAL); - sDisplayRes->Add(FullscreenResolutionText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + sDisplayRes->Add(TEXT_BOX(DisplayPage, _("Fullscreen Display Resolution:")), + 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sDisplayRes->Add(FullscreenResolution, 0, wxEXPAND | wxALL, 5); sbDisplay->Add(sDisplayRes, 0, wxALL, 5); wxBoxSizer* sDisplaySize = new wxBoxSizer(wxHORIZONTAL); - sDisplaySize->Add(WindowSizeText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + sDisplaySize->Add(TEXT_BOX(DisplayPage, _("Window Size:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sDisplaySize->Add(WindowWidth, 0, wxEXPAND | wxALL, 5); - sDisplaySize->Add(WindowXText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + sDisplaySize->Add(TEXT_BOX(DisplayPage, wxT("x")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sDisplaySize->Add(WindowHeight, 0, wxEXPAND | wxALL, 5); + sDisplaySize->Add(WindowAutoSize, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sbDisplay->Add(sDisplaySize, 0, wxALL, 5); sbDisplay->Add(Fullscreen, 0, wxEXPAND | wxALL, 5); sbDisplay->Add(HideCursor, 0, wxALL, 5); @@ -543,7 +545,7 @@ void CConfigMain::CreateGUIControls() sbInterface->Add(UsePanicHandlers, 0, wxALL, 5); sbInterface->Add(Theme, 0, wxEXPAND | wxALL, 5); wxBoxSizer* sInterface = new wxBoxSizer(wxHORIZONTAL); - sInterface->Add(InterfaceLangText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + sInterface->Add(TEXT_BOX(DisplayPage, _("Language:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); sInterface->Add(InterfaceLang, 0, wxEXPAND | wxALL, 5); sInterface->AddStretchSpacer(); sInterface->Add(HotkeyConfig, 0, wxALIGN_RIGHT | wxALL, 5); @@ -560,15 +562,14 @@ void CConfigMain::CreateGUIControls() // Gamecube page // IPL settings sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("IPL Settings")); - wxStaticText* GCSystemLangText = new wxStaticText(GamecubePage, ID_GC_SRAM_LNG_TEXT, _("System Language:"), wxDefaultPosition, wxDefaultSize); GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator); // Device settings // EXI Devices wxStaticBoxSizer *sbGamecubeDeviceSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("Device Settings")); wxStaticText* GCEXIDeviceText[3]; - GCEXIDeviceText[0] = new wxStaticText(GamecubePage, ID_GC_EXIDEVICE_SLOTA_TEXT, wxT("Slot A"), wxDefaultPosition, wxDefaultSize); - GCEXIDeviceText[1] = new wxStaticText(GamecubePage, ID_GC_EXIDEVICE_SLOTB_TEXT, wxT("Slot B"), wxDefaultPosition, wxDefaultSize); - GCEXIDeviceText[2] = new wxStaticText(GamecubePage, ID_GC_EXIDEVICE_SP1_TEXT, wxT("SP1 "), wxDefaultPosition, wxDefaultSize); + GCEXIDeviceText[0] = TEXT_BOX(GamecubePage, _("Slot A")); + GCEXIDeviceText[1] = TEXT_BOX(GamecubePage, _("Slot B")); + GCEXIDeviceText[2] = TEXT_BOX(GamecubePage, wxT("SP1 ")); const wxString SlotDevices[] = {_(DEV_NONE_STR), _(DEV_DUMMY_STR), _(EXIDEV_MEMCARD_STR), _(EXIDEV_GECKO_STR) #if HAVE_PORTAUDIO , _(EXIDEV_MIC_STR) @@ -617,10 +618,10 @@ void CConfigMain::CreateGUIControls() } //SI Devices wxStaticText* GCSIDeviceText[4]; - GCSIDeviceText[0] = new wxStaticText(GamecubePage, ID_GC_SIDEVICE_TEXT, wxT("Port 1"), wxDefaultPosition, wxDefaultSize); - GCSIDeviceText[1] = new wxStaticText(GamecubePage, ID_GC_SIDEVICE_TEXT, wxT("Port 2"), wxDefaultPosition, wxDefaultSize); - GCSIDeviceText[2] = new wxStaticText(GamecubePage, ID_GC_SIDEVICE_TEXT, wxT("Port 3"), wxDefaultPosition, wxDefaultSize); - GCSIDeviceText[3] = new wxStaticText(GamecubePage, ID_GC_SIDEVICE_TEXT, wxT("Port 4"), wxDefaultPosition, wxDefaultSize); + GCSIDeviceText[0] = TEXT_BOX(GamecubePage, _("Port 1")); + GCSIDeviceText[1] = TEXT_BOX(GamecubePage, _("Port 2")); + GCSIDeviceText[2] = TEXT_BOX(GamecubePage, _("Port 3")); + GCSIDeviceText[3] = TEXT_BOX(GamecubePage, _("Port 4")); // SIDEV_AM_BB_STR must be last! const wxString SIDevices[] = {_(DEV_NONE_STR),_(SIDEV_STDCONT_STR),_(SIDEV_GBA_STR),_(SIDEV_AM_BB_STR)}; static const int numSIDevices = sizeof(SIDevices)/sizeof(wxString); @@ -650,7 +651,8 @@ void CConfigMain::CreateGUIControls() // Populate the settings sGamecubeIPLSettings = new wxGridBagSizer(); - sGamecubeIPLSettings->Add(GCSystemLangText, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sGamecubeIPLSettings->Add(TEXT_BOX(GamecubePage, _("System Language:")), + wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(0, 1), wxDefaultSpan, wxALL, 5); sbGamecubeIPLSettings->Add(sGamecubeIPLSettings); wxBoxSizer *sEXIDevices[4], *sSIDevices[4]; @@ -682,9 +684,7 @@ void CConfigMain::CreateGUIControls() // Wii page // Wiimote Settings sbWiimoteSettings = new wxStaticBoxSizer(wxHORIZONTAL, WiiPage, _("Wiimote Settings")); - wxStaticText* WiiSensBarPosText = new wxStaticText(WiiPage, ID_WII_BT_BAR_TEXT, _("Sensor Bar Position:"), wxDefaultPosition, wxDefaultSize); WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator); - wxStaticText* WiiSensBarSensText = new wxStaticText(WiiPage, ID_WII_BT_SENS_TEXT, _("IR Sensitivity:"), wxDefaultPosition, wxDefaultSize); WiiSensBarSens = new wxSlider(WiiPage, ID_WII_BT_SENS, 0, 0, 4); WiimoteMotor = new wxCheckBox(WiiPage, ID_WII_BT_MOT, _("Wiimote Motor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -692,9 +692,7 @@ void CConfigMain::CreateGUIControls() sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, _("Misc Settings")); WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, _("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use EuRGB60 Mode (PAL60)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - wxStaticText* WiiAspectRatioText = new wxStaticText(WiiPage, ID_WII_IPL_AR_TEXT, _("Aspect Ratio:"), wxDefaultPosition, wxDefaultSize); WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator); - wxStaticText* WiiSystemLangText = new wxStaticText(WiiPage, ID_WII_IPL_LNG_TEXT, _("System Language:"), wxDefaultPosition, wxDefaultSize); WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator); // Device Settings @@ -704,9 +702,11 @@ void CConfigMain::CreateGUIControls() // Populate the settings sWiimoteSettings = new wxGridBagSizer(); - sWiimoteSettings->Add(WiiSensBarPosText, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sWiimoteSettings->Add(TEXT_BOX(WiiPage, _("Sensor Bar Position:")), + wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sWiimoteSettings->Add(WiiSensBarPos, wxGBPosition(0, 1), wxDefaultSpan, wxALL, 5); - sWiimoteSettings->Add(WiiSensBarSensText, wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sWiimoteSettings->Add(TEXT_BOX(WiiPage, _("IR Sensitivity:")), + wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sWiimoteSettings->Add(WiiSensBarSens, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND|wxALL, 5); sWiimoteSettings->Add(WiimoteMotor, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5); sbWiimoteSettings->Add(sWiimoteSettings); @@ -714,9 +714,11 @@ void CConfigMain::CreateGUIControls() sWiiIPLSettings = new wxGridBagSizer(); sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5); sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5); - sWiiIPLSettings->Add(WiiAspectRatioText, wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sWiiIPLSettings->Add(TEXT_BOX(WiiPage, _("Aspect Ratio:")), + wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(2, 1), wxDefaultSpan, wxALL, 5); - sWiiIPLSettings->Add(WiiSystemLangText, wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sWiiIPLSettings->Add(TEXT_BOX(WiiPage, _("System Language:")), + wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sWiiIPLSettings->Add(WiiSystemLang, wxGBPosition(3, 1), wxDefaultSpan, wxALL, 5); sbWiiIPLSettings->Add(sWiiIPLSettings); @@ -740,13 +742,10 @@ void CConfigMain::CreateGUIControls() RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0); RemoveISOPath->Enable(false); - wxStaticText* DefaultISOText = new wxStaticText(PathsPage, ID_DEFAULTISO_TEXT, _("Default ISO:"), wxDefaultPosition, wxDefaultSize); DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, _("Choose a default ISO:"), _("All GC/Wii images (gcm, iso, ciso, gcz)") + wxString::Format(wxT("|*.gcm;*.iso;*.ciso;*.gcz|%s"), wxGetTranslation(wxALL_FILES)), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN); - wxStaticText* DVDRootText = new wxStaticText(PathsPage, ID_DVDROOT_TEXT, _("DVD Root:"), wxDefaultPosition, wxDefaultSize); DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, _("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL); - wxStaticText* ApploaderPathText = new wxStaticText(PathsPage, ID_APPLOADERPATH_TEXT, _("Apploader:"), wxDefaultPosition, wxDefaultSize); ApploaderPath = new wxFilePickerCtrl(PathsPage, ID_APPLOADERPATH, wxEmptyString, _("Choose file to use as apploader: (applies to discs constructed from directories only)"), _("apploader (.img)") + wxString::Format(wxT("|*.img|%s"), wxGetTranslation(wxALL_FILES)), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN); @@ -761,11 +760,14 @@ void CConfigMain::CreateGUIControls() sbISOPaths->Add(sISOButtons, 0, wxEXPAND|wxALL, 5); sOtherPaths = new wxGridBagSizer(); - sOtherPaths->Add(DefaultISOText, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sOtherPaths->Add(TEXT_BOX(PathsPage, _("Default ISO:")), + wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sOtherPaths->Add(DefaultISO, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND|wxALL, 5); - sOtherPaths->Add(DVDRootText, wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sOtherPaths->Add(TEXT_BOX(PathsPage, _("DVD Root:")), + wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sOtherPaths->Add(DVDRoot, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND|wxALL, 5); - sOtherPaths->Add(ApploaderPathText, wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); + sOtherPaths->Add(TEXT_BOX(PathsPage, _("Apploader:")), + wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5); sOtherPaths->Add(ApploaderPath, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND|wxALL, 5); sOtherPaths->AddGrowableCol(1); @@ -895,6 +897,9 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event) case ID_DISPLAY_WINDOWHEIGHT: SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight = WindowHeight->GetValue(); break; + case ID_DISPLAY_AUTOSIZE: + SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize = WindowAutoSize->IsChecked(); + break; case ID_DISPLAY_FULLSCREEN: SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen = Fullscreen->IsChecked(); break; diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index 20f0bd2197..4fc094fabf 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -79,6 +79,7 @@ private: // Display wxChoice* FullscreenResolution; wxSpinCtrl* WindowWidth, *WindowHeight; + wxCheckBox* WindowAutoSize; wxCheckBox* Fullscreen; wxCheckBox* HideCursor; wxCheckBox* RenderToMain; @@ -181,7 +182,7 @@ private: ID_CPUTHREAD, ID_IDLESKIP, ID_ENABLECHEATS, - ID_FRAMELIMIT_TEXT, ID_FRAMELIMIT, + ID_FRAMELIMIT, ID_FRAMELIMIT_USEFPSFORLIMITING, ID_ALWAYS_HLE_BS2, @@ -194,6 +195,7 @@ private: ID_DISPLAY_FULLSCREENRES, ID_DISPLAY_WINDOWWIDTH, ID_DISPLAY_WINDOWHEIGHT, + ID_DISPLAY_AUTOSIZE, ID_DISPLAY_FULLSCREEN, ID_DISPLAY_HIDECURSOR, ID_DISPLAY_RENDERTOMAIN, @@ -204,39 +206,30 @@ private: ID_INTERFACE_CONFIRMSTOP, ID_INTERFACE_USEPANICHANDLERS, ID_INTERFACE_THEME, - ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG, + ID_INTERFACE_LANG, ID_HOTKEY_CONFIG, - ID_GC_SRAM_LNG_TEXT, ID_GC_SRAM_LNG, - ID_GC_EXIDEVICE_SLOTA_TEXT, ID_GC_EXIDEVICE_SLOTA, ID_GC_EXIDEVICE_SLOTA_PATH, - ID_GC_EXIDEVICE_SLOTB_TEXT, ID_GC_EXIDEVICE_SLOTB, ID_GC_EXIDEVICE_SLOTB_PATH, - ID_GC_EXIDEVICE_SP1_TEXT, ID_GC_EXIDEVICE_SP1, - ID_GC_SIDEVICE_TEXT, ID_GC_SIDEVICE0, ID_GC_SIDEVICE1, ID_GC_SIDEVICE2, ID_GC_SIDEVICE3, - ID_WII_BT_BAR_TEXT, ID_WII_BT_BAR, - ID_WII_BT_SENS_TEXT, ID_WII_BT_SENS, ID_WII_BT_MOT, ID_WII_IPL_SSV, ID_WII_IPL_E60, - ID_WII_IPL_AR_TEXT, ID_WII_IPL_AR, - ID_WII_IPL_LNG_TEXT, ID_WII_IPL_LNG, ID_WII_SD_CARD, @@ -248,20 +241,15 @@ private: ID_ADDISOPATH, ID_REMOVEISOPATH, - ID_DEFAULTISO_TEXT, ID_DEFAULTISO, - ID_DVDROOT_TEXT, ID_DVDROOT, - ID_APPLOADERPATH_TEXT, ID_APPLOADERPATH, - ID_GRAPHIC_TEXT, ID_GRAPHIC_CB, ID_GRAPHIC_CONFIG, ID_GRAPHIC_ABOUT, - ID_DSP_TEXT, ID_DSP_CB, ID_DSP_CONFIG, ID_DSP_ABOUT, diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 81d650e938..d080121284 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -597,7 +597,10 @@ void CFrame::OnResize(wxSizeEvent& event) event.Skip(); if (!IsMaximized() && - !(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen())) + !(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()) && + !(Core::GetState() != Core::CORE_UNINITIALIZED && + SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && + SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize)) { SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth(); SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight(); @@ -671,29 +674,25 @@ void CFrame::OnHostMessage(wxCommandEvent& event) void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height) { wxMutexGuiEnter(); - m_RenderParent->GetSize(&width, &height); + m_RenderParent->GetClientSize(&width, &height); m_RenderParent->GetPosition(&x, &y); wxMutexGuiLeave(); } -void CFrame::OnRenderWindowSizeRequest(int& width, int& height) +void CFrame::OnRenderWindowSizeRequest(int width, int height) { - wxMutexGuiEnter(); + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize || + IsFullScreen() || m_RenderFrame->IsMaximized()) + return; - if (IsFullScreen()) + int old_width, old_height; + m_RenderFrame->GetClientSize(&old_width, &old_height); + if (old_width != width || old_height != height) { - m_RenderParent->GetSize(&width, &height); + wxMutexGuiEnter(); + m_RenderFrame->SetClientSize(width, height); + wxMutexGuiLeave(); } - else if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) - { - m_RenderParent->SetClientSize(width, height); - } - else - { - m_RenderParent->GetParent()->SetClientSize(width, height); - } - - wxMutexGuiLeave(); } bool CFrame::RendererHasFocus() diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 6b318fd1a7..8ac92a6e0f 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -124,7 +124,7 @@ class CFrame : public CRenderFrame void StatusBarMessage(const char * Text, ...); void ClearStatusBar(); void GetRenderWindowSize(int& x, int& y, int& width, int& height); - void OnRenderWindowSizeRequest(int& width, int& height); + void OnRenderWindowSizeRequest(int width, int height); void BootGame(const std::string& filename); void OnRenderParentClose(wxCloseEvent& event); void OnRenderParentMove(wxMoveEvent& event); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index c5dd6cb38f..acfd250b08 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -723,7 +723,7 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event) } #if defined(HAVE_X11) && HAVE_X11 int x, y; - m_RenderParent->GetSize(&width, &height); + m_RenderParent->GetClientSize(&width, &height); m_RenderParent->GetPosition(&x, &y); X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()), "RESIZE", x, y, width, height); @@ -988,6 +988,12 @@ void CFrame::DoStop() if (m_bBatchMode) Close(true); + // If using auto size with render to main, reset the application size. + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && + SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize) + SetSize(SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth, + SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight); + m_GameListCtrl->Enable(); m_GameListCtrl->Show(); } diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 19eab1b3b4..1348cab1c0 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -579,7 +579,7 @@ void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height) main_frame->GetRenderWindowSize(x, y, width, height); } -void Host_RequestRenderWindowSize(int& width, int& height) +void Host_RequestRenderWindowSize(int width, int height) { main_frame->OnRenderWindowSizeRequest(width, height); } @@ -600,8 +600,6 @@ void Host_UpdateStatusBar(const char* _pText, int Field) // Update statusbar field event.SetInt(Field); // Post message - // TODO : this has been said to cause hang (??) how is that even possible ? :d - event.StopPropagation(); main_frame->GetEventHandler()->AddPendingEvent(event); } diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index f08cbe8a7f..ddca461be9 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -61,7 +61,6 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Settings", "UseXFB", &bUseXFB, 0); iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0); iniFile.Get("Settings", "UseNativeMips", &bUseNativeMips, true); - iniFile.Get("Settings", "AdjustWindowSize", &bAdjustWindowSize, false); iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings //Safe texture cache params @@ -180,7 +179,6 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Settings", "UseXFB", bUseXFB); iniFile.Set("Settings", "UseRealXFB", bUseRealXFB); iniFile.Set("Settings", "UseNativeMips", bUseNativeMips); - iniFile.Set("Settings", "AdjustWindowSize", bAdjustWindowSize); iniFile.Set("Settings", "SafeTextureCache", bSafeTextureCache); //safe texture cache params diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 0667dc0350..0dd69ee3c6 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -77,7 +77,6 @@ struct VideoConfig bool bUseXFB; bool bUseRealXFB; bool bUseNativeMips; - bool bAdjustWindowSize; // OpenCL bool bEnableOpenCL; diff --git a/Source/Core/VideoUICommon/Src/VideoConfigDiag.cpp b/Source/Core/VideoUICommon/Src/VideoConfigDiag.cpp index eb16b1d901..7cc1481483 100644 --- a/Source/Core/VideoUICommon/Src/VideoConfigDiag.cpp +++ b/Source/Core/VideoUICommon/Src/VideoConfigDiag.cpp @@ -103,7 +103,6 @@ wxString crop_tooltip = wxT(""); wxString opencl_tooltip = wxT(""); wxString dlc_tooltip = wxT(""); wxString hotkeys_tooltip = wxT(""); -wxString adjust_window_size_tooltip = wxTRANSLATE("Adjusts the window to match the game's output resolution scaled by the EFB scale.\nIt is best to set the aspect ratio to stretch when using this."); wxString ppshader_tooltip = wxT(""); wxString cache_efb_copies_tooltip = wxTRANSLATE("When using EFB to RAM we very often need to decode RAM data to a VRAM texture, which is a very time-consuming task.\nWith this option enabled, we'll skip decoding a texture if it didn't change.\nThis results in a nice speedup, but possibly causes glitches.\nIf you have any problems with this option enabled you should either try increasing the safety of the texture cache or disable this option.\n(NOTE: The safier the texture cache is adjusted the lower the speedup will be; accurate texture cache set to \"safe\" might actually be slower!)"); @@ -429,8 +428,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con szr_misc->Add(new SettingCheckBox(page_advanced, _("Enable OpenCL"), opencl_tooltip, vconfig.bEnableOpenCL)); szr_misc->Add(new SettingCheckBox(page_advanced, _("Enable Display List Caching"), dlc_tooltip, vconfig.bDlistCachingEnable)); szr_misc->Add(new SettingCheckBox(page_advanced, _("Enable Hotkeys"), hotkeys_tooltip, vconfig.bOSDHotKey)); - szr_misc->Add(new SettingCheckBox(page_advanced, _("Adjust window size"), wxGetTranslation(adjust_window_size_tooltip), vconfig.bAdjustWindowSize)); - szr_misc->AddSpacer(0); // postproc shader if (vconfig.backend_info.PPShaders.size()) diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/DSPConfigDlgLLE.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/DSPConfigDlgLLE.cpp index 1cba538084..1ce045a471 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/DSPConfigDlgLLE.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/DSPConfigDlgLLE.cpp @@ -48,7 +48,7 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx m_volumeSlider = new wxSlider(this, ID_VOLUME, ac_Config.m_Volume, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE); m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend)); - m_volumeText = new wxStaticText(this, wxID_ANY, wxString::Format(_("%d %%"), ac_Config.m_Volume), wxDefaultPosition, wxDefaultSize, 0); + m_volumeText = new wxStaticText(this, wxID_ANY, wxString::Format(wxT("%d %%"), ac_Config.m_Volume), wxDefaultPosition, wxDefaultSize, 0); // Update values m_buttonEnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false); diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index fb26f3b759..f504e2d94b 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -1061,8 +1061,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // Enable any configuration changes UpdateActiveConfig(); - if (g_ActiveConfig.bAdjustWindowSize) - SetWindowSize(fbWidth, fbHeight); + SetWindowSize(fbWidth, fbHeight); const bool windowResized = CheckForResize(); @@ -1358,4 +1357,4 @@ void Renderer::SetInterlacingMode() // TODO } -} \ No newline at end of file +} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 52b9573e32..2d2415a1b6 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -1175,8 +1175,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // Enable any configuration changes UpdateActiveConfig(); - if (g_ActiveConfig.bAdjustWindowSize) - SetWindowSize(fbWidth, fbHeight); + SetWindowSize(fbWidth, fbHeight); const bool windowResized = CheckForResize(); @@ -1398,4 +1397,4 @@ void Renderer::SetInterlacingMode() // TODO } -} \ No newline at end of file +} diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index b52db29b20..8822883ba0 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -295,10 +295,9 @@ THREAD_RETURN XEventThread(void *pArg) case ClientMessage: if ((unsigned long) event.xclient.data.l[0] == XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", False)) g_VideoInitialize.pCoreMessage(WM_USER_STOP); - if ((unsigned long) event.xclient.data.l[0] == XInternAtom(GLWin.evdpy, "RESIZE", False) && - !g_ActiveConfig.bAdjustWindowSize) + if ((unsigned long) event.xclient.data.l[0] == XInternAtom(GLWin.evdpy, "RESIZE", False)) XMoveResizeWindow(GLWin.evdpy, GLWin.win, event.xclient.data.l[1], - event.xclient.data.l[2], event.xclient.data.l[3], event.xclient.data.l[4]); + event.xclient.data.l[2], event.xclient.data.l[3], event.xclient.data.l[4]); break; default: break; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index ff2a718c26..a56bdbbf9b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -1236,8 +1236,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // Finish up the current frame, print some stats - if (g_ActiveConfig.bAdjustWindowSize) - SetWindowSize(fbWidth, fbHeight); + SetWindowSize(fbWidth, fbHeight); OpenGL_Update(); // just updates the render window position and the backbuffer size @@ -1607,10 +1606,6 @@ void Renderer::SetWindowSize(int width, int height) // Scale the window size by the EFB scale. CalculateTargetScale(width, height, width, height); -#if defined HAVE_X11 && HAVE_X11 - if (s_backbuffer_width != width || s_backbuffer_height != height) - XMoveResizeWindow(GLWin.evdpy, GLWin.win, GLWin.x, GLWin.y, width, height); -#endif g_VideoInitialize.pRequestWindowSize(width, height); }