[Video] Change settings module name

This commit is contained in:
zilmar 2017-09-27 06:27:20 +10:00
parent a92569deb1
commit 5d3b72ce5a
4 changed files with 43 additions and 43 deletions

View File

@ -12,7 +12,7 @@
#include "SettingsType-RomDatabase.h" #include "SettingsType-RomDatabase.h"
CIniFile * CSettingTypeRomDatabase::m_SettingsIniFile = NULL; CIniFile * CSettingTypeRomDatabase::m_SettingsIniFile = NULL;
CIniFile * CSettingTypeRomDatabase::m_Project64IniFile = NULL; CIniFile * CSettingTypeRomDatabase::m_VideoIniFile = NULL;
stdstr * CSettingTypeRomDatabase::m_SectionIdent = NULL; stdstr * CSettingTypeRomDatabase::m_SectionIdent = NULL;
CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault) : CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault) :
@ -21,7 +21,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, int DefaultV
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
m_DeleteOnDefault(DeleteOnDefault), m_DeleteOnDefault(DeleteOnDefault),
m_GlideSetting(IsGlideSetting(Name)) m_VideoSetting(IsVideoSetting(Name))
{ {
} }
@ -31,7 +31,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, bool Default
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
m_DeleteOnDefault(DeleteOnDefault), m_DeleteOnDefault(DeleteOnDefault),
m_GlideSetting(IsGlideSetting(Name)) m_VideoSetting(IsVideoSetting(Name))
{ {
} }
@ -41,7 +41,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, const char *
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
m_DeleteOnDefault(DeleteOnDefault), m_DeleteOnDefault(DeleteOnDefault),
m_GlideSetting(IsGlideSetting(Name)) m_VideoSetting(IsVideoSetting(Name))
{ {
} }
@ -51,7 +51,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, SettingID De
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(DefaultSetting), m_DefaultSetting(DefaultSetting),
m_DeleteOnDefault(DeleteOnDefault), m_DeleteOnDefault(DeleteOnDefault),
m_GlideSetting(IsGlideSetting(Name)) m_VideoSetting(IsVideoSetting(Name))
{ {
} }
@ -64,7 +64,7 @@ void CSettingTypeRomDatabase::Initialize(void)
WriteTrace(TraceAppInit, TraceDebug, "Start"); WriteTrace(TraceAppInit, TraceDebug, "Start");
m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_Project64IniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str()); m_VideoIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str());
g_Settings->RegisterChangeCB(Game_IniKey, NULL, GameChanged); g_Settings->RegisterChangeCB(Game_IniKey, NULL, GameChanged);
g_Settings->RegisterChangeCB(Cmd_BaseDirectory, NULL, BaseDirChanged); g_Settings->RegisterChangeCB(Cmd_BaseDirectory, NULL, BaseDirChanged);
@ -82,10 +82,10 @@ void CSettingTypeRomDatabase::CleanUp(void)
delete m_SettingsIniFile; delete m_SettingsIniFile;
m_SettingsIniFile = NULL; m_SettingsIniFile = NULL;
} }
if (m_Project64IniFile) if (m_VideoIniFile)
{ {
delete m_Project64IniFile; delete m_VideoIniFile;
m_Project64IniFile = NULL; m_VideoIniFile = NULL;
} }
if (m_SectionIdent) if (m_SectionIdent)
{ {
@ -101,13 +101,13 @@ void CSettingTypeRomDatabase::BaseDirChanged(void * /*Data */)
delete m_SettingsIniFile; delete m_SettingsIniFile;
m_SettingsIniFile = NULL; m_SettingsIniFile = NULL;
} }
if (m_Project64IniFile) if (m_VideoIniFile)
{ {
delete m_Project64IniFile; delete m_VideoIniFile;
m_Project64IniFile = NULL; m_VideoIniFile = NULL;
} }
m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_Project64IniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str()); m_VideoIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str());
} }
void CSettingTypeRomDatabase::GameChanged(void * /*Data */) void CSettingTypeRomDatabase::GameChanged(void * /*Data */)
@ -129,9 +129,9 @@ bool CSettingTypeRomDatabase::Load(int Index, bool & Value) const
bool CSettingTypeRomDatabase::Load(int Index, uint32_t & Value) const bool CSettingTypeRomDatabase::Load(int Index, uint32_t & Value) const
{ {
bool bRes = false; bool bRes = false;
if (m_GlideSetting) if (m_VideoSetting)
{ {
bRes = m_Project64IniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value); bRes = m_VideoIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
} }
else else
{ {
@ -148,9 +148,9 @@ bool CSettingTypeRomDatabase::Load(int Index, stdstr & Value) const
{ {
stdstr temp_value; stdstr temp_value;
bool bRes = false; bool bRes = false;
if (m_GlideSetting) if (m_VideoSetting)
{ {
bRes = m_Project64IniFile->GetString(Section(), m_KeyName.c_str(), m_DefaultStr, temp_value); bRes = m_VideoIniFile->GetString(Section(), m_KeyName.c_str(), m_DefaultStr, temp_value);
} }
else else
{ {
@ -221,9 +221,9 @@ void CSettingTypeRomDatabase::Save(int /*Index*/, bool Value)
{ {
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
} }
if (m_GlideSetting) if (m_VideoSetting)
{ {
m_Project64IniFile->SaveNumber(Section(), m_KeyName.c_str(), Value); m_VideoIniFile->SaveNumber(Section(), m_KeyName.c_str(), Value);
} }
else else
{ {
@ -247,9 +247,9 @@ void CSettingTypeRomDatabase::Save(int Index, uint32_t Value)
return; return;
} }
} }
if (m_GlideSetting) if (m_VideoSetting)
{ {
m_Project64IniFile->SaveNumber(Section(), m_KeyName.c_str(), Value); m_VideoIniFile->SaveNumber(Section(), m_KeyName.c_str(), Value);
} }
else else
{ {
@ -263,9 +263,9 @@ void CSettingTypeRomDatabase::Save(int /*Index*/, const stdstr & Value)
{ {
return; return;
} }
if (m_GlideSetting) if (m_VideoSetting)
{ {
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), Value.c_str()); m_VideoIniFile->SaveString(Section(), m_KeyName.c_str(), Value.c_str());
} }
else else
{ {
@ -279,9 +279,9 @@ void CSettingTypeRomDatabase::Save(int /*Index*/, const char * Value)
{ {
return; return;
} }
if (m_GlideSetting) if (m_VideoSetting)
{ {
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), Value); m_VideoIniFile->SaveString(Section(), m_KeyName.c_str(), Value);
} }
else else
{ {
@ -295,9 +295,9 @@ void CSettingTypeRomDatabase::Delete(int /*Index*/)
{ {
return; return;
} }
if (m_GlideSetting) if (m_VideoSetting)
{ {
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), NULL); m_VideoIniFile->SaveString(Section(), m_KeyName.c_str(), NULL);
} }
else else
{ {
@ -305,9 +305,9 @@ void CSettingTypeRomDatabase::Delete(int /*Index*/)
} }
} }
bool CSettingTypeRomDatabase::IsGlideSetting(const char * Name) bool CSettingTypeRomDatabase::IsVideoSetting(const char * Name)
{ {
if (_strnicmp(Name, "Glide64-", 8) == 0) if (_strnicmp(Name, "Video-", 6) == 0)
{ {
return true; return true;
} }
@ -316,9 +316,9 @@ bool CSettingTypeRomDatabase::IsGlideSetting(const char * Name)
const char * CSettingTypeRomDatabase::StripNameSection(const char * Name) const char * CSettingTypeRomDatabase::StripNameSection(const char * Name)
{ {
if (_strnicmp(Name, "Glide64-", 8) == 0) if (_strnicmp(Name, "Video-", 6) == 0)
{ {
return &Name[8]; return &Name[6];
} }
return Name; return Name;
} }

View File

@ -54,7 +54,7 @@ protected:
static void GameChanged(void * /*Data */); static void GameChanged(void * /*Data */);
static void BaseDirChanged(void * /*Data */); static void BaseDirChanged(void * /*Data */);
static bool IsGlideSetting(const char * Name); static bool IsVideoSetting(const char * Name);
static const char * StripNameSection(const char * Name); static const char * StripNameSection(const char * Name);
virtual const char * Section(void) const { return m_SectionIdent->c_str(); } virtual const char * Section(void) const { return m_SectionIdent->c_str(); }
@ -63,11 +63,11 @@ protected:
const int32_t m_DefaultValue; const int32_t m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
const bool m_DeleteOnDefault; const bool m_DeleteOnDefault;
bool m_GlideSetting; bool m_VideoSetting;
static stdstr * m_SectionIdent; static stdstr * m_SectionIdent;
static CIniFile * m_SettingsIniFile; static CIniFile * m_SettingsIniFile;
static CIniFile * m_Project64IniFile; static CIniFile * m_VideoIniFile;
private: private:
CSettingTypeRomDatabase(); // Disable default constructor CSettingTypeRomDatabase(); // Disable default constructor

View File

@ -16,9 +16,9 @@ CSettingTypeRomDatabaseSetting::CSettingTypeRomDatabaseSetting(const char * Sect
m_SectionIdent(SectionIdent) m_SectionIdent(SectionIdent)
{ {
m_SectionIdent.Replace("\\","-"); m_SectionIdent.Replace("\\","-");
if (!m_GlideSetting) if (!m_VideoSetting)
{ {
m_GlideSetting = IsGlideSetting(m_SectionIdent.c_str()); m_VideoSetting = IsVideoSetting(m_SectionIdent.c_str());
m_SectionIdent = StripNameSection(m_SectionIdent.c_str()); m_SectionIdent = StripNameSection(m_SectionIdent.c_str());
} }
} }
@ -28,9 +28,9 @@ CSettingTypeRomDatabaseSetting::CSettingTypeRomDatabaseSetting(const char * Sect
m_SectionIdent(SectionIdent) m_SectionIdent(SectionIdent)
{ {
m_SectionIdent.Replace("\\","-"); m_SectionIdent.Replace("\\","-");
if (!m_GlideSetting) if (!m_VideoSetting)
{ {
m_GlideSetting = IsGlideSetting(m_SectionIdent.c_str()); m_VideoSetting = IsVideoSetting(m_SectionIdent.c_str());
m_SectionIdent = StripNameSection(m_SectionIdent.c_str()); m_SectionIdent = StripNameSection(m_SectionIdent.c_str());
} }
} }
@ -40,9 +40,9 @@ CSettingTypeRomDatabaseSetting::CSettingTypeRomDatabaseSetting(const char * Sect
m_SectionIdent(SectionIdent) m_SectionIdent(SectionIdent)
{ {
m_SectionIdent.Replace("\\","-"); m_SectionIdent.Replace("\\","-");
if (!m_GlideSetting) if (!m_VideoSetting)
{ {
m_GlideSetting = IsGlideSetting(m_SectionIdent.c_str()); m_VideoSetting = IsVideoSetting(m_SectionIdent.c_str());
m_SectionIdent = StripNameSection(m_SectionIdent.c_str()); m_SectionIdent = StripNameSection(m_SectionIdent.c_str());
} }
} }
@ -52,9 +52,9 @@ CSettingTypeRomDatabaseSetting::CSettingTypeRomDatabaseSetting(const char * Sect
m_SectionIdent(SectionIdent) m_SectionIdent(SectionIdent)
{ {
m_SectionIdent.Replace("\\","-"); m_SectionIdent.Replace("\\","-");
if (!m_GlideSetting) if (!m_VideoSetting)
{ {
m_GlideSetting = IsGlideSetting(m_SectionIdent.c_str()); m_VideoSetting = IsVideoSetting(m_SectionIdent.c_str());
m_SectionIdent = StripNameSection(m_SectionIdent.c_str()); m_SectionIdent = StripNameSection(m_SectionIdent.c_str());
} }
} }

View File

@ -132,7 +132,7 @@ void CSettings::RegisterSettings(void)
m_Set_log_flush = FindSystemSettingId("Log Auto Flush"); m_Set_log_flush = FindSystemSettingId("Log Auto Flush");
m_Set_log_dir = FindSystemSettingId("Dir:Log"); m_Set_log_dir = FindSystemSettingId("Dir:Log");
SetModuleName("Glide64"); SetModuleName("Video");
general_setting(Set_Resolution, "resolution", GetDefaultScreenRes()); general_setting(Set_Resolution, "resolution", GetDefaultScreenRes());
general_setting(Set_vsync, "vsync", true); general_setting(Set_vsync, "vsync", true);
general_setting(Set_texenh_options, "texenh_options", false); general_setting(Set_texenh_options, "texenh_options", false);