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

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

View File

@ -45,88 +45,81 @@ VideoConfig::VideoConfig()
backend_info.bSupports3DVision = false;
}
void VideoConfig::Load(const char *main_ini_file, bool filecheck_passed, const char *game_ini_file)
void VideoConfig::Load(const char *ini_file)
{
std::string temp;
IniFile iniFile;
iniFile.Load(main_ini_file);
#define SET_STATE(evaluate, member) evaluate; UI_State.member = true;
SET_STATE(iniFile.Get("Hardware", "VSync", &bVSync, false), bVSync); // Hardware
SET_STATE(iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false), bWidescreenHack);
SET_STATE(iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO), iAspectRatio);
SET_STATE(iniFile.Get("Settings", "Crop", &bCrop, false), bCrop);
SET_STATE(iniFile.Get("Settings", "UseXFB", &bUseXFB, false), bUseXFB);
iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, false);
SET_STATE(iniFile.Get("Settings", "UseNativeMips", &bUseNativeMips, true), bUseNativeMips);
iniFile.Load(ini_file);
SET_STATE(iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false), bSafeTextureCache); // Settings
iniFile.Get("Hardware", "VSync", &bVSync, 0); // Hardware
iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false);
iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
iniFile.Get("Settings", "Crop", &bCrop, false);
iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0);
iniFile.Get("Settings", "UseNativeMips", &bUseNativeMips, true);
iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings
//Safe texture cache params
iniFile.Get("Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples, 512);
iniFile.Get("Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples,512);
SET_STATE(iniFile.Get("Settings", "ShowFPS", &bShowFPS, false), bShowFPS); // Settings
SET_STATE(iniFile.Get("Settings", "ShowInputDisplay", &bShowInputDisplay, false), bShowInputDisplay);
SET_STATE(iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false), bOverlayStats);
SET_STATE(iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false), bOverlayProjStats);
SET_STATE(iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false), bShowEFBCopyRegions);
SET_STATE(iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0), iCompileDLsLevel);
SET_STATE(iniFile.Get("Settings", "DumpTextures", &bDumpTextures, false), bDumpTextures);
SET_STATE(iniFile.Get("Settings", "HiresTextures", &bHiresTextures, false), bHiresTextures);
SET_STATE(iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, false), bDumpEFBTarget) ;
SET_STATE(iniFile.Get("Settings", "DumpFrames", &bDumpFrames, false), bDumpFrames);
SET_STATE(iniFile.Get("Settings", "FreeLook", &bFreeLook, false), bFreeLook);
SET_STATE(iniFile.Get("Settings", "UseFFV1", &bUseFFV1, false), bUseFFV1);
SET_STATE(iniFile.Get("Settings", "AnaglyphStereo", &bAnaglyphStereo, false), bAnaglyphStereo);
SET_STATE(iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200), iAnaglyphStereoSeparation);
SET_STATE(iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0), iAnaglyphFocalAngle);
SET_STATE(iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, false), bEnablePixelLighting);
SET_STATE(iniFile.Get("Settings", "EnablePerPixelDepth", &bEnablePerPixelDepth, false), bEnablePerPixelDepth);
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
iniFile.Get("Settings", "ShowInputDisplay", &bShowInputDisplay, false);
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false);
iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
iniFile.Get("Settings", "HiresTextures", &bHiresTextures, 0);
iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
iniFile.Get("Settings", "FreeLook", &bFreeLook, 0);
iniFile.Get("Settings", "UseFFV1", &bUseFFV1, 0);
iniFile.Get("Settings", "AnaglyphStereo", &bAnaglyphStereo, false);
iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200);
iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0);
iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, 0);
iniFile.Get("Settings", "EnablePerPixelDepth", &bEnablePerPixelDepth, 0);
SET_STATE(iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, false), bShowShaderErrors);
SET_STATE(iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0), iMultisampleMode);
SET_STATE(iniFile.Get("Settings", "EFBScale", &iEFBScale, 1), iEFBScale); // integral
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
iniFile.Get("Settings", "EFBScale", &iEFBScale, 1); // integral
SET_STATE(iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false), bDstAlphaPass);
iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
SET_STATE(iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, false), bTexFmtOverlayEnable);
SET_STATE(iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, false), bTexFmtOverlayCenter);
SET_STATE(iniFile.Get("Settings", "WireFrame", &bWireFrame, false), bWireFrame);
SET_STATE(iniFile.Get("Settings", "DisableLighting", &bDisableLighting, false), bDisableLighting);
SET_STATE(iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, false), bDisableTexturing);
SET_STATE(iniFile.Get("Settings", "DisableFog", &bDisableFog, false), bDisableFog);
iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
iniFile.Get("Settings", "WireFrame", &bWireFrame, 0);
iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0);
iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0);
iniFile.Get("Settings", "DisableFog", &bDisableFog, 0);
SET_STATE(iniFile.Get("Settings", "EnableOpenCL", &bEnableOpenCL, false), bEnableOpenCL);
#ifdef _OPENMP
SET_STATE(iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false), bOMPDecoder);
#endif
iniFile.Get("Settings", "EnableOpenCL", &bEnableOpenCL, false);
iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false);
SET_STATE(iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, false), bForceFiltering);
SET_STATE(iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 0), iMaxAnisotropy); // NOTE - this is x in (1 << x)
SET_STATE(iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, ""), sPostProcessingShader);
SET_STATE(iniFile.Get("Enhancements", "Enable3dVision", &b3DVision, false), b3DVision);
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 0); // NOTE - this is x in (1 << x)
iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
iniFile.Get("Enhancements", "Enable3dVision", &b3DVision, false);
SET_STATE(iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true), bEFBAccessEnable);
SET_STATE(iniFile.Get("Hacks", "DlistCachingEnable", &bDlistCachingEnable,false), bDlistCachingEnable);
SET_STATE(iniFile.Get("Hacks", "EFBCopyEnable", &bEFBCopyEnable, true), bEFBCopyEnable);
SET_STATE(iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, false), bOSDHotKey);
iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
iniFile.Get("Hacks", "DlistCachingEnable", &bDlistCachingEnable,false);
iniFile.Get("Hacks", "EFBCopyEnable", &bEFBCopyEnable, true);
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, false);
SET_STATE(iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true), bCopyEFBScaled);
SET_STATE(iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false), bEFBCopyCacheEnable);
SET_STATE(iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, true), bEFBEmulateFormatChanges);
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false);
iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, true);
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
if (iAdapter == -1)
iAdapter = 0;
SET_STATE((void)true, iAdapter);
VerifyValidity();
// Load common settings
iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
bool bTmp;
iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
SetEnableAlert(bTmp);
if (filecheck_passed)
GameIniLoad(game_ini_file);
}
void VideoConfig::GameIniLoad(const char *ini_file)
@ -134,102 +127,92 @@ void VideoConfig::GameIniLoad(const char *ini_file)
IniFile iniFile;
iniFile.Load(ini_file);
#define SET_UISTATE(check, member) UI_State.member = (check) ? true : false
iniFile.GetIfExists("Video_Hardware", "VSync", &bVSync);
iniFile.GetIfExists("Video_Settings", "wideScreenHack", &bWidescreenHack);
iniFile.GetIfExists("Video_Settings", "AspectRatio", &iAspectRatio);
iniFile.GetIfExists("Video_Settings", "Crop", &bCrop);
iniFile.GetIfExists("Video_Settings", "UseXFB", &bUseXFB);
iniFile.GetIfExists("Video_Settings", "UseRealXFB", &bUseRealXFB);
iniFile.GetIfExists("Video_Settings", "UseNativeMips", &bUseNativeMips);
SET_UISTATE(iniFile.GetIfExists("Video_Hardware", "VSync", &bVSync), bVSync);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "wideScreenHack", &bWidescreenHack), bWidescreenHack);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "AspectRatio", &iAspectRatio), iAspectRatio);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "Crop", &bCrop), bCrop);
{ // CheckBox+RadioButtons group
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "UseXFB", &bUseXFB), bUseXFB);
if (UI_State.bUseXFB)
iniFile.GetIfExists("Video_Settings", "UseRealXFB", &bUseRealXFB);
}
{ // CheckBox+RadioButtons group
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "SafeTextureCache", &bSafeTextureCache), bSafeTextureCache);
if (UI_State.bSafeTextureCache)
iniFile.GetIfExists("Video_Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples);
}
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "UseNativeMips", &bUseNativeMips), bUseNativeMips);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "ShowFPS", &bShowFPS), bShowFPS);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "ShowInputDisplay", &bShowInputDisplay), bShowInputDisplay);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "OverlayStats", &bOverlayStats), bOverlayStats);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "OverlayProjStats", &bOverlayProjStats), bOverlayProjStats);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions), bShowEFBCopyRegions);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DLOptimize", &iCompileDLsLevel), iCompileDLsLevel);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DumpTextures", &bDumpTextures), bDumpTextures);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "HiresTextures", &bHiresTextures), bHiresTextures);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DumpEFBTarget", &bDumpEFBTarget), bDumpEFBTarget);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DumpFrames", &bDumpFrames), bDumpFrames);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "FreeLook", &bFreeLook), bFreeLook);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "UseFFV1", &bUseFFV1), bUseFFV1);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "AnaglyphStereo", &bAnaglyphStereo), bAnaglyphStereo);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation), iAnaglyphStereoSeparation);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle), iAnaglyphFocalAngle);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "EnablePixelLighting", &bEnablePixelLighting), bEnablePixelLighting);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "EnablePerPixelDepth", &bEnablePerPixelDepth), bEnablePerPixelDepth);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "ShowShaderErrors", &bShowShaderErrors), bShowShaderErrors);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "MSAA", &iMultisampleMode), iMultisampleMode);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "EFBScale", &iEFBScale), iEFBScale); // integral
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DstAlphaPass", &bDstAlphaPass), bDstAlphaPass);
iniFile.GetIfExists("Video_Settings", "SafeTextureCache", &bSafeTextureCache);
iniFile.GetIfExists("Video_Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable), bTexFmtOverlayEnable);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter), bTexFmtOverlayCenter);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "WireFrame", &bWireFrame), bWireFrame);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DisableLighting", &bDisableLighting), bDisableLighting);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DisableTexturing", &bDisableTexturing), bDisableTexturing);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "DisableFog", &bDisableFog), bDisableFog);
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "EnableOpenCL", &bEnableOpenCL), bEnableOpenCL);
#ifdef _OPENMP
SET_UISTATE(iniFile.GetIfExists("Video_Settings", "OMPDecoder", &bOMPDecoder), bOMPDecoder);
#endif
SET_UISTATE(iniFile.GetIfExists("Video_Enhancements", "ForceFiltering", &bForceFiltering), bForceFiltering);
SET_UISTATE(iniFile.GetIfExists("Video_Enhancements", "MaxAnisotropy", &iMaxAnisotropy), iMaxAnisotropy); // NOTE - this is x in (1 << x)
{
SET_UISTATE(iniFile.GetIfExists("Video_Enhancements", "PostProcessingShader", &sPostProcessingShader), sPostProcessingShader);
sPostProcessingShader = (sPostProcessingShader == "off") ? "" : sPostProcessingShader;
}
SET_UISTATE(iniFile.GetIfExists("Video_Enhancements", "Enable3dVision", &b3DVision), b3DVision);
iniFile.GetIfExists("Video_Settings", "ShowFPS", &bShowFPS);
iniFile.GetIfExists("Video_Settings", "ShowInputDisplay", &bShowInputDisplay);
iniFile.GetIfExists("Video_Settings", "OverlayStats", &bOverlayStats);
iniFile.GetIfExists("Video_Settings", "OverlayProjStats", &bOverlayProjStats);
iniFile.GetIfExists("Video_Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions);
iniFile.GetIfExists("Video_Settings", "DLOptimize", &iCompileDLsLevel);
iniFile.GetIfExists("Video_Settings", "DumpTextures", &bDumpTextures);
iniFile.GetIfExists("Video_Settings", "HiresTextures", &bHiresTextures);
iniFile.GetIfExists("Video_Settings", "DumpEFBTarget", &bDumpEFBTarget);
iniFile.GetIfExists("Video_Settings", "DumpFrames", &bDumpFrames);
iniFile.GetIfExists("Video_Settings", "FreeLook", &bFreeLook);
iniFile.GetIfExists("Video_Settings", "UseFFV1", &bUseFFV1);
iniFile.GetIfExists("Video_Settings", "AnaglyphStereo", &bAnaglyphStereo);
iniFile.GetIfExists("Video_Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation);
iniFile.GetIfExists("Video_Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle);
iniFile.GetIfExists("Video_Settings", "EnablePixelLighting", &bEnablePixelLighting);
iniFile.GetIfExists("Video_Settings", "EnablePerPixelDepth", &bEnablePerPixelDepth);
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBAccessEnable", &bEFBAccessEnable), bEFBAccessEnable);
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "DlistCachingEnable", &bDlistCachingEnable), bDlistCachingEnable);
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBCopyDisableHotKey", &bOSDHotKey), bOSDHotKey);
{ // CheckBox+RadioButtons group
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBCopyEnable", &bEFBCopyEnable), bEFBCopyEnable);
if (UI_State.bEFBCopyEnable)
iniFile.GetIfExists("Video_Hacks", "EFBToTextureEnable", &bCopyEFBToTexture);
iniFile.GetIfExists("Video_Settings", "ShowShaderErrors", &bShowShaderErrors);
iniFile.GetIfExists("Video_Settings", "MSAA", &iMultisampleMode);
iniFile.GetIfExists("Video_Settings", "EFBScale", &iEFBScale); // integral
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable), bEFBCopyCacheEnable);
}
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBScaledCopy", &bCopyEFBScaled), bCopyEFBScaled);
SET_UISTATE(iniFile.GetIfExists("Video_Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges), bEFBEmulateFormatChanges);
iniFile.GetIfExists("Video_Settings", "DstAlphaPass", &bDstAlphaPass);
SET_UISTATE(iniFile.GetIfExists("Video_Hardware", "Adapter", &iAdapter), iAdapter);
iniFile.GetIfExists("Video_Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable);
iniFile.GetIfExists("Video_Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter);
iniFile.GetIfExists("Video_Settings", "WireFrame", &bWireFrame);
iniFile.GetIfExists("Video_Settings", "DisableLighting", &bDisableLighting);
iniFile.GetIfExists("Video_Settings", "DisableTexturing", &bDisableTexturing);
iniFile.GetIfExists("Video_Settings", "DisableFog", &bDisableFog);
iniFile.GetIfExists("Video_Settings", "EnableOpenCL", &bEnableOpenCL);
iniFile.GetIfExists("Video_Settings", "OMPDecoder", &bOMPDecoder);
iniFile.GetIfExists("Video_Enhancements", "ForceFiltering", &bForceFiltering);
iniFile.GetIfExists("Video_Enhancements", "MaxAnisotropy", &iMaxAnisotropy); // NOTE - this is x in (1 << x)
iniFile.GetIfExists("Video_Enhancements", "PostProcessingShader", &sPostProcessingShader);
iniFile.GetIfExists("Video_Enhancements", "Enable3dVision", &b3DVision);
iniFile.GetIfExists("Video_Hacks", "EFBAccessEnable", &bEFBAccessEnable);
iniFile.GetIfExists("Video_Hacks", "DlistCachingEnable", &bDlistCachingEnable);
iniFile.GetIfExists("Video_Hacks", "EFBCopyEnable", &bEFBCopyEnable);
iniFile.GetIfExists("Video_Hacks", "EFBCopyDisableHotKey", &bOSDHotKey);
iniFile.GetIfExists("Video_Hacks", "EFBToTextureEnable", &bCopyEFBToTexture);
iniFile.GetIfExists("Video_Hacks", "EFBScaledCopy", &bCopyEFBScaled);
iniFile.GetIfExists("Video_Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable);
iniFile.GetIfExists("Video_Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges);
iniFile.GetIfExists("Video_Hardware", "Adapter", &iAdapter);
iniFile.GetIfExists("Video", "ForceFiltering", &bForceFiltering);
iniFile.GetIfExists("Video", "MaxAnisotropy", &iMaxAnisotropy); // NOTE - this is x in (1 << x)
iniFile.GetIfExists("Video", "EFBCopyEnable", &bEFBCopyEnable);
iniFile.GetIfExists("Video", "EFBCopyDisableHotKey", &bOSDHotKey);
iniFile.GetIfExists("Video", "EFBAccessEnable", &bEFBAccessEnable);
iniFile.GetIfExists("Video", "EFBToTextureEnable", &bCopyEFBToTexture);
iniFile.GetIfExists("Video", "EFBScaledCopy", &bCopyEFBScaled);
iniFile.GetIfExists("Video", "SafeTextureCache", &bSafeTextureCache);
iniFile.GetIfExists("Video", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples);
iniFile.GetIfExists("Video", "MSAA", &iMultisampleMode);
iniFile.GetIfExists("Video", "EFBScale", &iEFBScale);
iniFile.GetIfExists("Video", "DstAlphaPass", &bDstAlphaPass);
iniFile.GetIfExists("Video", "UseXFB", &bUseXFB);
iniFile.GetIfExists("Video", "UseRealXFB", &bUseRealXFB);
iniFile.GetIfExists("Video", "ProjectionHack", &iPhackvalue[0]);
iniFile.GetIfExists("Video", "PH_SZNear", &iPhackvalue[1]);
iniFile.GetIfExists("Video", "PH_SZFar", &iPhackvalue[2]);
iniFile.GetIfExists("Video", "PH_ExtraParam", &iPhackvalue[3]);
iniFile.GetIfExists("Video", "PH_ZNear", &sPhackvalue[0]);
iniFile.GetIfExists("Video", "PH_ZFar", &sPhackvalue[1]);
SET_UISTATE(iniFile.GetIfExists("Video", "ZTPSpeedupHack", &bZTPSpeedHack), bZTPSpeedHack);
iniFile.GetIfExists("Video", "UseNativeMips", &bUseNativeMips);
iniFile.GetIfExists("Video", "ZTPSpeedupHack", &bZTPSpeedHack);
iniFile.GetIfExists("Video", "DlistCachingEnable", &bDlistCachingEnable);
VerifyValidity();
}
@ -237,7 +220,7 @@ void VideoConfig::GameIniLoad(const char *ini_file)
void VideoConfig::VerifyValidity()
{
// TODO: Check iMaxAnisotropy value
if (iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0;
if (!backend_info.bSupports3DVision) b3DVision = false;
if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false;
@ -248,7 +231,6 @@ void VideoConfig::Save(const char *ini_file)
{
IniFile iniFile;
iniFile.Load(ini_file);
iniFile.Set("Hardware", "VSync", bVSync);
iniFile.Set("Settings", "AspectRatio", iAspectRatio);
iniFile.Set("Settings", "Crop", bCrop);
@ -286,16 +268,14 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Set("Settings", "EFBScale", iEFBScale);
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
iniFile.Set("Settings", "WireFrame", bWireFrame);
iniFile.Set("Settings", "Wireframe", bWireFrame);
iniFile.Set("Settings", "DisableLighting", bDisableLighting);
iniFile.Set("Settings", "DisableTexturing", bDisableTexturing);
iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass);
iniFile.Set("Settings", "DisableFog", bDisableFog);
iniFile.Set("Settings", "EnableOpenCL", bEnableOpenCL);
#ifdef _OPENMP
iniFile.Set("Settings", "OMPDecoder", bOMPDecoder);
#endif
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy);
@ -318,94 +298,80 @@ void VideoConfig::Save(const char *ini_file)
void VideoConfig::GameIniSave(const char* default_ini, const char* game_ini)
{
// wxWidgets doesn't provide us with a nice way to change 3-state checkboxes into 2-state ones
// This would allow us to make the "default config" dialog layout to be 2-state based, but the
// "game config" layout to be 3-state based (with the 3rd state being "use default")
// Since we can't do that, we instead just save anything which differs from the default config
// TODO: Make this less ugly
VideoConfig defCfg;
defCfg.Load(default_ini);
IniFile iniFile;
iniFile.Load(game_ini);
#define CHECK_UISTATE(section, key, member){\
if (UI_State.member) iniFile.Set((section), (key), (member)); else iniFile.DeleteKey((section), (key)); }
#define SET_IF_DIFFERS(section, key, member) { if ((member) != (defCfg.member)) iniFile.Set((section), (key), (member)); else iniFile.DeleteKey((section), (key)); }
CHECK_UISTATE("Video_Hardware", "VSync", bVSync);
CHECK_UISTATE("Video_Settings", "wideScreenHack", bWidescreenHack);
CHECK_UISTATE("Video_Settings", "AspectRatio", iAspectRatio);
CHECK_UISTATE("Video_Settings", "Crop", bCrop);
SET_IF_DIFFERS("Video_Hardware", "VSync", bVSync);
SET_IF_DIFFERS("Video_Settings", "wideScreenHack", bWidescreenHack);
SET_IF_DIFFERS("Video_Settings", "AspectRatio", iAspectRatio);
SET_IF_DIFFERS("Video_Settings", "Crop", bCrop);
SET_IF_DIFFERS("Video_Settings", "UseXFB", bUseXFB);
SET_IF_DIFFERS("Video_Settings", "UseRealXFB", bUseRealXFB);
SET_IF_DIFFERS("Video_Settings", "UseNativeMips", bUseNativeMips);
{ // CheckBox+RadioButtons group
CHECK_UISTATE("Video_Settings", "UseXFB", bUseXFB);
UI_State.bUseRealXFB = UI_State.bUseXFB;
CHECK_UISTATE("Video_Settings", "UseRealXFB", bUseRealXFB);
}
SET_IF_DIFFERS("Video_Settings", "SafeTextureCache", bSafeTextureCache);
SET_IF_DIFFERS("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
CHECK_UISTATE("Video_Settings", "UseNativeMips", bUseNativeMips);
{ // CheckBox+RadioButtons group
CHECK_UISTATE("Video_Settings", "SafeTextureCache", bSafeTextureCache);
UI_State.iSafeTextureCache_ColorSamples = UI_State.bSafeTextureCache;
CHECK_UISTATE("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
}
SET_IF_DIFFERS("Video_Settings", "ShowFPS", bShowFPS);
SET_IF_DIFFERS("Video_Settings", "ShowInputDisplay", bShowInputDisplay);
SET_IF_DIFFERS("Video_Settings", "OverlayStats", bOverlayStats);
SET_IF_DIFFERS("Video_Settings", "OverlayProjStats", bOverlayProjStats);
SET_IF_DIFFERS("Video_Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
SET_IF_DIFFERS("Video_Settings", "DLOptimize", iCompileDLsLevel);
SET_IF_DIFFERS("Video_Settings", "DumpTextures", bDumpTextures);
SET_IF_DIFFERS("Video_Settings", "HiresTextures", bHiresTextures);
SET_IF_DIFFERS("Video_Settings", "DumpEFBTarget", bDumpEFBTarget);
SET_IF_DIFFERS("Video_Settings", "DumpFrames", bDumpFrames);
SET_IF_DIFFERS("Video_Settings", "FreeLook", bFreeLook);
SET_IF_DIFFERS("Video_Settings", "UseFFV1", bUseFFV1);
SET_IF_DIFFERS("Video_Settings", "AnaglyphStereo", bAnaglyphStereo);
SET_IF_DIFFERS("Video_Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
SET_IF_DIFFERS("Video_Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
SET_IF_DIFFERS("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
SET_IF_DIFFERS("Video_Settings", "EnablePerPixelDepth", bEnablePerPixelDepth);
CHECK_UISTATE("Video_Settings", "ShowFPS", bShowFPS);
CHECK_UISTATE("Video_Settings", "ShowInputDisplay", bShowInputDisplay);
CHECK_UISTATE("Video_Settings", "OverlayStats", bOverlayStats);
CHECK_UISTATE("Video_Settings", "OverlayProjStats", bOverlayProjStats);
CHECK_UISTATE("Video_Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
CHECK_UISTATE("Video_Settings", "DLOptimize", iCompileDLsLevel);
CHECK_UISTATE("Video_Settings", "DumpTextures", bDumpTextures);
CHECK_UISTATE("Video_Settings", "HiresTextures", bHiresTextures);
CHECK_UISTATE("Video_Settings", "DumpEFBTarget", bDumpEFBTarget);
CHECK_UISTATE("Video_Settings", "DumpFrames", bDumpFrames);
CHECK_UISTATE("Video_Settings", "FreeLook", bFreeLook);
CHECK_UISTATE("Video_Settings", "UseFFV1", bUseFFV1);
CHECK_UISTATE("Video_Settings", "AnaglyphStereo", bAnaglyphStereo);
CHECK_UISTATE("Video_Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
CHECK_UISTATE("Video_Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
CHECK_UISTATE("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
CHECK_UISTATE("Video_Settings", "EnablePerPixelDepth", bEnablePerPixelDepth);
SET_IF_DIFFERS("Video_Settings", "ShowShaderErrors", bShowShaderErrors);
SET_IF_DIFFERS("Video_Settings", "MSAA", iMultisampleMode);
SET_IF_DIFFERS("Video_Settings", "EFBScale", iEFBScale); // integral
CHECK_UISTATE("Video_Settings", "ShowShaderErrors", bShowShaderErrors);
CHECK_UISTATE("Video_Settings", "MSAA", iMultisampleMode);
CHECK_UISTATE("Video_Settings", "EFBScale", iEFBScale); // integral
SET_IF_DIFFERS("Video_Settings", "DstAlphaPass", bDstAlphaPass);
CHECK_UISTATE("Video_Settings", "DstAlphaPass", bDstAlphaPass);
SET_IF_DIFFERS("Video_Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
SET_IF_DIFFERS("Video_Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
SET_IF_DIFFERS("Video_Settings", "WireFrame", bWireFrame);
SET_IF_DIFFERS("Video_Settings", "DisableLighting", bDisableLighting);
SET_IF_DIFFERS("Video_Settings", "DisableTexturing", bDisableTexturing);
SET_IF_DIFFERS("Video_Settings", "DisableFog", bDisableFog);
CHECK_UISTATE("Video_Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
CHECK_UISTATE("Video_Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
CHECK_UISTATE("Video_Settings", "WireFrame", bWireFrame);
CHECK_UISTATE("Video_Settings", "DisableLighting", bDisableLighting);
CHECK_UISTATE("Video_Settings", "DisableTexturing", bDisableTexturing);
CHECK_UISTATE("Video_Settings", "DisableFog", bDisableFog);
SET_IF_DIFFERS("Video_Settings", "EnableOpenCL", bEnableOpenCL);
SET_IF_DIFFERS("Video_Settings", "OMPDecoder", bOMPDecoder);
CHECK_UISTATE("Video_Settings", "EnableOpenCL", bEnableOpenCL);
#ifdef _OPENMP
CHECK_UISTATE("Video_Settings", "OMPDecoder", bOMPDecoder);
#endif
SET_IF_DIFFERS("Video_Enhancements", "ForceFiltering", bForceFiltering);
SET_IF_DIFFERS("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
SET_IF_DIFFERS("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
SET_IF_DIFFERS("Video_Enhancements", "Enable3dVision", b3DVision);
CHECK_UISTATE("Video_Enhancements", "ForceFiltering", bForceFiltering);
CHECK_UISTATE("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
{
sPostProcessingShader = (UI_State.sPostProcessingShader && sPostProcessingShader.empty()) ? "off" : sPostProcessingShader;
CHECK_UISTATE("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
}
CHECK_UISTATE("Video_Enhancements", "Enable3dVision", b3DVision);
SET_IF_DIFFERS("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
SET_IF_DIFFERS("Video_Hacks", "DlistCachingEnable", bDlistCachingEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
SET_IF_DIFFERS("Video_Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
SET_IF_DIFFERS("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
CHECK_UISTATE("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
CHECK_UISTATE("Video_Hacks", "DlistCachingEnable", bDlistCachingEnable);
CHECK_UISTATE("Video_Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
{ // CheckBox+RadioButtons group
CHECK_UISTATE("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable);
UI_State.bCopyEFBToTexture = UI_State.bEFBCopyEnable;
CHECK_UISTATE("Video_Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
CHECK_UISTATE("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
}
CHECK_UISTATE("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
CHECK_UISTATE("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
CHECK_UISTATE("Video_Hardware", "Adapter", iAdapter);
SET_IF_DIFFERS("Video_Hardware", "Adapter", iAdapter);
iniFile.Save(game_ini);
}

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
{

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();

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();

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();

View File

@ -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))
{