From e706ccc5d063c00bcbafe7d0bddf6c086af7c775 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 23 Jun 2010 12:57:59 +0000 Subject: [PATCH] Hide OpenCL GUI option for non-OpenCL builds. From now on if you create a GUI option specific to a particular build, do not gray it out. Instead do as I have done here and make it not present on those builds. It may add a few precompiler conditionals that developers have to look at, but that is considerably better than a completely useless option that the end user has to look at. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5774 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ConfigMain.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index e7196dd88d..096cc02640 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -64,7 +64,9 @@ EVT_CHOICE(ID_FRAMELIMIT, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_FRAMELIMIT_USEFPSFORLIMITING, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_ALWAYS_HLE_BS2, CConfigMain::CoreSettingsChanged) +#if defined(HAVE_OPENCL) && HAVE_OPENCL EVT_CHECKBOX(ID_ENABLE_OPENCL, CConfigMain::CoreSettingsChanged) +#endif EVT_RADIOBOX(ID_CPUENGINE, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::CoreSettingsChanged) @@ -161,7 +163,9 @@ void CConfigMain::UpdateGUI() EnableCheats->Disable(); AlwaysHLE_BS2->Disable(); +#if defined(HAVE_OPENCL) && HAVE_OPENCL EnableOpenCL->Disable(); +#endif CPUEngine->Disable(); LockThreads->Disable(); DSPThread->Disable(); @@ -265,7 +269,9 @@ void CConfigMain::InitializeGUIValues() // General - Advanced AlwaysHLE_BS2->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2); +#if defined(HAVE_OPENCL) && HAVE_OPENCL EnableOpenCL->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableOpenCL); +#endif CPUEngine->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore); LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads); DSPThread->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread); @@ -333,8 +339,9 @@ void CConfigMain::InitializeGUITooltips() // General - Advanced DSPThread->SetToolTip(wxT("Run DSPLLE on a dedicated thread (not recommended).")); +#if defined(HAVE_OPENCL) && HAVE_OPENCL EnableOpenCL->SetToolTip(wxT("Allow videocard to accelerate texture decoding.")); - +#endif // Display - Display FullscreenResolution->SetToolTip(wxT("Select resolution for fullscreen mode")); @@ -403,9 +410,8 @@ void CConfigMain::CreateGUIControls() // Core Settings - Advanced sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Advanced Settings")); AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, wxT("HLE the IPL (recommended)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); +#if defined(HAVE_OPENCL) && HAVE_OPENCL EnableOpenCL = new wxCheckBox(GeneralPage, ID_ENABLE_OPENCL, wxT("Enable OpenCL"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); -#if !(defined(HAVE_OPENCL) && HAVE_OPENCL) - EnableOpenCL->Enable(false); #endif CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, wxT("CPU Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS); LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -422,7 +428,9 @@ void CConfigMain::CreateGUIControls() sbBasic->Add(sFramelimit, 0, wxALL | wxEXPAND, 5); sbAdvanced->Add(AlwaysHLE_BS2, 0, wxALL, 5); +#if defined(HAVE_OPENCL) && HAVE_OPENCL sbAdvanced->Add(EnableOpenCL, 0, wxALL, 5); +#endif sbAdvanced->Add(CPUEngine, 0, wxALL, 5); sbAdvanced->Add(LockThreads, 0, wxALL, 5); sbAdvanced->Add(DSPThread, 0, wxALL, 5); @@ -818,9 +826,11 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event) case ID_ALWAYS_HLE_BS2: SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = AlwaysHLE_BS2->IsChecked(); break; +#if defined(HAVE_OPENCL) && HAVE_OPENCL case ID_ENABLE_OPENCL: SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableOpenCL = EnableOpenCL->IsChecked(); break; +#endif case ID_CPUENGINE: SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection(); if (main_frame->g_pCodeWindow)