2010-11-15 09:54:07 +00:00
|
|
|
|
|
|
|
#ifndef _CONFIG_DIAG_H_
|
|
|
|
#define _CONFIG_DIAG_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "VideoConfig.h"
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/combobox.h>
|
|
|
|
#include <wx/checkbox.h>
|
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/panel.h>
|
|
|
|
#include <wx/spinctrl.h>
|
|
|
|
|
2011-03-21 05:46:33 +00:00
|
|
|
class SettingCheckBox : public wxCheckBox
|
2010-11-15 09:54:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-03-21 05:46:33 +00:00
|
|
|
SettingCheckBox(wxWindow* parent, const wxString& label, const wxString& tooltip,
|
|
|
|
bool &setting, long style = 0);
|
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
|
|
|
int const val = Get3StateValue();
|
|
|
|
*reinterpret_cast<u8*>(&m_setting) = (u8)val;
|
|
|
|
ev.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool &m_setting;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SettingRadioButton : public wxRadioButton
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SettingRadioButton(wxWindow* parent, const wxString& label, const wxString& tooltip,
|
|
|
|
bool &setting, bool reverse = false, long style = 0);
|
2010-11-15 09:54:07 +00:00
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
|
|
|
m_setting = (ev.GetInt() != 0) ^ m_reverse;
|
2010-11-21 14:47:28 +00:00
|
|
|
ev.Skip();
|
2010-11-15 09:54:07 +00:00
|
|
|
}
|
2011-03-21 05:46:33 +00:00
|
|
|
|
2010-11-15 09:54:07 +00:00
|
|
|
private:
|
|
|
|
bool &m_setting;
|
|
|
|
const bool m_reverse;
|
|
|
|
};
|
|
|
|
|
2011-02-12 09:10:11 +00:00
|
|
|
template <typename T>
|
|
|
|
class IntegerSetting : public wxSpinCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IntegerSetting(wxWindow* parent, const wxString& label, T& setting, int minVal, int maxVal, long style = 0);
|
|
|
|
|
|
|
|
void UpdateValue(wxCommandEvent& ev)
|
|
|
|
{
|
|
|
|
m_setting = ev.GetInt();
|
|
|
|
ev.Skip();
|
|
|
|
}
|
2011-03-21 05:46:33 +00:00
|
|
|
|
2011-02-12 09:10:11 +00:00
|
|
|
private:
|
|
|
|
T& m_setting;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef IntegerSetting<u32> U32Setting;
|
|
|
|
|
2010-11-15 09:54:07 +00:00
|
|
|
class SettingChoice : public wxChoice
|
|
|
|
{
|
|
|
|
public:
|
2011-02-12 09:10:11 +00:00
|
|
|
SettingChoice(wxWindow* parent, int &setting, const wxString& tooltip, int num = 0, const wxString choices[] = NULL, long style = 0);
|
2011-03-21 05:46:33 +00:00
|
|
|
|
2010-11-15 09:54:07 +00:00
|
|
|
void UpdateValue(wxCommandEvent& ev);
|
2011-03-21 05:46:33 +00:00
|
|
|
|
2010-11-15 09:54:07 +00:00
|
|
|
private:
|
|
|
|
int &m_setting;
|
|
|
|
};
|
|
|
|
|
2011-02-20 23:42:21 +00:00
|
|
|
class CGameListCtrl;
|
|
|
|
|
2010-11-15 09:54:07 +00:00
|
|
|
class VideoConfigDiag : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2011-03-21 05:46:33 +00:00
|
|
|
VideoConfigDiag(wxWindow* parent, const std::string &title, bool is_game_config = false);
|
2010-11-15 09:54:07 +00:00
|
|
|
|
2011-03-21 05:46:33 +00:00
|
|
|
private:
|
2010-11-23 19:58:02 +00:00
|
|
|
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO: Query list of supported AA modes
|
2010-11-21 14:47:28 +00:00
|
|
|
void Event_Adapter(wxCommandEvent &ev) { ev.Skip(); } // TODO
|
|
|
|
|
|
|
|
void Event_StcSafe(wxCommandEvent &ev) { vconfig.iSafeTextureCache_ColorSamples = 0; ev.Skip(); }
|
|
|
|
void Event_StcNormal(wxCommandEvent &ev) { vconfig.iSafeTextureCache_ColorSamples = 512; ev.Skip(); }
|
|
|
|
void Event_StcFast(wxCommandEvent &ev) { vconfig.iSafeTextureCache_ColorSamples = 128; ev.Skip(); }
|
2010-11-15 09:54:07 +00:00
|
|
|
|
|
|
|
void Event_PPShader(wxCommandEvent &ev)
|
|
|
|
{
|
|
|
|
const int sel = ev.GetInt();
|
|
|
|
if (sel)
|
|
|
|
vconfig.sPostProcessingShader = ev.GetString().mb_str();
|
|
|
|
else
|
|
|
|
vconfig.sPostProcessingShader.clear();
|
2010-11-21 14:47:28 +00:00
|
|
|
ev.Skip();
|
|
|
|
}
|
|
|
|
|
2011-02-13 13:42:59 +00:00
|
|
|
void Event_ClickClose(wxCommandEvent&);
|
|
|
|
void Event_Close(wxCloseEvent&);
|
|
|
|
|
2011-02-13 22:36:12 +00:00
|
|
|
// Refresh UI values from current config (used when reloading config)
|
|
|
|
void SetUIValuesFromConfig();
|
2011-02-13 13:42:59 +00:00
|
|
|
|
2011-03-21 05:46:33 +00:00
|
|
|
VideoConfig& vconfig;
|
2010-11-15 09:54:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|