Last major UI change before release.

- Moved display related options in the "Display" tab from the general config to the gfx config, renamed the tab to "Interface"
- Moved Wiimote related options in the "Wii" tab from the general config to the wiimote config
- Moved various other options to more appropriate places ("Set Console as NTSC-J", "Skip GC BIOS"
- Dropped "Window Size" adjustment
- Now displaying a warning if one tries to enable software rendering
- Other minor changes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7577 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2011-06-02 19:32:34 +00:00
parent 77a747fedb
commit 837375a13d
8 changed files with 515 additions and 405 deletions

View File

@ -112,24 +112,14 @@ EVT_CHECKBOX(ID_ENABLECHEATS, CConfigMain::CoreSettingsChanged)
EVT_CHOICE(ID_FRAMELIMIT, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_FRAMELIMIT_USEFPSFORLIMITING, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_ALWAYS_HLE_BS2, CConfigMain::CoreSettingsChanged)
EVT_RADIOBOX(ID_CPUENGINE, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_NTSCJ, 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)
EVT_CHECKBOX(ID_DISPLAY_PROGSCAN, CConfigMain::DisplaySettingsChanged)
EVT_CHECKBOX(ID_DISPLAY_NTSCJ, CConfigMain::DisplaySettingsChanged)
EVT_RADIOBOX(ID_DSPENGINE, CConfigMain::AudioSettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, CConfigMain::AudioSettingsChanged)
EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::AudioSettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, CConfigMain::AudioSettingsChanged)
EVT_CHECKBOX(ID_DUMP_AUDIO, CConfigMain::AudioSettingsChanged)
EVT_CHOICE(ID_FREQUENCY, CConfigMain::AudioSettingsChanged)
@ -144,6 +134,7 @@ EVT_BUTTON(ID_HOTKEY_CONFIG, CConfigMain::DisplaySettingsChanged)
EVT_CHOICE(ID_GC_SRAM_LNG, CConfigMain::GCSettingsChanged)
EVT_CHECKBOX(ID_GC_ALWAYS_HLE_BS2, CConfigMain::GCSettingsChanged)
EVT_CHOICE(ID_GC_EXIDEVICE_SLOTA, CConfigMain::GCSettingsChanged)
EVT_BUTTON(ID_GC_EXIDEVICE_SLOTA_PATH, CConfigMain::GCSettingsChanged)
@ -156,11 +147,6 @@ EVT_CHOICE(ID_GC_SIDEVICE2, CConfigMain::GCSettingsChanged)
EVT_CHOICE(ID_GC_SIDEVICE3, CConfigMain::GCSettingsChanged)
EVT_CHOICE(ID_WII_BT_BAR, CConfigMain::WiiSettingsChanged)
EVT_SLIDER(ID_WII_BT_SENS, CConfigMain::WiiSettingsChanged)
EVT_SLIDER(ID_WII_BT_SPKV, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_BT_MOT, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_IPL_SSV, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_IPL_E60, CConfigMain::WiiSettingsChanged)
EVT_CHOICE(ID_WII_IPL_AR, CConfigMain::WiiSettingsChanged)
@ -168,7 +154,6 @@ EVT_CHOICE(ID_WII_IPL_LNG, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_SD_CARD, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_KEYBOARD, CConfigMain::WiiSettingsChanged)
EVT_CHECKBOX(ID_WII_WIIMOTE_RECONNECT, CConfigMain::WiiSettingsChanged)
EVT_LISTBOX(ID_ISOPATHS, CConfigMain::ISOPathsSelectionChanged)
@ -182,9 +167,6 @@ EVT_FILEPICKER_CHANGED(ID_APPLOADERPATH, CConfigMain::ApploaderPathChanged)
EVT_DIRPICKER_CHANGED(ID_NANDROOT, CConfigMain::NANDRootChanged)
EVT_CHOICE(ID_GRAPHIC_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_GRAPHIC_CONFIG, CConfigMain::OnConfig)
END_EVENT_TABLE()
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
@ -194,7 +176,6 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
// Control refreshing of the ISOs list
bRefreshList = false;
AddResolutions();
CreateGUIControls();
// Update selected ISO paths
@ -230,31 +211,19 @@ void CConfigMain::UpdateGUI()
SkipIdle->Disable();
EnableCheats->Disable();
AlwaysHLE_BS2->Disable();
CPUEngine->Disable();
LockThreads->Disable();
DSPThread->Disable();
// Disable stuff on DisplayPage
FullscreenResolution->Disable();
RenderToMain->Disable();
ProgressiveScan->Disable();
NTSCJ->Disable();
// Disable graphics backend selection
GraphicSelection->Disable();
_NTSCJ->Disable();
// Disable stuff on AudioPage
DSPEngine->Disable();
DSPThread->Disable();
// Disable stuff on GamecubePage
GCSystemLang->Disable();
GCAlwaysHLE_BS2->Disable();
// Disable stuff on WiiPage
WiiSensBarPos->Disable();
WiiSensBarSens->Disable();
WiimoteSpkVolume->Disable();
WiimoteMotor->Disable();
WiiScreenSaver->Disable();
WiiEuRGB60->Disable();
WiiAspectRatio->Disable();
@ -286,10 +255,6 @@ void CConfigMain::InitializeGUILists()
// Display page
// Resolutions
if (arrayStringFor_FullscreenResolution.empty())
arrayStringFor_FullscreenResolution.Add(_("<No resolutions found>"));
// Themes
arrayStringFor_Themes.Add(wxT("Boomy"));
arrayStringFor_Themes.Add(wxT("Vista"));
@ -366,24 +331,9 @@ void CConfigMain::InitializeGUIValues()
UseFPSForLimiting->SetValue(SConfig::GetInstance().b_UseFPS);
// General - Advanced
AlwaysHLE_BS2->SetValue(startup_params.bHLE_BS2);
CPUEngine->SetSelection(startup_params.iCPUCore);
LockThreads->SetValue(startup_params.bLockThreads);
DSPThread->SetValue(startup_params.bDSPThread);
// Display - Display
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);
ProgressiveScan->SetValue(startup_params.bProgressive);
// A bit strange behavior, but this needs to stay in sync with the main progressive boolean
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", startup_params.bProgressive);
NTSCJ->SetValue(startup_params.bNTSCJ);
_NTSCJ->SetValue(startup_params.bNTSCJ);
// Display - Interface
@ -411,6 +361,7 @@ void CConfigMain::InitializeGUIValues()
VolumeSlider->SetValue(ac_Config.m_Volume);
VolumeText->SetLabel(wxString::Format(wxT("%d %%"), ac_Config.m_Volume));
EnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false);
DSPThread->SetValue(startup_params.bDSPThread);
EnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false);
DumpAudio->SetValue(ac_Config.m_DumpAudio ? true : false);
FrequencySelection->SetSelection(
@ -421,6 +372,7 @@ void CConfigMain::InitializeGUIValues()
// Gamecube - IPL
GCSystemLang->SetSelection(startup_params.SelectedLanguage);
GCAlwaysHLE_BS2->SetValue(startup_params.bHLE_BS2);
// Gamecube - Devices
wxArrayString SlotDevices;
@ -508,13 +460,6 @@ void CConfigMain::InitializeGUIValues()
SIDevices.RemoveAt(SIDevices.GetCount() - 1);
}
// Wii - Wiimote
WiiSensBarPos->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR"));
WiiSensBarSens->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u32>("BT.SENS"));
WiimoteSpkVolume->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.SPKV"));
WiimoteMotor->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<bool>("BT.MOT"));
WiimoteReconnectOnLoad->SetValue(SConfig::GetInstance().m_WiimoteReconnectOnLoad);
// Wii - Misc
WiiScreenSaver->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.SSV"));
WiiEuRGB60->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.E60"));
@ -532,14 +477,6 @@ void CConfigMain::InitializeGUIValues()
DVDRoot->SetPath(wxString(startup_params.m_strDVDRoot.c_str(), *wxConvCurrent));
ApploaderPath->SetPath(wxString(startup_params.m_strApploader.c_str(), *wxConvCurrent));
NANDRoot->SetPath(wxString(SConfig::GetInstance().m_NANDPath.c_str(), *wxConvCurrent));
// video backend list
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
{
GraphicSelection->AppendString(wxGetTranslation(wxString::FromUTF8((*it)->GetName().c_str())));
if (*it == g_video_backend)
GraphicSelection->Select(it - g_available_video_backends.begin());
}
}
void CConfigMain::InitializeGUITooltips()
@ -549,18 +486,7 @@ void CConfigMain::InitializeGUITooltips()
Framelimit->SetToolTip(_("If you set Framelimit higher than game full speed (NTSC:60, PAL:50), you also have to disable Audio Throttle in DSP to make it effective."));
// General - Advanced
DSPThread->SetToolTip(_("Run DSP LLE on a dedicated thread (not recommended)."));
// Display - Display
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 and the rendering window has focus."));
RenderToMain->SetToolTip(_("Render to main window."));
ProgressiveScan->SetToolTip(_("Will enable progressive scan option if supported by software."));
NTSCJ->SetToolTip(_("Required for using the Japanese ROM font."));
_NTSCJ->SetToolTip(_("Required for using the Japanese ROM font."));
// Display - Interface
ConfirmStop->SetToolTip(_("Show a confirmation box before stopping a game."));
@ -576,6 +502,7 @@ void CConfigMain::InitializeGUITooltips()
// Audio tooltips
EnableDTKMusic->SetToolTip(_("This is used to play music tracks, like BGM."));
DSPThread->SetToolTip(_("Run DSP LLE on a dedicated thread (not recommended)."));
EnableThrottle->SetToolTip(_("This is used to control game speed by sound throttle.\nDisabling this could cause abnormal game speed, such as too fast.\nBut sometimes enabling this could cause constant noise.\n\nKeyboard Shortcut <TAB>: Hold down to instantly disable Throttle."));
FrequencySelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
BackendSelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
@ -601,7 +528,7 @@ void CConfigMain::CreateGUIControls()
PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(GeneralPage, _("General"));
Notebook->AddPage(DisplayPage, _("Display"));
Notebook->AddPage(DisplayPage, _("Interface"));
Notebook->AddPage(AudioPage, _("Audio"));
Notebook->AddPage(GamecubePage, _("Gamecube"));
Notebook->AddPage(WiiPage, _("Wii"));
@ -614,51 +541,34 @@ void CConfigMain::CreateGUIControls()
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, _("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Framelimit
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);
UseFPSForLimiting = new wxCheckBox(GeneralPage, ID_FRAMELIMIT_USEFPSFORLIMITING, _("Limit by FPS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Core Settings - Advanced
AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, _("Skip GC BIOS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, _("CPU Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS);
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, _("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPThread = new wxCheckBox(GeneralPage, ID_DSPTHREAD, _("DSP LLE on thread"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, _("Lock Threads to Cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
_NTSCJ = new wxCheckBox(GeneralPage, ID_NTSCJ, _("Set Console as NTSC-J"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the General settings
wxBoxSizer* sFramelimit = new wxBoxSizer(wxHORIZONTAL);
sFramelimit->Add(TEXT_BOX(GeneralPage, _("Framelimit:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sFramelimit->Add(Framelimit, 0, wxALL | wxEXPAND, 5);
sFramelimit->Add(TEXT_BOX(GeneralPage, _("Framelimit:")), 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5);
sFramelimit->Add(Framelimit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 5);
sFramelimit->Add(UseFPSForLimiting, 0, wxALL | wxEXPAND, 5);
wxStaticBoxSizer* const sbBasic = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Basic Settings"));
sbBasic->Add(CPUThread, 0, wxALL, 5);
sbBasic->Add(SkipIdle, 0, wxALL, 5);
sbBasic->Add(EnableCheats, 0, wxALL, 5);
sbBasic->Add(sFramelimit, 0, wxALL | wxEXPAND, 5);
sbBasic->Add(sFramelimit);
wxStaticBoxSizer* const sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Advanced Settings"));
sbAdvanced->Add(AlwaysHLE_BS2, 0, wxALL, 5);
sbAdvanced->Add(CPUEngine, 0, wxALL, 5);
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
sbAdvanced->Add(DSPThread, 0, wxALL, 5);
sbAdvanced->Add(_NTSCJ, 0, wxALL, 5);
wxBoxSizer* const sGeneralPage = new wxBoxSizer(wxVERTICAL);
sGeneralPage->Add(sbBasic, 0, wxEXPAND | wxALL, 5);
sGeneralPage->Add(sbAdvanced, 0, wxEXPAND | wxALL, 5);
GeneralPage->SetSizer(sGeneralPage);
// General display settings
FullscreenResolution = new wxChoice(DisplayPage, ID_DISPLAY_FULLSCREENRES, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenResolution, 0, wxDefaultValidator, arrayStringFor_FullscreenResolution[0]);
WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString, wxDefaultPosition, wxSize(70, -1));
WindowWidth->SetRange(0,3280);
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);
ProgressiveScan = new wxCheckBox(DisplayPage, ID_DISPLAY_PROGSCAN, _("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
NTSCJ = new wxCheckBox(DisplayPage, ID_DISPLAY_NTSCJ, _("Set Console as NTSC-J"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Interface Language
// TODO : Do these really belong to the display page?
InterfaceLang = new wxChoice(DisplayPage, ID_INTERFACE_LANG, wxDefaultPosition,
wxDefaultSize, arrayStringFor_InterfaceLang, 0, wxDefaultValidator);
// Hotkey configuration
@ -668,44 +578,11 @@ void CConfigMain::CreateGUIControls()
Theme = new wxRadioBox(DisplayPage, ID_INTERFACE_THEME, _("Theme"),
wxDefaultPosition, wxDefaultSize, arrayStringFor_Themes, 1, wxRA_SPECIFY_ROWS);
// Interface settings
ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm On Stop"),
ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm on Stop"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS,
_("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the Display page
wxBoxSizer* sDisplayRes = new wxBoxSizer(wxHORIZONTAL);
sDisplayRes->Add(TEXT_BOX(DisplayPage, _("Fullscreen Display Resolution:")),
0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplayRes->Add(FullscreenResolution, 0, wxEXPAND, 5);
// backend
wxBoxSizer* svidbackend = new wxBoxSizer(wxHORIZONTAL);
svidbackend->Add(TEXT_BOX(DisplayPage, _("Video Backend:")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
GraphicSelection = new wxChoice(DisplayPage, ID_GRAPHIC_CB,
wxDefaultPosition, wxDefaultSize, 0, NULL, 0, wxDefaultValidator);
svidbackend->Add(GraphicSelection, 0, wxLEFT|wxBOTTOM|wxTOP, 5);
GraphicConfig = new wxButton(DisplayPage, ID_GRAPHIC_CONFIG, _("GFX Config"),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
svidbackend->Add(GraphicConfig, 0, wxALIGN_CENTER_VERTICAL, 5);
wxBoxSizer* sDisplaySize = new wxBoxSizer(wxHORIZONTAL);
sDisplaySize->Add(TEXT_BOX(DisplayPage, _("Window Size:")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplaySize->Add(WindowWidth, 0, wxEXPAND | wxRIGHT, 5);
sDisplaySize->Add(TEXT_BOX(DisplayPage, wxT("x")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplaySize->Add(WindowHeight, 0, wxEXPAND | wxRIGHT, 5);
sDisplaySize->Add(WindowAutoSize, 0, wxALIGN_CENTER_VERTICAL, 5);
sbDisplay = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Emulator Display Settings"));
sbDisplay->Add(svidbackend, 0, wxEXPAND | wxLEFT, 5);
sbDisplay->Add(sDisplayRes, 0, wxALL, 5);
sbDisplay->Add(sDisplaySize, 0, wxALL, 5);
sbDisplay->Add(Fullscreen, 0, wxEXPAND | wxALL, 5);
sbDisplay->Add(HideCursor, 0, wxALL, 5);
sbDisplay->Add(RenderToMain, 0, wxEXPAND | wxALL, 5);
sbDisplay->Add(ProgressiveScan, 0, wxEXPAND | wxALL, 5);
sbDisplay->Add(NTSCJ, 0, wxEXPAND | wxALL, 5);
wxBoxSizer* sInterface = new wxBoxSizer(wxHORIZONTAL);
sInterface->Add(TEXT_BOX(DisplayPage, _("Language:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sInterface->Add(InterfaceLang, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
@ -718,7 +595,6 @@ void CConfigMain::CreateGUIControls()
sbInterface->Add(sInterface, 0, wxEXPAND | wxALL, 5);
sDisplayPage = new wxBoxSizer(wxVERTICAL);
sDisplayPage->Add(sbDisplay, 0, wxEXPAND | wxALL, 5);
sDisplayPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5);
DisplayPage->SetSizer(sDisplayPage);
@ -728,6 +604,7 @@ void CConfigMain::CreateGUIControls()
wxDefaultPosition, wxDefaultSize, arrayStringFor_DSPEngine, 0, wxRA_SPECIFY_ROWS);
EnableDTKMusic = new wxCheckBox(AudioPage, ID_ENABLE_DTK_MUSIC, _("Enable DTK Music"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPThread = new wxCheckBox(AudioPage, ID_DSPTHREAD, _("DSP LLE on Thread"));
EnableThrottle = new wxCheckBox(AudioPage, ID_ENABLE_THROTTLE, _("Enable Audio Throttle"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DumpAudio = new wxCheckBox(AudioPage, ID_DUMP_AUDIO, _("Dump Audio"),
@ -746,6 +623,7 @@ void CConfigMain::CreateGUIControls()
wxStaticBoxSizer *sbAudioSettings = new wxStaticBoxSizer(wxVERTICAL, AudioPage, _("Sound Settings"));
sbAudioSettings->Add(DSPEngine, 0, wxALL | wxEXPAND, 5);
sbAudioSettings->Add(EnableDTKMusic, 0, wxALL, 5);
sbAudioSettings->Add(DSPThread, 0, wxALL, 5);
sbAudioSettings->Add(EnableThrottle, 0, wxALL, 5);
sbAudioSettings->Add(DumpAudio, 0, wxALL, 5);
@ -775,12 +653,13 @@ void CConfigMain::CreateGUIControls()
// IPL settings
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition,
wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
GCAlwaysHLE_BS2 = new wxCheckBox(GamecubePage, ID_GC_ALWAYS_HLE_BS2, _("Skip BIOS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Device settings
// EXI Devices
wxStaticText* GCEXIDeviceText[3];
GCEXIDeviceText[0] = TEXT_BOX(GamecubePage, _("Slot A"));
GCEXIDeviceText[1] = TEXT_BOX(GamecubePage, _("Slot B"));
GCEXIDeviceText[2] = TEXT_BOX(GamecubePage, wxT("SP1 "));
GCEXIDeviceText[2] = TEXT_BOX(GamecubePage, wxT("SP1"));
GCEXIDevice[0] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTA);
GCEXIDevice[1] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTB);
GCEXIDevice[2] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SP1);
@ -802,29 +681,31 @@ void CConfigMain::CreateGUIControls()
// Populate the Gamecube page
sGamecubeIPLSettings = new wxGridBagSizer();
sGamecubeIPLSettings->Add(GCAlwaysHLE_BS2, wxGBPosition(0, 0), wxGBSpan(1, 2), 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);
wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(1, 1), wxDefaultSpan, wxLEFT|wxRIGHT|wxBOTTOM, 5);
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("IPL Settings"));
sbGamecubeIPLSettings->Add(sGamecubeIPLSettings);
wxBoxSizer *sEXIDevices[4], *sSIDevices[4];
wxStaticBoxSizer *sbGamecubeDeviceSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("Device Settings"));
wxGridBagSizer* sbGamecubeEXIDevSettings = new wxGridBagSizer(10, 10);
for (int i = 0; i < 3; ++i)
{
sEXIDevices[i] = new wxBoxSizer(wxHORIZONTAL);
sEXIDevices[i]->Add(GCEXIDeviceText[i], 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sEXIDevices[i]->Add(GCEXIDevice[i], 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
if (i < 2)
sEXIDevices[i]->Add(GCMemcardPath[i], 0, wxALL, 5);
sbGamecubeDeviceSettings->Add(sEXIDevices[i]);
sbGamecubeEXIDevSettings->Add(GCEXIDeviceText[i], wxGBPosition(i, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sbGamecubeEXIDevSettings->Add(GCEXIDevice[i], wxGBPosition(i, 1), wxGBSpan(1, (i < 2)?1:2), wxALIGN_CENTER_VERTICAL);
if (i < 2) sbGamecubeEXIDevSettings->Add(GCMemcardPath[i], wxGBPosition(i, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
}
sbGamecubeDeviceSettings->Add(sbGamecubeEXIDevSettings, 0, wxALL, 5);
wxFlexGridSizer* sbGamecubeDevSettings = new wxFlexGridSizer(2, 10, 10);
for (int i = 0; i < 4; ++i)
{
sSIDevices[i] = new wxBoxSizer(wxHORIZONTAL);
sSIDevices[i]->Add(GCSIDeviceText[i], 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sSIDevices[i]->Add(GCSIDevice[i], 0, wxALL, 5);
sbGamecubeDeviceSettings->Add(sSIDevices[i]);
sbGamecubeDevSettings->Add(GCSIDeviceText[i], 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 0);
sbGamecubeDevSettings->Add(GCSIDevice[i], 1, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 0);
}
sbGamecubeDeviceSettings->Add(sbGamecubeDevSettings, 0, wxALL, 5);
sGamecubePage = new wxBoxSizer(wxVERTICAL);
sGamecubePage->Add(sbGamecubeIPLSettings, 0, wxEXPAND|wxALL, 5);
sGamecubePage->Add(sbGamecubeDeviceSettings, 0, wxEXPAND|wxALL, 5);
@ -832,15 +713,8 @@ void CConfigMain::CreateGUIControls()
// Wii page
// Wiimote Settings
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
WiiSensBarSens = new wxSlider(WiiPage, ID_WII_BT_SENS, 0, 0, 4);
WiimoteSpkVolume = new wxSlider(WiiPage, ID_WII_BT_SPKV, 0, 0, 127);
WiimoteMotor = new wxCheckBox(WiiPage, ID_WII_BT_MOT, _("Wiimote Motor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiimoteReconnectOnLoad = new wxCheckBox(WiiPage, ID_WII_WIIMOTE_RECONNECT, _("Reconnect Wiimote On Load State"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Misc Settings
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, _("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, _("Enable Screen Saver"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use EuRGB60 Mode (PAL60)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
@ -850,21 +724,6 @@ void CConfigMain::CreateGUIControls()
WiiKeyboard = new wxCheckBox(WiiPage, ID_WII_KEYBOARD, _("Connect USB Keyboard"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the Wii Page
sWiimoteSettings = new wxGridBagSizer();
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(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(TEXT_BOX(WiiPage, _("Speaker Volume:")),
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiimoteSettings->Add(WiimoteSpkVolume, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND|wxALL, 5);
sWiimoteSettings->Add(WiimoteMotor, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
sWiimoteSettings->Add(WiimoteReconnectOnLoad, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
sbWiimoteSettings = new wxStaticBoxSizer(wxHORIZONTAL, WiiPage, _("Wiimote Settings"));
sbWiimoteSettings->Add(sWiimoteSettings);
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);
@ -882,7 +741,6 @@ void CConfigMain::CreateGUIControls()
sbWiiDeviceSettings->Add(WiiKeyboard, 0, wxALL, 5);
sWiiPage = new wxBoxSizer(wxVERTICAL);
sWiiPage->Add(sbWiimoteSettings, 0, wxEXPAND|wxALL, 5);
sWiiPage->Add(sbWiiIPLSettings, 0, wxEXPAND|wxALL, 5);
sWiiPage->Add(sbWiiDeviceSettings, 0, wxEXPAND|wxALL, 5);
WiiPage->SetSizer(sWiiPage);
@ -987,21 +845,18 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().b_UseFPS = UseFPSForLimiting->IsChecked();
break;
// Core - Advanced
case ID_ALWAYS_HLE_BS2:
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = AlwaysHLE_BS2->IsChecked();
break;
case ID_CPUENGINE:
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection();
if (main_frame->g_pCodeWindow)
main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER,
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore?false:true);
break;
case ID_DSPTHREAD:
SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread = DSPThread->IsChecked();
break;
case ID_LOCKTHREADS:
SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads = LockThreads->IsChecked();
break;
case ID_NTSCJ:
SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSCJ = _NTSCJ->IsChecked();
break;
}
}
@ -1010,39 +865,6 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
// Display - Display
case ID_DISPLAY_FULLSCREENRES:
SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution =
FullscreenResolution->GetStringSelection().mb_str();
#if defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame->m_XRRConfig->Update();
#endif
break;
case ID_DISPLAY_WINDOWWIDTH:
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth = WindowWidth->GetValue();
break;
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;
case ID_DISPLAY_HIDECURSOR:
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
break;
case ID_DISPLAY_RENDERTOMAIN:
SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain = RenderToMain->IsChecked();
break;
case ID_DISPLAY_PROGSCAN:
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", ProgressiveScan->IsChecked());
SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive = ProgressiveScan->IsChecked();
break;
case ID_DISPLAY_NTSCJ:
SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSCJ = NTSCJ->IsChecked();
break;
// Display - Interface
case ID_INTERFACE_CONFIRMSTOP:
SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop = ConfirmStop->IsChecked();
@ -1080,13 +902,21 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
ac_Config.m_EnableJIT = DSPEngine->GetSelection() == 1;
ac_Config.Update();
break;
case ID_VOLUME:
ac_Config.m_Volume = VolumeSlider->GetValue();
ac_Config.Update();
VolumeText->SetLabel(wxString::Format(wxT("%d %%"), VolumeSlider->GetValue()));
break;
case ID_DSPTHREAD:
SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread = DSPThread->IsChecked();
break;
case ID_BACKEND:
VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
break;
default:
ac_Config.m_EnableDTKMusic = EnableDTKMusic->GetValue();
ac_Config.m_EnableThrottle = EnableThrottle->GetValue();
@ -1140,6 +970,10 @@ void CConfigMain::GCSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage = GCSystemLang->GetSelection();
bRefreshList = true;
break;
// Gamecube - IPL Settings
case ID_GC_ALWAYS_HLE_BS2:
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = GCAlwaysHLE_BS2->IsChecked();
break;
// Gamecube - Devices
case ID_GC_EXIDEVICE_SP1:
exidevice++;
@ -1267,23 +1101,7 @@ void CConfigMain::WiiSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
// Wii - Wiimote settings
case ID_WII_BT_BAR:
SConfig::GetInstance().m_SYSCONF->SetData("BT.BAR", WiiSensBarPos->GetSelection());
break;
case ID_WII_BT_SENS:
SConfig::GetInstance().m_SYSCONF->SetData("BT.SENS", WiiSensBarSens->GetValue());
break;
case ID_WII_BT_SPKV:
SConfig::GetInstance().m_SYSCONF->SetData("BT.SPKV", WiimoteSpkVolume->GetValue());
break;
case ID_WII_BT_MOT:
SConfig::GetInstance().m_SYSCONF->SetData("BT.MOT", WiimoteMotor->IsChecked());
break;
case ID_WII_WIIMOTE_RECONNECT:
SConfig::GetInstance().m_WiimoteReconnectOnLoad = WiimoteReconnectOnLoad->IsChecked();
break;
// SYSCONF settings
// Wii - SYSCONF settings
case ID_WII_IPL_SSV:
SConfig::GetInstance().m_SYSCONF->SetData("IPL.SSV", WiiScreenSaver->IsChecked());
break;
@ -1404,61 +1222,6 @@ void CConfigMain::OnConfig(wxCommandEvent&)
g_video_backend->ShowConfig(this);
}
// Search for avaliable resolutions
void CConfigMain::AddResolutions()
{
#ifdef _WIN32
DWORD iModeNum = 0;
DEVMODE dmi;
ZeroMemory(&dmi, sizeof(dmi));
dmi.dmSize = sizeof(dmi);
std::vector<std::string> resos;
while (EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0)
{
char res[100];
sprintf(res, "%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);
std::string strRes(res);
// Only add unique resolutions
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
{
resos.push_back(strRes);
arrayStringFor_FullscreenResolution.Add(wxString::FromAscii(res));
}
ZeroMemory(&dmi, sizeof(dmi));
}
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame->m_XRRConfig->AddResolutions(arrayStringFor_FullscreenResolution);
#elif defined(__APPLE__)
CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
{
std::stringstream res;
CFDictionaryRef mode;
CFNumberRef ref;
int w, h, d;
mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
CFNumberGetValue(ref, kCFNumberIntType, &w);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
CFNumberGetValue(ref, kCFNumberIntType, &h);
ref = (CFNumberRef)CFDictionaryGetValue(mode,
kCGDisplayBitsPerPixel);
CFNumberGetValue(ref, kCFNumberIntType, &d);
if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
continue;
if (d != 32)
continue;
res << w << "x" << h;
arrayStringFor_FullscreenResolution.Add(res.str());
}
#endif
}
// Change from IPL.LNG value to IPL.SADR country code
inline u8 CConfigMain::GetSADRCountryCode(int language)
{
@ -1497,4 +1260,3 @@ inline u8 CConfigMain::GetSADRCountryCode(int language)
}
return countrycode;
}

View File

@ -68,21 +68,11 @@ private:
ID_FRAMELIMIT,
ID_FRAMELIMIT_USEFPSFORLIMITING,
ID_ALWAYS_HLE_BS2,
ID_ENABLE_OPENCL,
ID_CPUENGINE,
ID_LOCKTHREADS,
ID_DSPTHREAD,
ID_DISPLAY_FULLSCREENRES,
ID_DISPLAY_WINDOWWIDTH,
ID_DISPLAY_WINDOWHEIGHT,
ID_DISPLAY_AUTOSIZE,
ID_DISPLAY_FULLSCREEN,
ID_DISPLAY_HIDECURSOR,
ID_DISPLAY_RENDERTOMAIN,
ID_DISPLAY_PROGSCAN,
ID_DISPLAY_NTSCJ,
ID_NTSCJ,
// Audio Settings
ID_DSPENGINE,
@ -102,6 +92,7 @@ private:
ID_HOTKEY_CONFIG,
ID_GC_SRAM_LNG,
ID_GC_ALWAYS_HLE_BS2,
ID_GC_EXIDEVICE_SLOTA,
ID_GC_EXIDEVICE_SLOTA_PATH,
@ -114,12 +105,6 @@ private:
ID_GC_SIDEVICE3,
ID_WII_BT_BAR,
ID_WII_BT_SENS,
ID_WII_BT_SPKV,
ID_WII_BT_MOT,
ID_WII_WIIMOTE_RECONNECT,
ID_WII_IPL_SSV,
ID_WII_IPL_E60,
ID_WII_IPL_AR,
@ -139,11 +124,6 @@ private:
ID_APPLOADERPATH,
ID_NANDROOT,
ID_GRAPHIC_CB,
ID_GRAPHIC_CONFIG,
ID_GRAPHIC_ABOUT,
ID_DSP_CB,
ID_DSP_CONFIG,
ID_DSP_ABOUT,
@ -160,25 +140,16 @@ private:
wxCheckBox* UseFPSForLimiting;
// Advanced
wxCheckBox* AlwaysHLE_BS2;
wxCheckBox* EnableOpenCL;
wxRadioBox* CPUEngine;
wxCheckBox* DSPThread;
wxCheckBox* LockThreads;
wxCheckBox* _NTSCJ;
wxBoxSizer* sDisplayPage; // Display settings
wxStaticBoxSizer* sbDisplay, *sbInterface; // Display and Interface sections
wxStaticBoxSizer* sbInterface; // Display and Interface sections
// Display
wxChoice* FullscreenResolution;
wxSpinCtrl* WindowWidth, *WindowHeight;
wxCheckBox* WindowAutoSize;
wxCheckBox* Fullscreen;
wxCheckBox* HideCursor;
wxCheckBox* RenderToMain;
wxCheckBox* ProgressiveScan;
wxCheckBox* NTSCJ;
// Audio
wxBoxSizer* sAudioPage; // GC settings
@ -206,6 +177,7 @@ private:
// IPL
wxChoice* GCSystemLang;
wxCheckBox* GCAlwaysHLE_BS2;
// Device
wxChoice* GCEXIDevice[3];
@ -214,15 +186,8 @@ private:
wxBoxSizer* sWiiPage; // Wii settings
wxStaticBoxSizer* sbWiimoteSettings, *sbWiiIPLSettings, *sbWiiDeviceSettings; // Wiimote, Misc and Device sections
wxGridBagSizer* sWiimoteSettings, *sWiiIPLSettings;
// Wiimote
wxChoice* WiiSensBarPos;
wxSlider* WiiSensBarSens;
wxSlider* WiimoteSpkVolume;
wxCheckBox* WiimoteMotor;
wxCheckBox* WiimoteReconnectOnLoad;
wxStaticBoxSizer* /*sbWiimoteSettings, **/sbWiiIPLSettings, *sbWiiDeviceSettings; // Wiimote, Misc and Device sections
wxGridBagSizer* /*sWiimoteSettings, **/sWiiIPLSettings;
// Misc
wxCheckBox* WiiScreenSaver;
@ -282,7 +247,6 @@ private:
void CoreSettingsChanged(wxCommandEvent& event);
void DisplaySettingsChanged(wxCommandEvent& event);
void AddResolutions();
void OnSpin(wxSpinEvent& event);
void AudioSettingsChanged(wxCommandEvent& event);

View File

@ -2,6 +2,7 @@
#include "FileUtil.h"
#include "TextureCacheBase.h"
#include "Core.h"
#include <wx/intl.h>
@ -62,7 +63,14 @@ void VideoConfigDiag::Event_Close(wxCloseEvent& ev)
TextureCache::InvalidateDefer(); // For settings like hi-res textures/texture format/etc.
}
wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nDirect3D 9 usually is the fastest one. OpenGL is more accurate though. Direct3D 11 is somewhere between the two.\nNote that the Direct3D backends are only available on Windows.\n\nIf unsure, use Direct3D 9.");
wxString adapter_desc = wxTRANSLATE("Select a hardware adapter to use.\n\nIf unsure, use the first one.");
wxString display_res_desc = wxTRANSLATE("Selects the display resolution used in fullscreen mode.\nThis should always be bigger than or equal to the internal resolution. Performance impact is negligible.\n\nIf unsure, use your desktop resolution.\nIf still unsure, use the highest resolution which works for you.");
wxString use_fullscreen_desc = wxTRANSLATE("Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a render window will be created instead.\n\nIf unsure, leave this unchecked.");
wxString auto_window_size_desc = wxTRANSLATE("Automatically adjusts the window size to your internal resolution.\n\nIf unsure, leave this unchecked.");
wxString hide_mouse_cursor_desc = wxTRANSLATE("Hides the mouse cursor if it's on top of the emulation window.\n\nIf unsure, leave this checked.");
wxString render_to_main_win_desc = wxTRANSLATE("Enable this if you want to use the main Dolphin window for rendering rather than a separate render window.\n\nIf unsure, leave this unchecked.");
wxString prog_scan_desc = wxTRANSLATE("Enables progressive scan if supported by the emulated software.\nMost games don't care about this.\n\nIf unsure, leave this unchecked.");
wxString ar_desc = wxTRANSLATE("Select what aspect ratio to use when rendering:\nAuto: Use the native aspect ratio\nForce 16:9: Stretch the picture to an aspect ratio of 16:9.\nForce 4:3: Stretch the picture to an aspect ratio of 4:3.\nStretch to Window: Stretch the picture to the window size.\n\nIf unsure, select Auto.");
wxString ws_hack_desc = wxTRANSLATE("Force the game to output graphics for widescreen resolutions.\nCauses graphical glitches is some games.\n\nIf unsure, leave this unchecked.");
wxString vsync_desc = wxTRANSLATE("Wait for vertical blanks in order to reduce tearing.\nDecreases performance if emulation speed is below 100%.\n\nIf unsure, leave this unchecked.");
@ -73,7 +81,7 @@ wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textur
wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked.");
wxString pixel_depth_desc = wxTRANSLATE("Calculate depth values of 3D graphics per-pixel rather than per vertex.\nIn contrast to pixel lighting (which is merely an enhancement), per-pixel depth calculations are necessary to properly emulate a small number of games.\n\nIf unsure, leave this checked.");
wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked.");
wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\n\nRequires fullscreen to work.\nIf unsure, leave this unchecked.");
wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked.");
wxString internal_res_desc = wxTRANSLATE("Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.\n\"Multiple of 640x528\" is a bit slower than \"Window Size\" but yields less issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528.");
wxString efb_access_desc = wxTRANSLATE("Ignore any requests of the CPU to read from or write to the EFB.\nImproves performance in some games, but might disable some gameplay-related features or graphical effects.\n\nIf unsure, leave this unchecked.");
wxString efb_emulate_format_changes_desc = wxTRANSLATE("Ignore any changes to the EFB format.\nImproves performance in many games without any negative effect. Causes graphical defects in a small number of other games though.\n\nIf unsure, leave this checked.");
@ -101,7 +109,7 @@ wxString dump_frames_desc = wxTRANSLATE("Dump all rendered frames to an AVI file
#if !defined WIN32 && defined HAVE_LIBAV
wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n\nIf unsure, leave this unchecked.");
#endif
wxString free_look_desc = wxTRANSLATE("This feature allows you to mess with the game's camera.\n\nHold the right mouse button and move the mouse to pan the camera around. Hold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 doubles it (x2) and SHIFT+9 halves it (x0.5)). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked.");
wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nHold the right mouse button and move the mouse to pan the camera around. Hold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked.");
wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked.");
wxString opencl_desc = wxTRANSLATE("[EXPERIMENTAL]\nAims to speed up emulation by offloading texture decoding to the GPU using the OpenCL framework.\nHowever, right now it's known to cause texture defects in various games. Also it's slower than regular CPU texture decoding in most cases.\n\nIf unsure, leave this unchecked.");
wxString dlc_desc = wxTRANSLATE("[EXPERIMENTAL]\nSpeeds up emulation a bit by caching display lists.\nPossibly causes issues though.\n\nIf unsure, leave this unchecked.");
@ -111,6 +119,64 @@ wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finis
wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked.");
wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked.");
// Search for avaliable resolutions - TODO: Move to Common?
wxArrayString GetListOfResolutions()
{
wxArrayString retlist;
#ifdef _WIN32
DWORD iModeNum = 0;
DEVMODE dmi;
ZeroMemory(&dmi, sizeof(dmi));
dmi.dmSize = sizeof(dmi);
std::vector<std::string> resos;
while (EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0)
{
char res[100];
sprintf(res, "%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);
std::string strRes(res);
// Only add unique resolutions
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
{
resos.push_back(strRes);
retlist.Add(wxString::FromAscii(res));
}
ZeroMemory(&dmi, sizeof(dmi));
}
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame->m_XRRConfig->AddResolutions(retlist);
#elif defined(__APPLE__)
CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
{
std::stringstream res;
CFDictionaryRef mode;
CFNumberRef ref;
int w, h, d;
mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
CFNumberGetValue(ref, kCFNumberIntType, &w);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
CFNumberGetValue(ref, kCFNumberIntType, &h);
ref = (CFNumberRef)CFDictionaryGetValue(mode,
kCGDisplayBitsPerPixel);
CFNumberGetValue(ref, kCFNumberIntType, &d);
if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
continue;
if (d != 32)
continue;
res << w << "x" << h;
retlist.Add(res.str());
}
#endif
return retlist;
}
VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& _ininame)
: wxDialog(parent, -1,
wxString::Format(_("Dolphin %s Graphics Configuration"),
@ -135,22 +201,35 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
{
wxFlexGridSizer* const szr_basic = new wxFlexGridSizer(2, 5, 5);
// graphics api
//{
//const wxString gfxapi_choices[] = { _("Software"),
// _("OpenGL"), _("Direct3D 9"), _("Direct3D 11") };
// backend
{
wxStaticText* const label_backend = new wxStaticText(page_general, wxID_ANY, _("Backend:"));
choice_backend = new wxChoice(page_general, wxID_ANY, wxDefaultPosition);
RegisterControl(choice_backend, wxGetTranslation(backend_desc));
//szr_basic->Add(new wxStaticText(page_general, -1, _("Graphics API:")), 1, wxALIGN_CENTER_VERTICAL, 0);
//wxChoice* const choice_gfxapi = CreateChoice(page_general,
// g_gfxapi, sizeof(gfxapi_choices)/sizeof(*gfxapi_choices), gfxapi_choices);
//szr_basic->Add(choice_gfxapi, 1, 0, 0);
// TODO: Connect with Event_Backend()
//}
std::vector<VideoBackend*>::const_iterator
it = g_available_video_backends.begin(),
itend = g_available_video_backends.end();
for (; it != itend; ++it)
choice_backend->AppendString(wxString::FromAscii((*it)->GetName().c_str()));
// TODO: How to get the translated plugin name?
choice_backend->SetStringSelection(wxString::FromAscii(g_video_backend->GetName().c_str()));
_connect_macro_(choice_backend, VideoConfigDiag::Event_Backend, wxEVT_COMMAND_CHOICE_SELECTED, this);
szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5);
szr_basic->Add(choice_backend, 1, 0, 0);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
label_backend->Disable();
choice_backend->Disable();
}
}
// adapter (D3D only)
if (vconfig.backend_info.Adapters.size())
{
szr_basic->Add(new wxStaticText(page_general, -1, _("Adapter:")), 1, wxALIGN_CENTER_VERTICAL, 5);
wxChoice* const choice_adapter = CreateChoice(page_general, vconfig.iAdapter, wxGetTranslation(adapter_desc));
std::vector<std::string>::const_iterator
@ -161,28 +240,93 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
choice_adapter->Select(vconfig.iAdapter);
szr_basic->Add(new wxStaticText(page_general, -1, _("Adapter:")), 1, wxALIGN_CENTER_VERTICAL, 5);
szr_basic->Add(choice_adapter, 1, 0, 0);
}
// - display
wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, 5, 5);
{
// display resolution
{
wxArrayString res_list = GetListOfResolutions();
if (res_list.empty())
res_list.Add(_("<No resolutions found>"));
wxStaticText* const label_display_resolution = new wxStaticText(page_general, wxID_ANY, _("Fullscreen resolution:"));
choice_display_resolution = new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list);
RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc));
_connect_macro_(choice_display_resolution, VideoConfigDiag::Event_DisplayResolution, wxEVT_COMMAND_CHOICE_SELECTED, this);
choice_display_resolution->SetStringSelection(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str()));
szr_display->Add(label_display_resolution, 1, wxALIGN_CENTER_VERTICAL, 0);
szr_display->Add(choice_display_resolution);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
label_display_resolution->Disable();
choice_display_resolution->Disable();
}
}
// aspect-ratio
{
const wxString ar_choices[] = { _("Auto"), _("Force 16:9"), _("Force 4:3"), _("Stretch to Window") };
szr_basic->Add(new wxStaticText(page_general, -1, _("Aspect Ratio:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_display->Add(new wxStaticText(page_general, -1, _("Aspect Ratio:")), 1, wxALIGN_CENTER_VERTICAL, 0);
wxChoice* const choice_aspect = CreateChoice(page_general, vconfig.iAspectRatio, wxGetTranslation(ar_desc),
sizeof(ar_choices)/sizeof(*ar_choices), ar_choices);
szr_basic->Add(choice_aspect, 1, 0, 0);
szr_display->Add(choice_aspect, 1, 0, 0);
}
// widescreen hack
szr_basic->AddStretchSpacer(1);
szr_basic->Add(CreateCheckBox(page_general, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack), 1, 0, 0);
szr_basic->AddStretchSpacer(1);
szr_basic->Add(CreateCheckBox(page_general, _("V-Sync"), wxGetTranslation(vsync_desc), vconfig.bVSync), 1, 0, 0);
szr_basic->AddStretchSpacer(1);
// various other display options
{
szr_display->Add(CreateCheckBox(page_general, _("V-Sync"), wxGetTranslation(vsync_desc), vconfig.bVSync));
szr_display->Add(CreateCheckBox(page_general, _("Use Fullscreen"), wxGetTranslation(use_fullscreen_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen));
}
}
// other basic stuff
szr_basic->Add(CreateCheckBox(page_general, _("Show FPS"), wxGetTranslation(show_fps_desc), vconfig.bShowFPS));
// - other
wxFlexGridSizer* const szr_other = new wxFlexGridSizer(2, 5, 5);
{
SettingCheckBox* render_to_main_cb;
szr_other->Add(CreateCheckBox(page_general, _("Show FPS"), wxGetTranslation(show_fps_desc), vconfig.bShowFPS));
szr_other->Add(CreateCheckBox(page_general, _("Auto adjust Window Size"), wxGetTranslation(auto_window_size_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize));
szr_other->Add(CreateCheckBox(page_general, _("Hide Mouse Cursor"), wxGetTranslation(hide_mouse_cursor_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor));
szr_other->Add(render_to_main_cb = CreateCheckBox(page_general, _("Render to Main Window"), wxGetTranslation(render_to_main_win_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain));
if (Core::GetState() != Core::CORE_UNINITIALIZED)
render_to_main_cb->Disable();
}
wxStaticBoxSizer* const group_basic = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Basic"));
group_basic->Add(szr_basic, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_general->Add(group_basic, 0, wxEXPAND | wxALL, 5);
wxStaticBoxSizer* const group_display = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Display"));
group_display->Add(szr_display, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_general->Add(group_display, 0, wxEXPAND | wxALL, 5);
wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Other"));
group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_general->Add(group_other, 0, wxEXPAND | wxALL, 5);
}
szr_general->AddStretchSpacer();
CreateDescriptionArea(page_general, szr_general);
page_general->SetSizerAndFit(szr_general);
}
// -- ENHANCEMENTS --
{
wxPanel* const page_enh = new wxPanel(notebook, -1, wxDefaultPosition);
notebook->AddPage(page_enh, _("Enhancements"));
wxBoxSizer* const szr_enh_main = new wxBoxSizer(wxVERTICAL);
// - enhancements
wxFlexGridSizer* const szr_enh = new wxFlexGridSizer(2, 5, 5);
@ -193,17 +337,17 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
wxT("1x Native (640x528)"), wxT("2x Native (1280x1056)"), wxT("3x Native (1920x1584)"),
wxT("0.75x Native (480x396)"), wxT("0.5x Native (320x264)"), wxT("0.375x Native (240x198)") };
wxChoice *const choice_efbscale = CreateChoice(page_general,
wxChoice *const choice_efbscale = CreateChoice(page_enh,
vconfig.iEFBScale, wxGetTranslation(internal_res_desc), sizeof(efbscale_choices)/sizeof(*efbscale_choices), efbscale_choices);
szr_enh->Add(new wxStaticText(page_general, wxID_ANY, _("Internal Resolution:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Internal Resolution:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(choice_efbscale);
}
// AA
{
text_aamode = new wxStaticText(page_general, -1, _("Anti-Aliasing:"));
choice_aamode = CreateChoice(page_general, vconfig.iMultisampleMode, wxGetTranslation(aa_desc));
text_aamode = new wxStaticText(page_enh, -1, _("Anti-Aliasing:"));
choice_aamode = CreateChoice(page_enh, vconfig.iMultisampleMode, wxGetTranslation(aa_desc));
std::vector<std::string>::const_iterator
it = vconfig.backend_info.AAModes.begin(),
@ -219,26 +363,14 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
// AF
{
const wxString af_choices[] = {wxT("1x"), wxT("2x"), wxT("4x"), wxT("8x"), wxT("16x")};
szr_enh->Add(new wxStaticText(page_general, -1, _("Anisotropic Filtering:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(CreateChoice(page_general, vconfig.iMaxAnisotropy, wxGetTranslation(af_desc), 5, af_choices));
szr_enh->Add(new wxStaticText(page_enh, -1, _("Anisotropic Filtering:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(CreateChoice(page_enh, vconfig.iMaxAnisotropy, wxGetTranslation(af_desc), 5, af_choices));
}
// Scaled copy, PL, Bilinear filter, 3D Vision
szr_enh->Add(CreateCheckBox(page_general, _("Scaled EFB Copy"), wxGetTranslation(scaled_efb_copy_desc), vconfig.bCopyEFBScaled));
szr_enh->Add(pixel_lighting = CreateCheckBox(page_general, _("Per-Pixel Lighting"), wxGetTranslation(pixel_lighting_desc), vconfig.bEnablePixelLighting));
szr_enh->Add(CreateCheckBox(page_general, _("Force Texture Filtering"), wxGetTranslation(force_filtering_desc), vconfig.bForceFiltering));
// 3D Vision
_3d_vision = CreateCheckBox(page_general, _("3D Vision"), wxGetTranslation(_3d_vision_desc), vconfig.b3DVision);
_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
szr_enh->Add(_3d_vision);
// TODO: Add anaglyph 3d here
// postproc shader
if (vconfig.backend_info.PPShaders.size())
{
wxChoice *const choice_ppshader = new wxChoice(page_general, -1, wxDefaultPosition);
wxChoice *const choice_ppshader = new wxChoice(page_enh, -1, wxDefaultPosition);
RegisterControl(choice_ppshader, wxGetTranslation(ppshader_desc));
choice_ppshader->AppendString(_("(off)"));
@ -255,23 +387,31 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
_connect_macro_(choice_ppshader, VideoConfigDiag::Event_PPShader, wxEVT_COMMAND_CHOICE_SELECTED, this);
szr_enh->Add(new wxStaticText(page_general, -1, _("Post-Processing Effect:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(choice_ppshader, 0, wxLEFT, 5);
szr_enh->Add(new wxStaticText(page_enh, -1, _("Post-Processing Effect:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_enh->Add(choice_ppshader);
}
wxStaticBoxSizer* const group_basic = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Basic"));
group_basic->Add(szr_basic, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_general->Add(group_basic, 0, wxEXPAND | wxALL, 5);
// Scaled copy, PL, Bilinear filter, 3D Vision
szr_enh->Add(CreateCheckBox(page_enh, _("Scaled EFB Copy"), wxGetTranslation(scaled_efb_copy_desc), vconfig.bCopyEFBScaled));
szr_enh->Add(pixel_lighting = CreateCheckBox(page_enh, _("Per-Pixel Lighting"), wxGetTranslation(pixel_lighting_desc), vconfig.bEnablePixelLighting));
szr_enh->Add(CreateCheckBox(page_enh, _("Force Texture Filtering"), wxGetTranslation(force_filtering_desc), vconfig.bForceFiltering));
wxStaticBoxSizer* const group_enh = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Enhancements"));
// 3D Vision
_3d_vision = CreateCheckBox(page_enh, _("3D Vision"), wxGetTranslation(_3d_vision_desc), vconfig.b3DVision);
_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
szr_enh->Add(_3d_vision);
// TODO: Add anaglyph 3d here
wxStaticBoxSizer* const group_enh = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Enhancements"));
group_enh->Add(szr_enh, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_general->Add(group_enh, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_enh_main->Add(group_enh, 0, wxEXPAND | wxALL, 5);
szr_enh_main->AddStretchSpacer();
CreateDescriptionArea(page_enh, szr_enh_main);
page_enh->SetSizerAndFit(szr_enh_main);
}
szr_general->AddStretchSpacer();
CreateDescriptionArea(page_general, szr_general);
page_general->SetSizerAndFit(szr_general);
}
// -- SPEED HACKS --
{
@ -301,7 +441,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_efb->Add(CreateCheckBox(page_hacks, _("Skip EFB Access from CPU"), wxGetTranslation(efb_access_desc), vconfig.bEFBAccessEnable, true), 0, wxBOTTOM | wxLEFT, 5);
szr_efb->Add(emulate_efb_format_changes, 0, wxBOTTOM | wxLEFT, 5);
szr_efb->Add(group_efbcopy, 0, wxEXPAND | wxBOTTOM, 5);
szr_efb->Add(group_efbcopy, 0, wxEXPAND | wxALL, 5);
szr_hacks->Add(szr_efb, 0, wxEXPAND | wxALL, 5);
// Texture cache
@ -342,7 +482,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
group_xfb->AddStretchSpacer(1);
group_xfb->Add(virtual_xfb, 0, wxRIGHT, 5);
group_xfb->Add(real_xfb, 0, wxRIGHT, 5);
szr_hacks->Add(group_xfb, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_hacks->Add(group_xfb, 0, wxEXPAND | wxALL, 5);
} // xfb
// - other hacks
@ -403,7 +543,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
#endif
wxStaticBoxSizer* const group_utility = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Utility"));
szr_advanced->Add(group_utility, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_advanced->Add(group_utility, 0, wxEXPAND | wxALL, 5);
group_utility->Add(szr_utility, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
}
@ -416,8 +556,26 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_misc->Add(CreateCheckBox(page_advanced, _("Crop"), wxGetTranslation(crop_desc), vconfig.bCrop));
szr_misc->Add(CreateCheckBox(page_advanced, _("Enable Hotkeys"), wxGetTranslation(hotkeys_desc), vconfig.bOSDHotKey));
szr_misc->Add(CreateCheckBox(page_advanced, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack));
// Progressive Scan
{
wxCheckBox* const cb_prog_scan = new wxCheckBox(page_advanced, wxID_ANY, _("Enable Progressive Scan"));
RegisterControl(cb_prog_scan, wxGetTranslation(prog_scan_desc));
_connect_macro_(cb_prog_scan, VideoConfigDiag::Event_ProgressiveScan, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
cb_prog_scan->Disable();
cb_prog_scan->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive);
// A bit strange behavior, but this needs to stay in sync with the main progressive boolean; TODO: Is this still necessary?
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive);
szr_misc->Add(cb_prog_scan);
}
wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc"));
szr_advanced->Add(group_misc, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);
group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
}
@ -463,6 +621,7 @@ SettingRadioButton* VideoConfigDiag::CreateRadioButton(wxWindow* parent, const w
return rb;
}
/* Use this to register descriptions for controls which have NOT been created using the Create* functions from above */
wxControl* VideoConfigDiag::RegisterControl(wxControl* const control, const wxString& description)
{
ctrl_descs.insert(std::pair<wxWindow*,wxString>(control, description));

View File

@ -6,6 +6,7 @@
#include <string>
#include <map>
#include "ConfigManager.h"
#include "VideoConfig.h"
#include <wx/wx.h>
@ -18,6 +19,11 @@
#include <wx/panel.h>
#include <wx/spinctrl.h>
#include "MsgHandler.h"
#include "Frame.h"
extern CFrame* main_frame;
template <typename W>
class BoolSetting : public W
{
@ -69,9 +75,58 @@ public:
VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& ininame);
protected:
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO: Query list of supported AA modes
void Event_Backend(wxCommandEvent &ev)
{
VideoBackend* new_backend = g_available_video_backends[ev.GetInt()];
if (g_video_backend != new_backend)
{
bool do_switch = true;
if (strcmp(new_backend->GetName().c_str(), _trans("Software Renderer")) == 0)
{
do_switch = (wxYES == wxMessageBox(_("Software rendering is an order of magnitude slower than using the other backends.\nIt's only useful for debugging purposes.\nDo you really want to enable software rendering? If unsure, select 'No'."),
_("Warning"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION, wxGetActiveWindow()));
}
if (do_switch)
{
// TODO: Only reopen the dialog if the software backend is selected (make sure to reinitialize backend info)
// reopen the dialog
Close();
g_video_backend = new_backend;
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoBackend = g_video_backend->GetName();
g_video_backend->ShowConfig(GetParent());
}
else
{
// Select current backend again
choice_backend->SetStringSelection(wxString::FromAscii(g_video_backend->GetName().c_str()));
}
}
ev.Skip();
}
void Event_Adapter(wxCommandEvent &ev) { ev.Skip(); } // TODO
void Event_DisplayResolution(wxCommandEvent &ev)
{
SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution =
choice_display_resolution->GetStringSelection().mb_str();
#if defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame->m_XRRConfig->Update();
#endif
ev.Skip();
}
void Event_ProgressiveScan(wxCommandEvent &ev)
{
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", ev.GetInt());
SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive = ev.GetInt();
ev.Skip();
}
void Event_Stc(wxCommandEvent &ev)
{
int samples[] = { 0, 512, 128 };
@ -92,6 +147,7 @@ protected:
vconfig.sPostProcessingShader = ev.GetString().mb_str();
else
vconfig.sPostProcessingShader.clear();
ev.Skip();
}
@ -109,6 +165,7 @@ protected:
pixel_lighting->Enable(vconfig.backend_info.bSupportsPixelLighting);
// 3D vision
_3d_vision->Enable(vconfig.backend_info.bSupports3DVision);
_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
// EFB copy
@ -138,6 +195,8 @@ protected:
void Evt_LeaveControl(wxMouseEvent& ev);
void CreateDescriptionArea(wxPanel* const page, wxBoxSizer* const sizer);
wxChoice* choice_backend;
wxChoice* choice_display_resolution;
wxStaticText* text_aamode;
SettingChoice* choice_aamode;

View File

@ -65,15 +65,103 @@ WiimoteConfigPage::WiimoteConfigPage(wxWindow* const parent, const int index)
Layout();
}
WiimoteGeneralConfigPage::WiimoteGeneralConfigPage(wxWindow* const parent)
: wxPanel(parent, -1, wxDefaultPosition)
{
const wxString str[] = { _("Bottom"), _("Top") };
wxChoice* const WiiSensBarPos = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 2, str);
wxSlider* const WiiSensBarSens = new wxSlider(this, wxID_ANY, 0, 0, 4, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
wxSlider* const WiimoteSpkVolume = new wxSlider(this, wxID_ANY, 0, 0, 127);
wxCheckBox* const WiimoteMotor = new wxCheckBox(this, wxID_ANY, _("Wiimote Motor"));
wxCheckBox* const WiimoteReconnectOnLoad = new wxCheckBox(this, wxID_ANY, _("Reconnect Wiimote on State Loading"));
wxStaticText* const WiiSensBarPosText = new wxStaticText(this, wxID_ANY, _("Sensor Bar Position:"));
wxStaticText* const WiiSensBarSensText = new wxStaticText(this, wxID_ANY, _("IR Sensitivity:"));
wxStaticText* const WiiSensBarSensMinText = new wxStaticText(this, wxID_ANY, _("Min"));
wxStaticText* const WiiSensBarSensMaxText = new wxStaticText(this, wxID_ANY, _("Max"));
wxStaticText* const WiimoteSpkVolumeText = new wxStaticText(this, wxID_ANY, _("Speaker Volume:"));
wxStaticText* const WiimoteSpkVolumeMinText = new wxStaticText(this, wxID_ANY, _("Min"));
wxStaticText* const WiimoteSpkVolumeMaxText = new wxStaticText(this, wxID_ANY, _("Max"));
WiiSensBarSens->SetMinSize(wxSize(100,-1));
WiimoteSpkVolume->SetMinSize(wxSize(100,-1));
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
WiiSensBarPos->Disable();
WiiSensBarSens->Disable();
WiimoteSpkVolume->Disable();
WiimoteMotor->Disable();
WiiSensBarPosText->Disable();
WiiSensBarSensText->Disable();
WiiSensBarSensMinText->Disable();
WiiSensBarSensMaxText->Disable();
WiimoteSpkVolumeText->Disable();
WiimoteSpkVolumeMinText->Disable();
WiimoteSpkVolumeMaxText->Disable();
}
WiiSensBarPos->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR"));
WiiSensBarSens->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u32>("BT.SENS"));
WiimoteSpkVolume->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.SPKV"));
WiimoteMotor->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<bool>("BT.MOT"));
WiimoteReconnectOnLoad->SetValue(SConfig::GetInstance().m_WiimoteReconnectOnLoad);
_connect_macro_(WiiSensBarPos, WiimoteGeneralConfigPage::OnSensorBarPos, wxEVT_COMMAND_CHOICE_SELECTED, this);
_connect_macro_(WiiSensBarSens, WiimoteGeneralConfigPage::OnSensorBarSensitivity, wxEVT_COMMAND_SLIDER_UPDATED, this);
_connect_macro_(WiimoteSpkVolume, WiimoteGeneralConfigPage::OnSpeakerVolume, wxEVT_COMMAND_SLIDER_UPDATED, this);
_connect_macro_(WiimoteMotor, WiimoteGeneralConfigPage::OnMotor, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
_connect_macro_(WiimoteReconnectOnLoad, WiimoteGeneralConfigPage::OnReconnectOnLoad, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer* const general_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("General Settings"));
wxFlexGridSizer* const choice_sizer = new wxFlexGridSizer(2, 5, 5);
wxBoxSizer* const sensbarsens_sizer = new wxBoxSizer(wxHORIZONTAL);
sensbarsens_sizer->Add(WiiSensBarSensMinText, 1, wxALIGN_CENTER_VERTICAL, 0);
sensbarsens_sizer->Add(WiiSensBarSens);
sensbarsens_sizer->Add(WiiSensBarSensMaxText, 1, wxALIGN_CENTER_VERTICAL, 0);
wxBoxSizer* const spkvol_sizer = new wxBoxSizer(wxHORIZONTAL);
spkvol_sizer->Add(WiimoteSpkVolumeMinText, 1, wxALIGN_CENTER_VERTICAL, 0);
spkvol_sizer->Add(WiimoteSpkVolume);
spkvol_sizer->Add(WiimoteSpkVolumeMaxText, 1, wxALIGN_CENTER_VERTICAL, 0);
choice_sizer->Add(WiiSensBarPosText, 1, wxALIGN_CENTER_VERTICAL, 0);
choice_sizer->Add(WiiSensBarPos);
choice_sizer->Add(WiiSensBarSensText, 1, wxALIGN_CENTER_VERTICAL, 0);
choice_sizer->Add(sensbarsens_sizer);
choice_sizer->Add(WiimoteSpkVolumeText, 1, wxALIGN_CENTER_VERTICAL, 0);
choice_sizer->Add(spkvol_sizer);
wxGridSizer* const wiimote_sizer = new wxGridSizer(1, 5, 5);
wiimote_sizer->Add(WiimoteMotor);
wiimote_sizer->Add(WiimoteReconnectOnLoad);
general_sizer->Add(choice_sizer);
general_sizer->Add(wiimote_sizer);
main_sizer->Add(general_sizer, 0, wxEXPAND | wxALL, 5);
main_sizer->AddStretchSpacer();
SetSizerAndFit(main_sizer);
Layout();
}
WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin)
: wxDialog(parent, -1, _("Dolphin Wiimote Configuration"), wxDefaultPosition, wxDefaultSize)
, m_plugin(plugin)
{
m_pad_notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT);
m_pad_notebook->AddPage(new WiimoteGeneralConfigPage(m_pad_notebook), wxString(_("General")));
for (unsigned int i = 0; i < 4; ++i)
{
WiimoteConfigPage* const wpage = new WiimoteConfigPage(m_pad_notebook, i);
m_pad_notebook->AddPage(wpage, wxString(_("Wiimote ")) + wxChar('1'+i));
m_wiimote_config_pages.push_back(wpage);
}
m_pad_notebook->SetSelection(0);
@ -97,16 +185,15 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin
void WiimoteConfigDiag::ConfigEmulatedWiimote(wxCommandEvent&)
{
InputConfigDialog* const m_emu_config_diag = new InputConfigDialog(this, m_plugin, _trans("Dolphin Emulated Wiimote Configuration"), m_pad_notebook->GetSelection());
InputConfigDialog* const m_emu_config_diag = new InputConfigDialog(this, m_plugin, _trans("Dolphin Emulated Wiimote Configuration"), m_pad_notebook->GetSelection()-1);
m_emu_config_diag->ShowModal();
m_emu_config_diag->Destroy();
}
void WiimoteConfigDiag::UpdateGUI()
{
for (size_t p = 0; p < m_pad_notebook->GetPageCount(); ++p)
((WiimoteConfigPage*)m_pad_notebook->GetPage(p))->
connected_wiimotes_txt->SetLabel(ConnectedWiimotesString());
for (std::vector<WiimoteConfigPage*>::iterator it = m_wiimote_config_pages.begin(); it != m_wiimote_config_pages.end(); ++it)
(*it)->connected_wiimotes_txt->SetLabel(ConnectedWiimotesString());
}
#ifdef _WIN32
@ -174,8 +261,8 @@ void WiimoteConfigDiag::Save(wxCommandEvent& event)
sec.Set("Source", (int)g_wiimote_sources[i]);
}
for (size_t p = 0; p < m_pad_notebook->GetPageCount(); ++p)
((WiimoteConfigPage*)m_pad_notebook->GetPage(p))->UpdateWiimoteStatus();
for (std::vector<WiimoteConfigPage*>::iterator it = m_wiimote_config_pages.begin(); it != m_wiimote_config_pages.end(); ++it)
(*it)->UpdateWiimoteStatus();
inifile.Save(ini_filename);
@ -184,8 +271,8 @@ void WiimoteConfigDiag::Save(wxCommandEvent& event)
void WiimoteConfigDiag::Cancel(wxCommandEvent& event)
{
for (size_t p = 0; p < m_pad_notebook->GetPageCount(); ++p)
((WiimoteConfigPage*)m_pad_notebook->GetPage(p))->RevertSource();
for (std::vector<WiimoteConfigPage*>::iterator it = m_wiimote_config_pages.begin(); it != m_wiimote_config_pages.end(); ++it)
(*it)->RevertSource();
event.Skip();
}

View File

@ -14,6 +14,7 @@
#include <wx/spinctrl.h>
#include "InputConfigDiag.h"
#include "ConfigManager.h"
class WiimoteConfigPage : public wxNotebookPage
{
@ -31,6 +32,40 @@ private:
unsigned int orig_source;
};
class WiimoteGeneralConfigPage : public wxPanel
{
public:
WiimoteGeneralConfigPage(wxWindow* const parent);
void OnSensorBarPos(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.BAR", event.GetInt());
event.Skip();
}
void OnSensorBarSensitivity(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.SENS", event.GetInt());
event.Skip();
}
void OnSpeakerVolume(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.SPKV", event.GetInt());
event.Skip();
}
void OnMotor(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.MOT", event.GetInt());
event.Skip();
}
void OnReconnectOnLoad(wxCommandEvent& event)
{
SConfig::GetInstance().m_WiimoteReconnectOnLoad = event.GetInt();
event.Skip();
}
private:
};
class WiimoteConfigDiag : public wxDialog
{
public:
@ -50,6 +85,7 @@ private:
InputPlugin& m_plugin;
wxNotebook* m_pad_notebook;
std::vector<WiimoteConfigPage*> m_wiimote_config_pages;
};

View File

@ -19,6 +19,7 @@
#include "VideoConfigDialog.h"
#include "FileUtil.h"
#include "Core.h"
#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s)
@ -57,6 +58,30 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title,
wxGridSizer* const szr_rendering = new wxGridSizer(2, 5, 5);
group_rendering->Add(szr_rendering, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
// backend
wxStaticText* const label_backend = new wxStaticText(page_general, wxID_ANY, _("Backend:"));
wxChoice* const choice_backend = new wxChoice(page_general, wxID_ANY, wxDefaultPosition);
std::vector<VideoBackend*>::const_iterator
it = g_available_video_backends.begin(),
itend = g_available_video_backends.end();
for (; it != itend; ++it)
choice_backend->AppendString(wxString::FromAscii((*it)->GetName().c_str()));
// TODO: How to get the translated plugin name?
choice_backend->SetStringSelection(wxString::FromAscii(g_video_backend->GetName().c_str()));
_connect_macro_(choice_backend, VideoConfigDialog::Event_Backend, wxEVT_COMMAND_CHOICE_SELECTED, this);
szr_rendering->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5);
szr_rendering->Add(choice_backend, 1, 0, 0);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
label_backend->Disable();
choice_backend->Disable();
}
// rasterizer
szr_rendering->Add(new SettingCheckBox(page_general, wxT("Hardware rasterization"), wxT(""), vconfig.bHwRasterizer));
}

View File

@ -22,6 +22,8 @@
#include <string>
#include "SWVideoConfig.h"
#include "VideoBackendBase.h"
#include "ConfigManager.h"
#include <wx/wx.h>
#include <wx/textctrl.h>
@ -39,6 +41,22 @@ public:
VideoConfigDialog(wxWindow* parent, const std::string &title, const std::string& ininame);
~VideoConfigDialog();
void Event_Backend(wxCommandEvent &ev)
{
VideoBackend* new_backend = g_available_video_backends[ev.GetInt()];
if (g_video_backend != new_backend)
{
Close();
g_video_backend = new_backend;
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoBackend = g_video_backend->GetName();
g_video_backend->ShowConfig(GetParent());
}
ev.Skip();
}
protected:
SWVideoConfig& vconfig;
std::string ininame;