2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2014-07-29 11:14:25 -06:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2010-11-15 02:54:07 -07:00
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
#include <cstddef>
|
2011-04-29 17:11:18 -06:00
|
|
|
#include <map>
|
2014-02-17 03:18:15 -07:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2014-07-29 11:14:25 -06:00
|
|
|
#include <wx/button.h>
|
2010-11-15 02:54:07 -07:00
|
|
|
#include <wx/checkbox.h>
|
2014-02-22 15:36:30 -07:00
|
|
|
#include <wx/choice.h>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/msgdlg.h>
|
|
|
|
#include <wx/radiobut.h>
|
2010-11-15 02:54:07 -07:00
|
|
|
#include <wx/spinctrl.h>
|
2014-02-18 18:56:29 -07:00
|
|
|
#include <wx/stattext.h>
|
2011-03-22 18:54:31 -06:00
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2017-05-18 06:59:38 -06:00
|
|
|
#include "Core/Config/GraphicsSettings.h"
|
2017-04-06 19:55:43 -06:00
|
|
|
|
|
|
|
class DolphinSlider;
|
|
|
|
struct VideoConfig;
|
2011-06-02 13:32:34 -06:00
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
class wxBoxSizer;
|
|
|
|
class wxControl;
|
|
|
|
class wxPanel;
|
|
|
|
|
2011-04-25 14:06:45 -06:00
|
|
|
template <typename W>
|
|
|
|
class BoolSetting : public W
|
2010-11-15 02:54:07 -07:00
|
|
|
{
|
2011-04-05 16:46:57 -06:00
|
|
|
public:
|
2017-05-18 06:59:38 -06:00
|
|
|
BoolSetting(wxWindow* parent, const wxString& label, const wxString& tooltip,
|
|
|
|
const Config::ConfigInfo<bool>& setting, bool reverse = false, long style = 0);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
2017-05-18 06:59:38 -06:00
|
|
|
Config::SetBaseOrCurrent(m_setting, (ev.GetInt() != 0) != m_reverse);
|
|
|
|
ev.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Config::ConfigInfo<bool> m_setting;
|
|
|
|
const bool m_reverse;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename W>
|
|
|
|
class RefBoolSetting : public W
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RefBoolSetting(wxWindow* parent, const wxString& label, const wxString& tooltip, bool& setting,
|
|
|
|
bool reverse = false, long style = 0);
|
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
|
|
|
m_setting = (ev.GetInt() != 0) != m_reverse;
|
2016-06-24 02:43:46 -06:00
|
|
|
ev.Skip();
|
|
|
|
}
|
2011-03-27 16:23:44 -06:00
|
|
|
|
2010-11-15 02:54:07 -07:00
|
|
|
private:
|
2016-06-24 02:43:46 -06:00
|
|
|
bool& m_setting;
|
|
|
|
const bool m_reverse;
|
2010-11-15 02:54:07 -07:00
|
|
|
};
|
|
|
|
|
2011-04-25 14:06:45 -06:00
|
|
|
typedef BoolSetting<wxCheckBox> SettingCheckBox;
|
|
|
|
typedef BoolSetting<wxRadioButton> SettingRadioButton;
|
|
|
|
|
2011-02-12 02:10:11 -07:00
|
|
|
class IntegerSetting : public wxSpinCtrl
|
|
|
|
{
|
|
|
|
public:
|
2017-05-18 06:59:38 -06:00
|
|
|
IntegerSetting(wxWindow* parent, const wxString& label, const Config::ConfigInfo<int>& setting,
|
|
|
|
int minVal, int maxVal, long style = 0);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
2017-05-18 06:59:38 -06:00
|
|
|
Config::SetBaseOrCurrent(m_setting, ev.GetInt());
|
2016-06-24 02:43:46 -06:00
|
|
|
ev.Skip();
|
|
|
|
}
|
2011-02-12 02:10:11 -07:00
|
|
|
|
|
|
|
private:
|
2017-05-18 06:59:38 -06:00
|
|
|
Config::ConfigInfo<int> m_setting;
|
2011-02-12 02:10:11 -07:00
|
|
|
};
|
|
|
|
|
2011-04-25 14:06:45 -06:00
|
|
|
class SettingChoice : public wxChoice
|
|
|
|
{
|
|
|
|
public:
|
2017-05-18 06:59:38 -06:00
|
|
|
SettingChoice(wxWindow* parent, const Config::ConfigInfo<int>& setting, const wxString& tooltip,
|
|
|
|
int num = 0, const wxString choices[] = nullptr, long style = 0);
|
2016-06-24 02:43:46 -06:00
|
|
|
void UpdateValue(wxCommandEvent& ev);
|
|
|
|
|
2011-04-25 14:06:45 -06:00
|
|
|
private:
|
2017-05-18 06:59:38 -06:00
|
|
|
Config::ConfigInfo<int> m_setting;
|
2011-04-25 14:06:45 -06:00
|
|
|
};
|
2011-02-20 16:42:21 -07:00
|
|
|
|
2010-11-15 02:54:07 -07:00
|
|
|
class VideoConfigDiag : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2016-06-26 00:06:23 -06:00
|
|
|
VideoConfigDiag(wxWindow* parent, const std::string& title);
|
2010-11-15 02:54:07 -07:00
|
|
|
|
2011-03-21 13:57:31 -06:00
|
|
|
protected:
|
2017-04-06 19:55:43 -06:00
|
|
|
void Event_Backend(wxCommandEvent& ev);
|
2016-06-24 02:43:46 -06:00
|
|
|
void Event_DisplayResolution(wxCommandEvent& ev);
|
2017-04-06 19:55:43 -06:00
|
|
|
void Event_ProgressiveScan(wxCommandEvent& ev);
|
|
|
|
void Event_SafeTextureCache(wxCommandEvent& ev);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2017-04-06 19:55:43 -06:00
|
|
|
void Event_PPShader(wxCommandEvent& ev);
|
|
|
|
void Event_ConfigurePPShader(wxCommandEvent& ev);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2017-04-06 19:55:43 -06:00
|
|
|
void Event_StereoDepth(wxCommandEvent& ev);
|
|
|
|
void Event_StereoConvergence(wxCommandEvent& ev);
|
|
|
|
void Event_StereoMode(wxCommandEvent& ev);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2016-08-02 00:22:58 -06:00
|
|
|
void Event_Close(wxCommandEvent&);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
|
|
|
// Enables/disables UI elements depending on current config
|
2017-04-06 19:55:43 -06:00
|
|
|
void OnUpdateUI(wxUpdateUIEvent& ev);
|
2011-03-21 13:57:31 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Creates controls and connects their enter/leave window events to Evt_Enter/LeaveControl
|
|
|
|
SettingCheckBox* CreateCheckBox(wxWindow* parent, const wxString& label,
|
2017-05-18 06:59:38 -06:00
|
|
|
const wxString& description,
|
|
|
|
const Config::ConfigInfo<bool>& setting, bool reverse = false,
|
2016-06-24 02:43:46 -06:00
|
|
|
long style = 0);
|
2017-05-18 06:59:38 -06:00
|
|
|
RefBoolSetting<wxCheckBox>* CreateCheckBoxRefBool(wxWindow* parent, const wxString& label,
|
|
|
|
const wxString& description, bool& setting);
|
|
|
|
SettingChoice* CreateChoice(wxWindow* parent, const Config::ConfigInfo<int>& setting,
|
|
|
|
const wxString& description, int num = 0,
|
|
|
|
const wxString choices[] = nullptr, long style = 0);
|
2016-06-24 02:43:46 -06:00
|
|
|
SettingRadioButton* CreateRadioButton(wxWindow* parent, const wxString& label,
|
2017-05-18 06:59:38 -06:00
|
|
|
const wxString& description,
|
|
|
|
const Config::ConfigInfo<bool>& setting,
|
2016-06-24 02:43:46 -06:00
|
|
|
bool reverse = false, long style = 0);
|
2011-04-29 17:11:18 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Same as above but only connects enter/leave window events
|
|
|
|
wxControl* RegisterControl(wxControl* const control, const wxString& description);
|
2011-04-29 17:11:18 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
void Evt_EnterControl(wxMouseEvent& ev);
|
|
|
|
void Evt_LeaveControl(wxMouseEvent& ev);
|
|
|
|
void CreateDescriptionArea(wxPanel* const page, wxBoxSizer* const sizer);
|
|
|
|
void PopulatePostProcessingShaders();
|
|
|
|
void PopulateAAList();
|
|
|
|
void OnAAChanged(wxCommandEvent& ev);
|
2011-04-29 17:11:18 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxChoice* choice_backend;
|
|
|
|
wxChoice* choice_adapter;
|
|
|
|
wxChoice* choice_display_resolution;
|
2014-09-03 01:35:23 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxStaticText* label_backend;
|
|
|
|
wxStaticText* label_adapter;
|
2014-09-03 01:35:23 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxStaticText* text_aamode;
|
|
|
|
wxChoice* choice_aamode;
|
2016-08-02 00:22:58 -06:00
|
|
|
DolphinSlider* conv_slider;
|
2011-03-21 13:57:31 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxStaticText* label_display_resolution;
|
2014-09-03 01:35:23 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxButton* button_config_pp;
|
2014-07-29 11:14:25 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
SettingCheckBox* borderless_fullscreen;
|
2017-05-18 06:59:38 -06:00
|
|
|
RefBoolSetting<wxCheckBox>* render_to_main_checkbox;
|
2011-03-21 13:57:31 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
SettingRadioButton* virtual_xfb;
|
|
|
|
SettingRadioButton* real_xfb;
|
2011-03-21 13:57:31 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
SettingCheckBox* cache_hires_textures;
|
2015-03-01 15:53:15 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxCheckBox* progressive_scan_checkbox;
|
2017-02-18 17:22:41 -07:00
|
|
|
wxCheckBox* vertex_rounding_checkbox;
|
2014-09-03 01:35:23 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxChoice* choice_ppshader;
|
2014-10-31 08:53:08 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
std::map<wxWindow*, wxString> ctrl_descs; // maps setting controls to their descriptions
|
|
|
|
std::map<wxWindow*, wxStaticText*> desc_texts; // maps dialog tabs (which are the parents of the
|
|
|
|
// setting controls) to their description text
|
|
|
|
// objects
|
2011-04-29 17:11:18 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
VideoConfig& vconfig;
|
2015-11-05 14:50:20 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
size_t m_msaa_modes;
|
2010-11-15 02:54:07 -07:00
|
|
|
};
|