mirror of https://github.com/PCSX2/pcsx2.git
Minor refactoring; doing this just to help minimize the changelog spam of the next commit (not that it'll help much)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3600 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
70e8c3cf41
commit
c439d1bef2
|
@ -81,16 +81,16 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// IniScopedGroup
|
// ScopedIniGroup
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
class IniScopedGroup
|
class ScopedIniGroup
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
IniInterface& m_mom;
|
IniInterface& m_mom;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IniScopedGroup( IniInterface& mommy, const wxString& group );
|
ScopedIniGroup( IniInterface& mommy, const wxString& group );
|
||||||
virtual ~IniScopedGroup();
|
virtual ~ScopedIniGroup();
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -38,14 +38,14 @@ static int _calcEnumLength( const wxChar* const* enumArray )
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
IniScopedGroup::IniScopedGroup( IniInterface& mommy, const wxString& group )
|
ScopedIniGroup::ScopedIniGroup( IniInterface& mommy, const wxString& group )
|
||||||
: m_mom( mommy )
|
: m_mom( mommy )
|
||||||
{
|
{
|
||||||
pxAssertDev( wxStringTokenize( group, L"/" ).Count() <= 1, L"Cannot nest more than one group deep per instance of IniScopedGroup." );
|
pxAssertDev( wxStringTokenize( group, L"/" ).Count() <= 1, L"Cannot nest more than one group deep per instance of ScopedIniGroup." );
|
||||||
m_mom.SetPath( group );
|
m_mom.SetPath( group );
|
||||||
}
|
}
|
||||||
|
|
||||||
IniScopedGroup::~IniScopedGroup()
|
ScopedIniGroup::~ScopedIniGroup()
|
||||||
{
|
{
|
||||||
m_mom.SetPath( L".." );
|
m_mom.SetPath( L".." );
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ void wxDialogWithHelpers::SmartCenterFit()
|
||||||
wxRect screenRect( GetScreenRect() );
|
wxRect screenRect( GetScreenRect() );
|
||||||
|
|
||||||
IniLoader loader( cfg );
|
IniLoader loader( cfg );
|
||||||
IniScopedGroup group( loader, L"DialogPositions" );
|
ScopedIniGroup group( loader, L"DialogPositions" );
|
||||||
cfg->SetRecordDefaults( false );
|
cfg->SetRecordDefaults( false );
|
||||||
|
|
||||||
if( GetWindowStyle() & wxRESIZE_BORDER )
|
if( GetWindowStyle() & wxRESIZE_BORDER )
|
||||||
|
@ -289,7 +289,7 @@ void wxDialogWithHelpers::OnCloseWindow( wxCloseEvent& evt )
|
||||||
{
|
{
|
||||||
wxPoint pos( screenRect.GetPosition() );
|
wxPoint pos( screenRect.GetPosition() );
|
||||||
IniSaver saver( cfg );
|
IniSaver saver( cfg );
|
||||||
IniScopedGroup group( saver, L"DialogPositions" );
|
ScopedIniGroup group( saver, L"DialogPositions" );
|
||||||
|
|
||||||
if( GetWindowStyle() & wxRESIZE_BORDER )
|
if( GetWindowStyle() & wxRESIZE_BORDER )
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
void TraceLogFilters::LoadSave( IniInterface& ini )
|
void TraceLogFilters::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
TraceLogFilters defaults;
|
TraceLogFilters defaults;
|
||||||
IniScopedGroup path( ini, L"TraceLog" );
|
ScopedIniGroup path( ini, L"TraceLog" );
|
||||||
|
|
||||||
IniEntry( Enabled );
|
IniEntry( Enabled );
|
||||||
IniEntry( SIF );
|
IniEntry( SIF );
|
||||||
|
@ -55,7 +55,7 @@ ConsoleLogFilters::ConsoleLogFilters()
|
||||||
void ConsoleLogFilters::LoadSave( IniInterface& ini )
|
void ConsoleLogFilters::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
ConsoleLogFilters defaults;
|
ConsoleLogFilters defaults;
|
||||||
IniScopedGroup path( ini, L"ConsoleLog" );
|
ScopedIniGroup path( ini, L"ConsoleLog" );
|
||||||
|
|
||||||
IniBitBool( ELF );
|
IniBitBool( ELF );
|
||||||
IniBitBool( StdoutEE );
|
IniBitBool( StdoutEE );
|
||||||
|
@ -66,7 +66,7 @@ void ConsoleLogFilters::LoadSave( IniInterface& ini )
|
||||||
void Pcsx2Config::SpeedhackOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::SpeedhackOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
SpeedhackOptions defaults;
|
SpeedhackOptions defaults;
|
||||||
IniScopedGroup path( ini, L"Speedhacks" );
|
ScopedIniGroup path( ini, L"Speedhacks" );
|
||||||
|
|
||||||
IniBitfield( EECycleRate );
|
IniBitfield( EECycleRate );
|
||||||
IniBitfield( VUCycleSteal );
|
IniBitfield( VUCycleSteal );
|
||||||
|
@ -81,7 +81,7 @@ void Pcsx2Config::SpeedhackOptions::LoadSave( IniInterface& ini )
|
||||||
void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
ProfilerOptions defaults;
|
ProfilerOptions defaults;
|
||||||
IniScopedGroup path( ini, L"Profiler" );
|
ScopedIniGroup path( ini, L"Profiler" );
|
||||||
|
|
||||||
IniBitBool( Enabled );
|
IniBitBool( Enabled );
|
||||||
IniBitBool( RecBlocks_EE );
|
IniBitBool( RecBlocks_EE );
|
||||||
|
@ -154,7 +154,7 @@ void Pcsx2Config::RecompilerOptions::ApplySanityCheck()
|
||||||
void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
RecompilerOptions defaults;
|
RecompilerOptions defaults;
|
||||||
IniScopedGroup path( ini, L"Recompiler" );
|
ScopedIniGroup path( ini, L"Recompiler" );
|
||||||
|
|
||||||
IniBitBool( EnableEE );
|
IniBitBool( EnableEE );
|
||||||
IniBitBool( EnableIOP );
|
IniBitBool( EnableIOP );
|
||||||
|
@ -195,7 +195,7 @@ void Pcsx2Config::CpuOptions::ApplySanityCheck()
|
||||||
void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
CpuOptions defaults;
|
CpuOptions defaults;
|
||||||
IniScopedGroup path( ini, L"CPU" );
|
ScopedIniGroup path( ini, L"CPU" );
|
||||||
|
|
||||||
IniBitBoolEx( sseMXCSR.DenormalsAreZero, "FPU.DenormalsAreZero" );
|
IniBitBoolEx( sseMXCSR.DenormalsAreZero, "FPU.DenormalsAreZero" );
|
||||||
IniBitBoolEx( sseMXCSR.FlushToZero, "FPU.FlushToZero" );
|
IniBitBoolEx( sseMXCSR.FlushToZero, "FPU.FlushToZero" );
|
||||||
|
@ -231,7 +231,7 @@ Pcsx2Config::GSOptions::GSOptions()
|
||||||
void Pcsx2Config::GSOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::GSOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
GSOptions defaults;
|
GSOptions defaults;
|
||||||
IniScopedGroup path( ini, L"GS" );
|
ScopedIniGroup path( ini, L"GS" );
|
||||||
|
|
||||||
IniEntry( SynchronousMTGS );
|
IniEntry( SynchronousMTGS );
|
||||||
IniEntry( DisableOutput );
|
IniEntry( DisableOutput );
|
||||||
|
@ -337,7 +337,7 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
|
||||||
void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
|
void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
GamefixOptions defaults;
|
GamefixOptions defaults;
|
||||||
IniScopedGroup path( ini, L"Gamefixes" );
|
ScopedIniGroup path( ini, L"Gamefixes" );
|
||||||
|
|
||||||
IniBitBool( VuAddSubHack );
|
IniBitBool( VuAddSubHack );
|
||||||
IniBitBool( VuClipFlagHack );
|
IniBitBool( VuClipFlagHack );
|
||||||
|
@ -360,7 +360,7 @@ Pcsx2Config::Pcsx2Config()
|
||||||
void Pcsx2Config::LoadSave( IniInterface& ini )
|
void Pcsx2Config::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
Pcsx2Config defaults;
|
Pcsx2Config defaults;
|
||||||
IniScopedGroup path( ini, L"EmuCore" );
|
ScopedIniGroup path( ini, L"EmuCore" );
|
||||||
|
|
||||||
IniBitBool( CdvdVerboseReads );
|
IniBitBool( CdvdVerboseReads );
|
||||||
IniBitBool( CdvdDumpBlocks );
|
IniBitBool( CdvdDumpBlocks );
|
||||||
|
|
|
@ -408,7 +408,7 @@ AppConfig::AppConfig()
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void AppConfig::LoadSaveUserMode( IniInterface& ini, const wxString& cwdhash )
|
void AppConfig::LoadSaveUserMode( IniInterface& ini, const wxString& cwdhash )
|
||||||
{
|
{
|
||||||
IniScopedGroup path( ini, cwdhash );
|
ScopedIniGroup path( ini, cwdhash );
|
||||||
|
|
||||||
// timestamping would be useful if we want to auto-purge unused entries after
|
// timestamping would be useful if we want to auto-purge unused entries after
|
||||||
// a period of time. Dunno if it's needed.
|
// a period of time. Dunno if it's needed.
|
||||||
|
@ -455,7 +455,7 @@ void AppConfig::LoadSaveUserMode( IniInterface& ini, const wxString& cwdhash )
|
||||||
void AppConfig::LoadSaveMemcards( IniInterface& ini )
|
void AppConfig::LoadSaveMemcards( IniInterface& ini )
|
||||||
{
|
{
|
||||||
AppConfig defaults;
|
AppConfig defaults;
|
||||||
IniScopedGroup path( ini, L"MemoryCards" );
|
ScopedIniGroup path( ini, L"MemoryCards" );
|
||||||
|
|
||||||
for( uint slot=0; slot<2; ++slot )
|
for( uint slot=0; slot<2; ++slot )
|
||||||
{
|
{
|
||||||
|
@ -543,7 +543,7 @@ AppConfig::ConsoleLogOptions::ConsoleLogOptions()
|
||||||
void AppConfig::ConsoleLogOptions::LoadSave( IniInterface& ini, const wxChar* logger )
|
void AppConfig::ConsoleLogOptions::LoadSave( IniInterface& ini, const wxChar* logger )
|
||||||
{
|
{
|
||||||
ConsoleLogOptions defaults;
|
ConsoleLogOptions defaults;
|
||||||
IniScopedGroup path( ini, logger );
|
ScopedIniGroup path( ini, logger );
|
||||||
|
|
||||||
IniEntry( Visible );
|
IniEntry( Visible );
|
||||||
IniEntry( AutoDock );
|
IniEntry( AutoDock );
|
||||||
|
@ -580,7 +580,7 @@ AppConfig::FolderOptions::FolderOptions()
|
||||||
void AppConfig::FolderOptions::LoadSave( IniInterface& ini )
|
void AppConfig::FolderOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
FolderOptions defaults;
|
FolderOptions defaults;
|
||||||
IniScopedGroup path( ini, L"Folders" );
|
ScopedIniGroup path( ini, L"Folders" );
|
||||||
|
|
||||||
if( ini.IsSaving() )
|
if( ini.IsSaving() )
|
||||||
{
|
{
|
||||||
|
@ -626,7 +626,7 @@ const wxFileName& AppConfig::FilenameOptions::operator[]( PluginsEnum_t pluginid
|
||||||
|
|
||||||
void AppConfig::FilenameOptions::LoadSave( IniInterface& ini )
|
void AppConfig::FilenameOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
IniScopedGroup path( ini, L"Filenames" );
|
ScopedIniGroup path( ini, L"Filenames" );
|
||||||
|
|
||||||
static const wxFileName pc( L"Please Configure" );
|
static const wxFileName pc( L"Please Configure" );
|
||||||
|
|
||||||
|
@ -674,7 +674,7 @@ void AppConfig::GSWindowOptions::SanityCheck()
|
||||||
|
|
||||||
void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
|
void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
IniScopedGroup path( ini, L"GSWindow" );
|
ScopedIniGroup path( ini, L"GSWindow" );
|
||||||
GSWindowOptions defaults;
|
GSWindowOptions defaults;
|
||||||
|
|
||||||
IniEntry( CloseOnEsc );
|
IniEntry( CloseOnEsc );
|
||||||
|
@ -723,7 +723,7 @@ void AppConfig::FramerateOptions::SanityCheck()
|
||||||
|
|
||||||
void AppConfig::FramerateOptions::LoadSave( IniInterface& ini )
|
void AppConfig::FramerateOptions::LoadSave( IniInterface& ini )
|
||||||
{
|
{
|
||||||
IniScopedGroup path( ini, L"Framerate" );
|
ScopedIniGroup path( ini, L"Framerate" );
|
||||||
FramerateOptions defaults;
|
FramerateOptions defaults;
|
||||||
|
|
||||||
IniEntry( NominalScalar );
|
IniEntry( NominalScalar );
|
||||||
|
|
|
@ -174,7 +174,7 @@ void RecentIsoManager::AppStatusEvent_OnSettingsLoadSave( const AppSettingsEvent
|
||||||
// and that could leave some residual entries in the config.
|
// and that could leave some residual entries in the config.
|
||||||
|
|
||||||
ini.GetConfig().DeleteGroup( L"RecentIso" );
|
ini.GetConfig().DeleteGroup( L"RecentIso" );
|
||||||
IniScopedGroup groupie( ini, L"RecentIso" );
|
ScopedIniGroup groupie( ini, L"RecentIso" );
|
||||||
|
|
||||||
int cnt = m_Items.size();
|
int cnt = m_Items.size();
|
||||||
for( int i=0; i<cnt; ++i )
|
for( int i=0; i<cnt; ++i )
|
||||||
|
@ -187,7 +187,7 @@ void RecentIsoManager::AppStatusEvent_OnSettingsLoadSave( const AppSettingsEvent
|
||||||
RemoveAllFromMenu();
|
RemoveAllFromMenu();
|
||||||
|
|
||||||
m_MaxLength = g_Conf->RecentIsoCount;
|
m_MaxLength = g_Conf->RecentIsoCount;
|
||||||
IniScopedGroup groupie( ini, L"RecentIso" );
|
ScopedIniGroup groupie( ini, L"RecentIso" );
|
||||||
for( uint i=0; i<m_MaxLength; ++i )
|
for( uint i=0; i<m_MaxLength; ++i )
|
||||||
{
|
{
|
||||||
wxString loadtmp;
|
wxString loadtmp;
|
||||||
|
|
Loading…
Reference in New Issue