Remove configuration profile support.

I.e. revert most of the video configuration dialog changes since r7483.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7484 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2011-04-25 20:06:45 +00:00
parent 8ca38ef7b2
commit a779b92a09
8 changed files with 385 additions and 1257 deletions
File diff suppressed because it is too large Load Diff
+58 -261
View File
@@ -16,207 +16,26 @@
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/spinctrl.h>
#include <wx/fontmap.h>
enum tmp_MemberClass {
Def_Data,
State
};
enum tmp_TypeClass {
only_2State,
allow_3State
};
struct _pattern
template <typename W>
class BoolSetting : public W
{
protected:
_pattern(bool *state, const tmp_TypeClass type);
bool *m_uistate;
const tmp_TypeClass _type;
public:
/*
Couldn't make this a pure abstract class since wxWidgets in use(v.2.8.x) is buggy;
oddly, CommandEventHandler fails to connect&retrieve the correct target function.
Newer wxWidgets versions don't have this problem...
*/
//virtual void UpdateValue(wxCommandEvent& ev) = 0;
//virtual void UpdateUIState(bool state) = 0;
//virtual void ChangeRefDataMember(tmp_MemberClass type, void *newRef) = 0;
BoolSetting(wxWindow* parent, const wxString& label, const wxString& tooltip, bool &setting, bool reverse = false, long style = 0);
tmp_TypeClass getTypeClass()
{
// This method returns what kind of support has the Object (2State or 3State).
// NOTE: this doesn't return a run-time Control-state, since a 3State Control
// can to switch to 2State and vice-versa, while an Object 2State only can't.
return _type;
}
};
class SettingCheckBox : public _pattern, public wxCheckBox
{
DECLARE_CLASS(SettingCheckBox)
public:
SettingCheckBox(wxWindow* parent, const wxString& label, const wxString& tooltip, bool &setting, bool reverse = false, long style = 0);
// overload constructor
SettingCheckBox(wxWindow* parent, const wxString& label, const wxString& tooltip, bool &setting, bool &def_setting, bool &state, bool reverse = false, long style = 0);
void UpdateValue(wxCommandEvent& ev)
{
if (_type == only_2State)
{
m_setting = (ev.GetInt() != 0) ^ m_reverse;
}
else
{
bool style = (this->GetWindowStyle() == (wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER));
if (style)
{
// changing state value should be done here, never outside this block
UpdateUIState(ev.GetInt() != wxCHK_UNDETERMINED);
}
m_setting = (ev.GetInt() == wxCHK_CHECKED);
if (m_uistate)
{
// if state = false and Checkbox ctrl allow 3RD STATE, then data = default_data
m_setting = (style && !*m_uistate) ? *d_setting : m_setting;
}
m_setting = m_setting ^ m_reverse;
if (!style && m_uistate) // this guarantees bidirectional access to default value
if (!*m_uistate) *d_setting = m_setting;
}
ev.Skip();
}
void UpdateUIState(bool state)
{
if (m_uistate && this->GetWindowStyle() == (wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER))
{
*m_uistate = state;
if (!*m_uistate)
m_setting = *d_setting ^ m_reverse;
}
}
void ChangeRefDataMember(tmp_MemberClass type, void *newRef)
{
switch (type)
{
case Def_Data:
d_setting = (bool*)newRef;
break;
case State:
m_uistate = (bool*)newRef;
break;
}
}
private:
bool &m_setting;
bool *d_setting;
const bool m_reverse;
};
template <typename V>
class SettingChoice : public _pattern, public wxChoice
{
DECLARE_CLASS(SettingChoice)
public:
SettingChoice(wxWindow* parent, V &setting, const wxString& tooltip, int num = 0, const wxString choices[] = NULL, long style = 0);
// overload constructor
SettingChoice(wxWindow* parent, V &setting, V &def_setting, bool &state, int &cur_index, const wxString& tooltip, int num = 0, const wxString choices[] = NULL, long style = 0);
void UpdateValue(wxCommandEvent& ev)
{
m_setting = ev.GetInt();
if (_type == allow_3State)
{
if (m_index != 0) // Choice ctrl with 3RD option
{
// changing state value should be done here, never outside this block
if (m_setting == 0)
{
UpdateUIState(false);
}
else
{
UpdateUIState(true);
m_setting -= 1;
}
}
else // Choice ctrl without 3RD option
{
if (m_uistate)
if (!*m_uistate) *d_setting = m_setting;
}
}
ev.Skip();
}
void UpdateUIState(bool state)
{
if (m_uistate && m_index != 0)
{
*m_uistate = state;
if (!*m_uistate)
m_setting = *d_setting;
}
}
void ChangeRefDataMember(tmp_MemberClass type, void *newRef)
{
switch (type)
{
case Def_Data:
d_setting = (V*)newRef;
break;
case State:
m_uistate = (bool*)newRef;
break;
}
}
private:
V &m_setting;
V *d_setting;
int &m_index;
};
typedef SettingChoice<int> IntSettingChoice;
typedef SettingChoice<std::string> StringSettingChoice;
class SettingRadioButton : public _pattern, public wxRadioButton
{
DECLARE_CLASS(SettingRadioButton)
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();
}
void UpdateUIState(bool state) {}
void ChangeRefDataMember(tmp_MemberClass type, void *newRef) {}
private:
bool &m_setting;
const bool m_reverse;
};
typedef BoolSetting<wxCheckBox> SettingCheckBox;
typedef BoolSetting<wxRadioButton> SettingRadioButton;
template <typename T>
class IntegerSetting : public wxSpinCtrl
{
@@ -234,7 +53,14 @@ private:
typedef IntegerSetting<u32> U32Setting;
class CGameListCtrl;
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;
};
class VideoConfigDiag : public wxDialog
{
@@ -245,106 +71,77 @@ protected:
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO: Query list of supported AA modes
void Event_Adapter(wxCommandEvent &ev) { ev.Skip(); } // TODO
void Event_StcSafe(wxCommandEvent &ev) { cur_vconfig.iSafeTextureCache_ColorSamples = 0; ev.Skip(); }
void Event_StcNormal(wxCommandEvent &ev) { cur_vconfig.iSafeTextureCache_ColorSamples = 512; ev.Skip(); }
void Event_StcFast(wxCommandEvent &ev) { cur_vconfig.iSafeTextureCache_ColorSamples = 128; ev.Skip(); }
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(); }
void Event_PPShader(wxCommandEvent &ev)
{
const int sel = ev.GetInt();
if (sel)
vconfig.sPostProcessingShader = ev.GetString().mb_str();
else
vconfig.sPostProcessingShader.clear();
ev.Skip();
}
void Event_ClickClose(wxCommandEvent&);
void Event_ClickDefault(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
void Event_OnProfileChange(wxCommandEvent& ev);
// Enables/disables UI elements depending on current config
void OnUpdateUI(wxUpdateUIEvent& ev)
{
// Anti-aliasing
choice_aamode->Enable(vconfig.backend_info.AAModes.size() > 1);
text_aamode->Enable(vconfig.backend_info.AAModes.size() > 1);
// Enables/disables UI elements depending on current config - if appropriate also updates g_Config
void OnUpdateUI(wxUpdateUIEvent& ev);
// pixel lighting
pixel_lighting->Enable(vconfig.backend_info.bSupportsPixelLighting);
// Refresh UI values from current config (used when reloading config)
void SetUIValuesFromConfig();
// 3D vision
_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
// Redraw the aspect about some UI controls when a profile is selected
void ChangeStyle();
// EFB copy
efbcopy_texture->Enable(vconfig.bEFBCopyEnable);
efbcopy_ram->Enable(vconfig.bEFBCopyEnable);
cache_efb_copies->Enable(vconfig.bEFBCopyEnable && !vconfig.bCopyEFBToTexture);
// Don't mess with keeping two comboboxes in sync, use only one CB instead..
SettingChoice<int>* profile_cb; // "General" tab
wxStaticText* profile_text; // "Advanced" tab
// EFB format change emulation
emulate_efb_format_changes->Enable(vconfig.backend_info.bSupportsFormatReinterpretation);
IntSettingChoice* choice_adapter;
IntSettingChoice* choice_aspect;
SettingCheckBox* widescreen_hack;
SettingCheckBox* vsync;
// ATC
stc_safe->Enable(vconfig.bSafeTextureCache);
stc_normal->Enable(vconfig.bSafeTextureCache);
stc_fast->Enable(vconfig.bSafeTextureCache);
// XFB
virtual_xfb->Enable(vconfig.bUseXFB);
real_xfb->Enable(vconfig.bUseXFB);
ev.Skip();
}
IntSettingChoice* anisotropic_filtering;
wxStaticText* text_aamode;
IntSettingChoice* choice_aamode;
SettingChoice* choice_aamode;
SettingCheckBox* native_mips;
SettingCheckBox* efb_scaled_copy;
SettingCheckBox* pixel_lighting;
SettingCheckBox* pixel_depth;
SettingCheckBox* force_filtering;
SettingCheckBox* _3d_vision;
IntSettingChoice* choice_efbscale;
SettingCheckBox* efbaccess_enable;
SettingCheckBox* emulate_efb_format_changes;
SettingCheckBox* efbcopy_enable;
SettingRadioButton* efbcopy_texture;
SettingRadioButton* efbcopy_ram;
SettingCheckBox* cache_efb_copies;
SettingCheckBox* emulate_efb_format_changes;
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;
StringSettingChoice* choice_ppshader;
wxButton* btn_default;
// TODO: Add options for
//cur_vconfig.bTexFmtOverlayCenter
//cur_vconfig.bAnaglyphStereo
//cur_vconfig.iAnaglyphStereoSeparation
//cur_vconfig.iAnaglyphFocalAngle
//cur_vconfig.bShowEFBCopyRegions
//cur_vconfig.iCompileDLsLevel
wxPoint CenterCoords;
VideoConfig cur_vconfig;
VideoConfig def_vconfig;
VideoConfig &vconfig;
std::string ininame;
int cur_profile;
int prev_profile;
const CGameListCtrl *GameListCtrl;
};
#endif
File diff suppressed because it is too large Load Diff
+6 -75
View File
@@ -61,17 +61,9 @@ class IniFile;
// NEVER inherit from this class.
struct VideoConfig
{
private:
// According to new structure-design this member MUST BE private
void GameIniLoad(const char *ini_file);
public:
VideoConfig();
// You can choose what "INI snapshot" you wish to load...
// GameIni is loaded over MainIni file only if 'fileCheck' argument is passed with success
void Load(const char *main_ini_file, bool fileCheck = false, const char *game_ini_file = "");
void Load(const char *ini_file);
void GameIniLoad(const char *ini_file);
void VerifyValidity();
void Save(const char *ini_file);
void GameIniSave(const char* default_ini, const char* game_ini);
@@ -85,7 +77,7 @@ public:
int iAspectRatio;
bool bCrop; // Aspect ratio controls.
bool bUseXFB;
bool bUseRealXFB; // joined to radio button
bool bUseRealXFB;
bool bUseNativeMips;
// OpenCL/OpenMP
@@ -117,7 +109,7 @@ public:
// Utility
bool bDumpTextures;
bool bHiresTextures;
bool bHiresTextures;
bool bDumpEFBTarget;
bool bDumpFrames;
bool bUseFFV1;
@@ -127,16 +119,15 @@ public:
int iAnaglyphFocalAngle;
bool b3DVision;
// Hacks
bool bEFBAccessEnable;
bool bDlistCachingEnable;
bool bDlistCachingEnable;
bool bEFBCopyEnable;
bool bEFBCopyCacheEnable;
bool bEFBEmulateFormatChanges;
bool bOSDHotKey;
bool bCopyEFBToTexture; // joined to radio button
bool bCopyEFBToTexture;
bool bCopyEFBScaled;
bool bSafeTextureCache;
int iSafeTextureCache_ColorSamples;
@@ -157,66 +148,6 @@ public:
// D3D only config, mostly to be merged into the above
int iAdapter;
// UI Controls state
struct
{
// IMPORTANT: each member inside this struct MUST HAVE same name corresponding to data member
bool bVSync;
bool bWidescreenHack;
bool iAspectRatio;
bool bCrop;
bool bUseXFB;
bool bUseRealXFB;
bool bUseNativeMips;
bool bEnableOpenCL;
bool iMultisampleMode;
bool iEFBScale;
bool bForceFiltering;
bool iMaxAnisotropy;
bool sPostProcessingShader;
bool bShowFPS;
bool bShowInputDisplay;
bool bOverlayStats;
bool bOverlayProjStats;
bool bTexFmtOverlayEnable;
bool bTexFmtOverlayCenter;
bool bShowEFBCopyRegions;
bool bWireFrame;
bool bDisableLighting;
bool bDisableTexturing;
bool bDstAlphaPass;
bool bDisableFog;
bool bDumpTextures;
bool bHiresTextures;
bool bDumpEFBTarget;
bool bDumpFrames;
bool bUseFFV1;
bool bFreeLook;
bool bAnaglyphStereo;
bool b3DVision;
bool iAnaglyphStereoSeparation;
bool iAnaglyphFocalAngle;
bool bEFBAccessEnable;
bool bOMPDecoder;
bool bDlistCachingEnable;
bool bEFBCopyEnable;
bool bCopyEFBToTexture;
bool bEFBCopyCacheEnable;
bool bEFBEmulateFormatChanges;
bool bOSDHotKey;
bool bCopyEFBScaled;
bool bSafeTextureCache;
bool iSafeTextureCache_ColorSamples;
bool bZTPSpeedHack;
bool bEnablePixelLighting;
bool bEnablePerPixelDepth;
bool iLog;
bool iSaveTargetId;
bool iCompileDLsLevel;
bool bShowShaderErrors;
bool iAdapter;
} UI_State;
// Static config per API
struct
{
+2 -3
View File
@@ -155,9 +155,8 @@ bool VideoBackend::Initialize(void *&window_handle)
frameCount = 0;
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str(), true,
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
UpdateActiveConfig();
+3 -3
View File
@@ -137,9 +137,9 @@ bool VideoBackend::Initialize(void *&window_handle)
frameCount = 0;
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str(), true,
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str());
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
UpdateActiveConfig();
+2 -2
View File
@@ -160,8 +160,8 @@ bool VideoBackend::Initialize(void *&window_handle)
frameCount = 0;
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str(), true,
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
g_Config.UpdateProjectionHack();
@@ -67,7 +67,7 @@ void VideoSoftware::ShowConfig(void *_hParent)
bool VideoSoftware::Initialize(void *&window_handle)
{
g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
if (!OpenGL_Create(window_handle))
{