[Project64] Change handling of Glide64.rdb to Project64Video.rdb

This commit is contained in:
zilmar 2017-08-23 17:58:13 +10:00
parent e0f2af6338
commit 5f725bd928
6 changed files with 97 additions and 94 deletions

View File

@ -24,7 +24,7 @@ Filename: "{app}\Project64.exe"; Description: "{cm:LaunchProgram,{#StringChange(
[Files]
Source: "{#BaseDir}\Bin\{#Configuration}\Project64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BaseDir}\Config\Glide64.rdb"; DestDir: "{app}\Config"
Source: "{#BaseDir}\Config\Project64Video.rdb"; DestDir: "{app}\Config"
Source: "{#BaseDir}\Config\Project64.cht"; DestDir: "{app}\Config"
Source: "{#BaseDir}\Config\Project64.rdb"; DestDir: "{app}\Config"
Source: "{#BaseDir}\Config\Project64.rdx"; DestDir: "{app}\Config"

View File

@ -12,7 +12,7 @@
#include "SettingsType-RomDatabase.h"
CIniFile * CSettingTypeRomDatabase::m_SettingsIniFile = NULL;
CIniFile * CSettingTypeRomDatabase::m_GlideIniFile = NULL;
CIniFile * CSettingTypeRomDatabase::m_Project64IniFile = NULL;
stdstr * CSettingTypeRomDatabase::m_SectionIdent = NULL;
CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault) :
@ -64,7 +64,7 @@ void CSettingTypeRomDatabase::Initialize( void )
WriteTrace(TraceAppInit, TraceDebug, "Start");
m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_GlideIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Glide64RDB).c_str());
m_Project64IniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str());
g_Settings->RegisterChangeCB(Game_IniKey, NULL, GameChanged);
g_Settings->RegisterChangeCB(Cmd_BaseDirectory, NULL, BaseDirChanged);
@ -82,10 +82,10 @@ void CSettingTypeRomDatabase::CleanUp( void )
delete m_SettingsIniFile;
m_SettingsIniFile = NULL;
}
if (m_GlideIniFile)
if (m_Project64IniFile)
{
delete m_GlideIniFile;
m_GlideIniFile = NULL;
delete m_Project64IniFile;
m_Project64IniFile = NULL;
}
if (m_SectionIdent)
{
@ -101,13 +101,13 @@ void CSettingTypeRomDatabase::BaseDirChanged ( void * /*Data */ )
delete m_SettingsIniFile;
m_SettingsIniFile = NULL;
}
if (m_GlideIniFile)
if (m_Project64IniFile)
{
delete m_GlideIniFile;
m_GlideIniFile = NULL;
delete m_Project64IniFile;
m_Project64IniFile = NULL;
}
m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_GlideIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Glide64RDB).c_str());
m_Project64IniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Project64VideoRDB).c_str());
}
void CSettingTypeRomDatabase::GameChanged(void * /*Data */)
@ -131,7 +131,7 @@ bool CSettingTypeRomDatabase::Load ( int Index, uint32_t & Value ) const
bool bRes = false;
if (m_GlideSetting)
{
bRes = m_GlideIniFile->GetNumber(Section(),m_KeyName.c_str(),Value,Value);
bRes = m_Project64IniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
}
else
{
@ -150,7 +150,7 @@ bool CSettingTypeRomDatabase::Load ( int Index, stdstr & Value ) const
bool bRes = false;
if (m_GlideSetting)
{
bRes = m_GlideIniFile->GetString(Section(),m_KeyName.c_str(),m_DefaultStr,temp_value);
bRes = m_Project64IniFile->GetString(Section(), m_KeyName.c_str(), m_DefaultStr, temp_value);
}
else
{
@ -175,7 +175,8 @@ void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, bool & Value ) const
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
}
else {
g_Settings->LoadBool(m_DefaultSetting, Value);
}
}
@ -188,7 +189,8 @@ void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, uint32_t & Value ) c
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
}
else {
g_Settings->LoadDword(m_DefaultSetting, Value);
}
}
@ -201,7 +203,8 @@ void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, stdstr & Value ) cons
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultStr;
} else {
}
else {
g_Settings->LoadStringVal(m_DefaultSetting, Value);
}
}
@ -220,7 +223,7 @@ void CSettingTypeRomDatabase::Save ( int /*Index*/, bool Value )
}
if (m_GlideSetting)
{
m_GlideIniFile->SaveNumber(Section(),m_KeyName.c_str(),Value);
m_Project64IniFile->SaveNumber(Section(), m_KeyName.c_str(), Value);
}
else
{
@ -246,7 +249,7 @@ void CSettingTypeRomDatabase::Save ( int Index, uint32_t Value )
}
if (m_GlideSetting)
{
m_GlideIniFile->SaveNumber(Section(),m_KeyName.c_str(),Value);
m_Project64IniFile->SaveNumber(Section(), m_KeyName.c_str(), Value);
}
else
{
@ -262,7 +265,7 @@ void CSettingTypeRomDatabase::Save ( int /*Index*/, const stdstr & Value )
}
if (m_GlideSetting)
{
m_GlideIniFile->SaveString(Section(),m_KeyName.c_str(),Value.c_str());
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), Value.c_str());
}
else
{
@ -278,7 +281,7 @@ void CSettingTypeRomDatabase::Save ( int /*Index*/, const char * Value )
}
if (m_GlideSetting)
{
m_GlideIniFile->SaveString(Section(),m_KeyName.c_str(),Value);
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), Value);
}
else
{
@ -294,7 +297,7 @@ void CSettingTypeRomDatabase::Delete ( int /*Index*/ )
}
if (m_GlideSetting)
{
m_GlideIniFile->SaveString(Section(),m_KeyName.c_str(),NULL);
m_Project64IniFile->SaveString(Section(), m_KeyName.c_str(), NULL);
}
else
{

View File

@ -67,7 +67,7 @@ protected:
static stdstr * m_SectionIdent;
static CIniFile * m_SettingsIniFile;
static CIniFile * m_GlideIniFile;
static CIniFile * m_Project64IniFile;
private:
CSettingTypeRomDatabase(); // Disable default constructor

View File

@ -31,8 +31,8 @@ enum SettingID
SupportFile_SettingsDefault,
SupportFile_RomDatabase,
SupportFile_RomDatabaseDefault,
SupportFile_Glide64RDB,
SupportFile_Glide64RDBDefault,
SupportFile_Project64VideoRDB,
SupportFile_Project64VideoRDBDefault,
SupportFile_Cheats,
SupportFile_CheatsDefault,
SupportFile_Notes,

View File

@ -94,8 +94,8 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config", "Project64.cfg"));
AddHandler(SupportFile_RomDatabase, new CSettingTypeApplicationPath("", "RomDatabase", SupportFile_RomDatabaseDefault));
AddHandler(SupportFile_RomDatabaseDefault, new CSettingTypeRelativePath("Config", "Project64.rdb"));
AddHandler(SupportFile_Glide64RDB, new CSettingTypeApplicationPath("", "Glide64RDB", SupportFile_Glide64RDBDefault));
AddHandler(SupportFile_Glide64RDBDefault, new CSettingTypeRelativePath("Config", "Glide64.rdb"));
AddHandler(SupportFile_Project64VideoRDB, new CSettingTypeApplicationPath("", "Project64VideoRDB", SupportFile_Project64VideoRDBDefault));
AddHandler(SupportFile_Project64VideoRDBDefault, new CSettingTypeRelativePath("Config", "Project64Video.rdb"));
AddHandler(SupportFile_Cheats, new CSettingTypeApplicationPath("", "Cheats", SupportFile_CheatsDefault));
AddHandler(SupportFile_CheatsDefault, new CSettingTypeRelativePath("Config", "Project64.cht"));
AddHandler(SupportFile_Notes, new CSettingTypeApplicationPath("", "Notes", SupportFile_NotesDefault));