Moved per-game graphics configuration to the game-list right click menu. It will be too difficult to make the "profiles" drop-down thing work with 3-state vs 2-state checkboxes. The per-game settings now have "undetermined" states, except for the radio buttons(I'll fix that later). It's super hacky right now. Video config (probably all config stuff) could be redone.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7386 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2011-03-21 05:46:33 +00:00
parent 8eaed1c105
commit 068855bbd6
26 changed files with 462 additions and 522 deletions

View File

@ -17,25 +17,40 @@
#include <wx/panel.h>
#include <wx/spinctrl.h>
template <typename W>
class BoolSetting : public W
class SettingCheckBox : public wxCheckBox
{
public:
BoolSetting(wxWindow* parent, const wxString& label, const wxString& tooltip, bool &setting, bool reverse = false, long style = 0);
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);
void UpdateValue(wxCommandEvent& ev)
{
m_setting = (ev.GetInt() != 0) ^ m_reverse;
ev.Skip();
}
private:
bool &m_setting;
const bool m_reverse;
};
typedef BoolSetting<wxCheckBox> SettingCheckBox;
typedef BoolSetting<wxRadioButton> SettingRadioButton;
template <typename T>
class IntegerSetting : public wxSpinCtrl
{
@ -47,6 +62,7 @@ public:
m_setting = ev.GetInt();
ev.Skip();
}
private:
T& m_setting;
};
@ -57,7 +73,9 @@ class SettingChoice : public wxChoice
{
public:
SettingChoice(wxWindow* parent, int &setting, const wxString& tooltip, int num = 0, const wxString choices[] = NULL, long style = 0);
void UpdateValue(wxCommandEvent& ev);
private:
int &m_setting;
};
@ -67,9 +85,9 @@ class CGameListCtrl;
class VideoConfigDiag : public wxDialog
{
public:
VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& ininame);
VideoConfigDiag(wxWindow* parent, const std::string &title, bool is_game_config = false);
protected:
private:
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO: Query list of supported AA modes
void Event_Adapter(wxCommandEvent &ev) { ev.Skip(); } // TODO
@ -90,92 +108,10 @@ protected:
void Event_ClickClose(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
void Event_OnProfileChange(wxCommandEvent& ev);
// Enables/disables UI elements depending on current config - if appropriate also updates g_Config
void OnUpdateUI(wxUpdateUIEvent& ev);
// Refresh UI values from current config (used when reloading config)
void SetUIValuesFromConfig();
// Don't mess with keeping two comboboxes in sync, use only one CB instead..
SettingChoice* profile_cb; // "General" tab
wxStaticText* profile_text; // "Advanced" tab
wxChoice* choice_adapter;
wxChoice* choice_aspect;
SettingCheckBox* widescreen_hack;
SettingCheckBox* vsync;
SettingChoice* anisotropic_filtering;
wxStaticText* text_aamode;
SettingChoice* choice_aamode;
SettingCheckBox* native_mips;
SettingCheckBox* efb_scaled_copy;
SettingCheckBox* pixel_lighting;
SettingCheckBox* pixel_depth;
SettingCheckBox* force_filtering;
SettingCheckBox* _3d_vision;
wxChoice* choice_efbscale;
SettingCheckBox* efbaccess_enable;
SettingCheckBox* emulate_efb_format_changes;
SettingCheckBox* efbcopy_enable;
SettingRadioButton* efbcopy_texture;
SettingRadioButton* efbcopy_ram;
SettingCheckBox* cache_efb_copies;
SettingCheckBox* stc_enable;
wxRadioButton* stc_safe;
wxRadioButton* stc_normal;
wxRadioButton* stc_fast;
SettingCheckBox* wireframe;
SettingCheckBox* disable_lighting;
SettingCheckBox* disable_textures;
SettingCheckBox* disable_fog;
SettingCheckBox* disable_dst_alpha;
SettingCheckBox* show_fps;
SettingCheckBox* overlay_stats;
SettingCheckBox* overlay_proj_stats;
SettingCheckBox* texfmt_overlay;
SettingCheckBox* efb_copy_regions;
SettingCheckBox* show_shader_errors;
SettingCheckBox* show_input_display;
SettingCheckBox* enable_xfb;
SettingRadioButton* virtual_xfb;
SettingRadioButton* real_xfb;
SettingCheckBox* dump_textures;
SettingCheckBox* hires_textures;
SettingCheckBox* dump_efb;
SettingCheckBox* dump_frames;
SettingCheckBox* free_look;
SettingCheckBox* frame_dumps_via_ffv1;
SettingCheckBox* crop;
SettingCheckBox* opencl;
SettingCheckBox* dlcache;
SettingCheckBox* hotkeys;
SettingCheckBox* ompdecoder;
wxChoice* choice_ppshader;
// TODO: Add options for
//vconfig.bTexFmtOverlayCenter
//vconfig.bAnaglyphStereo
//vconfig.iAnaglyphStereoSeparation
//vconfig.iAnaglyphFocalAngle
//vconfig.bShowEFBCopyRegions
//vconfig.iCompileDLsLevel
VideoConfig vconfig;
std::string ininame;
int cur_profile;
const CGameListCtrl *GameListCtrl;
VideoConfig& vconfig;
};
#endif