From 46fea052621436f1a8d18721e2adfebfa952ab7b Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 15 Nov 2015 08:49:08 +1100 Subject: [PATCH] [Project64] Get settings to use standard types --- Source/Project64/Settings/Debug Settings.cpp | 1 + Source/Project64/Settings/Debug Settings.h | 4 +- Source/Project64/Settings/Game Settings.cpp | 13 ++- Source/Project64/Settings/Game Settings.h | 22 ++-- .../Project64/Settings/N64System Settings.cpp | 3 +- .../Project64/Settings/N64System Settings.h | 2 +- .../Settings/Recompiler Settings.cpp | 1 + .../Project64/Settings/Recompiler Settings.h | 4 +- .../SettingType/SettingsType-Application.h | 22 ++-- .../SettingsType-ApplicationIndex.h | 22 ++-- .../SettingsType-ApplicationPath.h | 2 +- .../Settings/SettingType/SettingsType-Base.h | 22 ++-- .../SettingType/SettingsType-Cheats.h | 22 ++-- .../SettingType/SettingsType-GameSetting.h | 22 ++-- .../SettingsType-GameSettingIndex.h | 22 ++-- .../SettingType/SettingsType-RDBCpuType.h | 24 ++--- .../SettingType/SettingsType-RDBOnOff.h | 24 ++--- .../SettingType/SettingsType-RDBRamSize.h | 24 ++--- .../SettingType/SettingsType-RDBSaveChip.h | 24 ++--- .../SettingType/SettingsType-RDBYesNo.h | 24 ++--- .../SettingType/SettingsType-RelativePath.h | 22 ++-- .../SettingType/SettingsType-RomDatabase.h | 34 +++--- .../SettingsType-RomDatabaseIndex.h | 24 ++--- .../SettingType/SettingsType-RomSetting.h | 18 ++-- .../SettingsType-SelectedDirectory.h | 22 ++-- .../SettingType/SettingsType-TempBool.h | 22 ++-- .../SettingType/SettingsType-TempNumber.h | 22 ++-- .../SettingType/SettingsType-TempString.h | 22 ++-- Source/Project64/Settings/Settings Class.cpp | 102 ++++++++++++------ Source/Project64/Settings/Settings Class.h | 52 ++++----- 30 files changed, 342 insertions(+), 302 deletions(-) diff --git a/Source/Project64/Settings/Debug Settings.cpp b/Source/Project64/Settings/Debug Settings.cpp index 43819b3b7..32c7c6c25 100644 --- a/Source/Project64/Settings/Debug Settings.cpp +++ b/Source/Project64/Settings/Debug Settings.cpp @@ -9,6 +9,7 @@ * * ****************************************************************************/ #include "stdafx.h" +#include "Debug Settings.h" int CDebugSettings::m_RefCount = 0; diff --git a/Source/Project64/Settings/Debug Settings.h b/Source/Project64/Settings/Debug Settings.h index b6483bed1..b26859c86 100644 --- a/Source/Project64/Settings/Debug Settings.h +++ b/Source/Project64/Settings/Debug Settings.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CDebugSettings { @@ -37,6 +37,6 @@ private: static bool m_bShowTLBMisses; static bool m_bShowDivByZero; - static int m_RefCount; + static int32_t m_RefCount; static bool m_Registered; }; diff --git a/Source/Project64/Settings/Game Settings.cpp b/Source/Project64/Settings/Game Settings.cpp index 76ba4fd24..ed4682096 100644 --- a/Source/Project64/Settings/Game Settings.cpp +++ b/Source/Project64/Settings/Game Settings.cpp @@ -9,6 +9,9 @@ * * ****************************************************************************/ #include "stdafx.h" +#include +#include +#include "Game Settings.h" bool CGameSettings::m_bSMM_StoreInstruc; bool CGameSettings::m_bSMM_Protect; @@ -16,12 +19,12 @@ bool CGameSettings::m_bSMM_ValidFunc; bool CGameSettings::m_bSMM_PIDMA; bool CGameSettings::m_bSMM_TLB; bool CGameSettings::m_bUseTlb; -DWORD CGameSettings::m_CountPerOp = 2; -DWORD CGameSettings::m_ViRefreshRate = 1500; -DWORD CGameSettings::m_AiCountPerBytes = 500; +uint32_t CGameSettings::m_CountPerOp = 2; +uint32_t CGameSettings::m_ViRefreshRate = 1500; +uint32_t CGameSettings::m_AiCountPerBytes = 500; bool CGameSettings::m_DelayDP = false; bool CGameSettings::m_DelaySI = false; -DWORD CGameSettings::m_RdramSize = 0; +uint32_t CGameSettings::m_RdramSize = 0; bool CGameSettings::m_bFixedAudio = true; bool CGameSettings::m_bSyncingToAudio = true; bool CGameSettings::m_bSyncToAudio = true; @@ -31,7 +34,7 @@ bool CGameSettings::m_RspAudioSignal; bool CGameSettings::m_bRomInMemory; bool CGameSettings::m_RegCaching; bool CGameSettings::m_bLinkBlocks; -DWORD CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD +uint32_t CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD SYSTEM_TYPE CGameSettings::m_SystemType = SYSTEM_NTSC; CPU_TYPE CGameSettings::m_CpuType = CPU_Recompiler; diff --git a/Source/Project64/Settings/Game Settings.h b/Source/Project64/Settings/Game Settings.h index 0ac44f7d8..ab2126222 100644 --- a/Source/Project64/Settings/Game Settings.h +++ b/Source/Project64/Settings/Game Settings.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CGameSettings { @@ -22,12 +22,12 @@ public: inline static bool bLinkBlocks(void) { return m_bLinkBlocks; } inline static FUNC_LOOKUP_METHOD LookUpMode(void) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; } inline static bool bUseTlb(void) { return m_bUseTlb; } - inline static DWORD CountPerOp(void) { return m_CountPerOp; } - inline static DWORD ViRefreshRate(void) { return m_ViRefreshRate; } - inline static DWORD AiCountPerBytes(void) { return m_AiCountPerBytes; } + inline static uint32_t CountPerOp(void) { return m_CountPerOp; } + inline static uint32_t ViRefreshRate(void) { return m_ViRefreshRate; } + inline static uint32_t AiCountPerBytes(void) { return m_AiCountPerBytes; } inline static bool bDelayDP(void) { return m_DelayDP; } inline static bool bDelaySI(void) { return m_DelaySI; } - inline static DWORD RdramSize(void) { return m_RdramSize; } + inline static uint32_t RdramSize(void) { return m_RdramSize; } inline static bool bFixedAudio(void) { return m_bFixedAudio; } inline static bool bSyncToAudio(void) { return m_bSyncingToAudio; } inline static bool bFastSP(void) { return m_bFastSP; } @@ -42,21 +42,21 @@ public: inline static CPU_TYPE CpuType(void) { return m_CpuType; } protected: - static void SpeedChanged(int SpeedLimit); + static void SpeedChanged(int32_t SpeedLimit); private: //Settings that can be changed on the fly static bool m_bRomInMemory; static bool m_RegCaching; static bool m_bLinkBlocks; - static DWORD m_LookUpMode; //FUNC_LOOKUP_METHOD + static uint32_t m_LookUpMode; //FUNC_LOOKUP_METHOD static bool m_bUseTlb; - static DWORD m_CountPerOp; - static DWORD m_ViRefreshRate; - static DWORD m_AiCountPerBytes; + static uint32_t m_CountPerOp; + static uint32_t m_ViRefreshRate; + static uint32_t m_AiCountPerBytes; static bool m_DelayDP; static bool m_DelaySI; - static DWORD m_RdramSize; + static uint32_t m_RdramSize; static bool m_bFixedAudio; static bool m_bSyncingToAudio; static bool m_bSyncToAudio; diff --git a/Source/Project64/Settings/N64System Settings.cpp b/Source/Project64/Settings/N64System Settings.cpp index b17445967..12e775dd8 100644 --- a/Source/Project64/Settings/N64System Settings.cpp +++ b/Source/Project64/Settings/N64System Settings.cpp @@ -9,8 +9,9 @@ * * ****************************************************************************/ #include "stdafx.h" +#include "N64System Settings.h" -int CN64SystemSettings::m_RefCount = 0; +int32_t CN64SystemSettings::m_RefCount = 0; bool CN64SystemSettings::m_bShowCPUPer; bool CN64SystemSettings::m_bProfiling; diff --git a/Source/Project64/Settings/N64System Settings.h b/Source/Project64/Settings/N64System Settings.h index 51b77e490..3944aa826 100644 --- a/Source/Project64/Settings/N64System Settings.h +++ b/Source/Project64/Settings/N64System Settings.h @@ -33,5 +33,5 @@ private: static bool m_bShowDListAListCount; static bool m_bDisplayFrameRate; - static int m_RefCount; + static int32_t m_RefCount; }; diff --git a/Source/Project64/Settings/Recompiler Settings.cpp b/Source/Project64/Settings/Recompiler Settings.cpp index ab7775b4c..3ceb9d7b3 100644 --- a/Source/Project64/Settings/Recompiler Settings.cpp +++ b/Source/Project64/Settings/Recompiler Settings.cpp @@ -9,6 +9,7 @@ * * ****************************************************************************/ #include "stdafx.h" +#include "Recompiler Settings.h" int CRecompilerSettings::m_RefCount = 0; diff --git a/Source/Project64/Settings/Recompiler Settings.h b/Source/Project64/Settings/Recompiler Settings.h index 5df3598e0..5631aa394 100644 --- a/Source/Project64/Settings/Recompiler Settings.h +++ b/Source/Project64/Settings/Recompiler Settings.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CRecompilerSettings { @@ -34,5 +34,5 @@ private: static bool m_bShowRecompMemSize; static bool m_bProfiling; - static int m_RefCount; + static int32_t m_RefCount; }; diff --git a/Source/Project64/Settings/SettingType/SettingsType-Application.h b/Source/Project64/Settings/SettingType/SettingsType-Application.h index 87a3a883c..b66325b9f 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Application.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Application.h @@ -27,23 +27,23 @@ public: virtual SettingType GetSettingType ( void ) const { return m_UseRegistry ? SettingType_Registry : SettingType_CfgFile; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); // Initialize this class to use ini or registry static void Initialize( const char * AppName ); diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h index da2b8edc1..c195d0738 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h @@ -23,23 +23,23 @@ public: virtual bool IndexBasedSetting ( void ) const { return true; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeApplicationIndex(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h index d74d15191..e2e369501 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h @@ -19,7 +19,7 @@ public: CSettingTypeApplicationPath(const char * Section, const char * Name, SettingID DefaultSetting ); //return the values - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; private: CSettingTypeApplicationPath(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-Base.h b/Source/Project64/Settings/SettingType/SettingsType-Base.h index 337b78027..58134054a 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Base.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Base.h @@ -39,21 +39,21 @@ public: virtual bool IndexBasedSetting ( void ) const = 0; //return the values - virtual bool Load ( int Index, bool & Value ) const = 0; - virtual bool Load ( int Index, uint32_t & Value ) const = 0; - virtual bool Load ( int Index, stdstr & Value ) const = 0; + virtual bool Load ( int32_t Index, bool & Value ) const = 0; + virtual bool Load ( int32_t Index, uint32_t & Value ) const = 0; + virtual bool Load ( int32_t Index, stdstr & Value ) const = 0; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const = 0; - virtual void LoadDefault ( int Index, uint32_t & Value ) const = 0; - virtual void LoadDefault ( int Index, stdstr & Value ) const = 0; + virtual void LoadDefault ( int32_t Index, bool & Value ) const = 0; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const = 0; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const = 0; //Update the settings - virtual void Save ( int Index, bool Value ) = 0; - virtual void Save ( int Index, uint32_t Value ) = 0; - virtual void Save ( int Index, const stdstr & Value ) = 0; - virtual void Save ( int Index, const char * Value ) = 0; + virtual void Save ( int32_t Index, bool Value ) = 0; + virtual void Save ( int32_t Index, uint32_t Value ) = 0; + virtual void Save ( int32_t Index, const stdstr & Value ) = 0; + virtual void Save ( int32_t Index, const char * Value ) = 0; // Delete the setting - virtual void Delete ( int Index ) = 0; + virtual void Delete ( int32_t Index ) = 0; }; diff --git a/Source/Project64/Settings/SettingType/SettingsType-Cheats.h b/Source/Project64/Settings/SettingType/SettingsType-Cheats.h index d5cc5017b..8f9142f57 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Cheats.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Cheats.h @@ -24,23 +24,23 @@ public: virtual SettingType GetSettingType ( void ) const { return SettingType_CheatSetting; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); // Initialize this class to use ini or registry static void Initialize ( void ); diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h index 191d8e665..29141e7e0 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h @@ -35,23 +35,23 @@ public: static void CleanUp ( void ); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeGame(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h index 7cce0e804..3f36e1fb5 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h @@ -25,23 +25,23 @@ public: virtual SettingType GetSettingType ( void ) const { return SettingType_GameSetting; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeGameIndex(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h index 776ddb4ed..80ea280f4 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h @@ -15,27 +15,27 @@ class CSettingTypeRDBCpuType : { public: CSettingTypeRDBCpuType(const char * Name, SettingID DefaultSetting ); - CSettingTypeRDBCpuType(const char * Name, int DefaultValue ); + CSettingTypeRDBCpuType(const char * Name, int32_t DefaultValue ); ~CSettingTypeRDBCpuType(); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRDBCpuType(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h index 064d9b540..973f9c426 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h @@ -15,27 +15,27 @@ class CSettingTypeRDBOnOff : { public: CSettingTypeRDBOnOff(const char * Name, SettingID DefaultSetting ); - CSettingTypeRDBOnOff(const char * Name, int DefaultValue ); + CSettingTypeRDBOnOff(const char * Name, int32_t DefaultValue ); ~CSettingTypeRDBOnOff(); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRDBOnOff(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h index 72b690fc5..f1d4956db 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h @@ -15,27 +15,27 @@ class CSettingTypeRDBRDRamSize : { public: CSettingTypeRDBRDRamSize(const char * Name, SettingID DefaultSetting ); - CSettingTypeRDBRDRamSize(const char * Name, int DefaultValue ); + CSettingTypeRDBRDRamSize(const char * Name, int32_t DefaultValue ); ~CSettingTypeRDBRDRamSize(); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRDBRDRamSize(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h index b04fb0cf7..1b473fb17 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h @@ -15,27 +15,27 @@ class CSettingTypeRDBSaveChip : { public: CSettingTypeRDBSaveChip(const char * Name, SettingID DefaultSetting ); - CSettingTypeRDBSaveChip(const char * Name, int DefaultValue ); + CSettingTypeRDBSaveChip(const char * Name, int32_t DefaultValue ); ~CSettingTypeRDBSaveChip(); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRDBSaveChip(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h index 986efafb0..de019dbb5 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h @@ -15,27 +15,27 @@ class CSettingTypeRDBYesNo : { public: CSettingTypeRDBYesNo(const char * Name, SettingID DefaultSetting ); - CSettingTypeRDBYesNo(const char * Name, int DefaultValue ); + CSettingTypeRDBYesNo(const char * Name, int32_t DefaultValue ); ~CSettingTypeRDBYesNo(); //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRDBYesNo(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h index df6c9f4af..fefb5b16b 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h @@ -25,23 +25,23 @@ public: SettingType GetSettingType ( void ) const { return SettingType_RelativePath; } //return the values - bool Load ( int /*Index*/, bool & /*Value*/ ) const { return false; }; - bool Load ( int /*Index*/, uint32_t & /*Value*/ ) const { return false; }; - bool Load ( int Index, stdstr & Value ) const; + bool Load ( int32_t /*Index*/, bool & /*Value*/ ) const { return false; }; + bool Load ( int32_t /*Index*/, uint32_t & /*Value*/ ) const { return false; }; + bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - void LoadDefault ( int Index, bool & Value ) const; - void LoadDefault ( int Index, uint32_t & Value ) const; - void LoadDefault ( int Index, stdstr & Value ) const; + void LoadDefault ( int32_t Index, bool & Value ) const; + void LoadDefault ( int32_t Index, uint32_t & Value ) const; + void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - void Save ( int Index, bool Value ); - void Save ( int Index, uint32_t Value ); - void Save ( int Index, const stdstr & Value ); - void Save ( int Index, const char * Value ); + void Save ( int32_t Index, bool Value ); + void Save ( int32_t Index, uint32_t Value ); + void Save ( int32_t Index, const stdstr & Value ); + void Save ( int32_t Index, const char * Value ); // Delete the setting - void Delete ( int Index ); + void Delete ( int32_t Index ); private: CSettingTypeRelativePath(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h index 24bc28a01..198a1b901 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h @@ -19,7 +19,7 @@ class CSettingTypeRomDatabase : public: CSettingTypeRomDatabase(const char * Name, const char * DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, bool DefaultValue, bool DeleteOnDefault = false ); - CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault = false ); + CSettingTypeRomDatabase(const char * Name, int32_t DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault = false ); virtual ~CSettingTypeRomDatabase(); @@ -28,23 +28,23 @@ public: virtual SettingType GetSettingType ( void ) const { return SettingType_RomDatabase; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); static void Initialize( void ); static void CleanUp ( void ); @@ -56,12 +56,12 @@ protected: static const char * StripNameSection (const char * Name); virtual const char * Section ( void ) const { return m_SectionIdent->c_str(); } - mutable stdstr m_KeyName; + mutable stdstr m_KeyName; const char *const m_DefaultStr; - const int m_DefaultValue; - const SettingID m_DefaultSetting; - const bool m_DeleteOnDefault; - bool m_GlideSetting; + const int32_t m_DefaultValue; + const SettingID m_DefaultSetting; + const bool m_DeleteOnDefault; + bool m_GlideSetting; static stdstr * m_SectionIdent; static CIniFile * m_SettingsIniFile; diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h index ac85c006c..e62fec2da 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h @@ -16,7 +16,7 @@ class CSettingTypeRomDatabaseIndex : public: CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, bool DefaultValue ); - CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int DefaultValue ); + CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int32_t DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting ); virtual ~CSettingTypeRomDatabaseIndex(); @@ -24,23 +24,23 @@ public: virtual bool IndexBasedSetting ( void ) const { return true; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeRomDatabaseIndex(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomSetting.h b/Source/Project64/Settings/SettingType/SettingsType-RomSetting.h index 56e11a0c8..98e60bd92 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomSetting.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomSetting.h @@ -6,22 +6,22 @@ class CSettingTypeRomDatabase : public: CSettingTypeRomDatabase(const char * Name, const char * DefaultValue ); CSettingTypeRomDatabase(const char * Name, bool DefaultValue ); - CSettingTypeRomDatabase(const char * Name, int DefaultValue ); + CSettingTypeRomDatabase(const char * Name, int32_t DefaultValue ); CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting ); ~CSettingTypeRomDatabase(); virtual SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_RomDatabase; } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); static void Initilize ( void ); @@ -32,7 +32,7 @@ private: const const char * m_KeyName; const const char * m_DefaultStr; - const int m_DefaultValue; + const int32_t m_DefaultValue; const SettingID m_DefaultSetting; static CIniFile * m_SettingsIniFile; diff --git a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h index baea2fda4..b51be8046 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h +++ b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h @@ -25,23 +25,23 @@ public: const char * GetName ( void ) const { return m_Name.c_str(); } //return the values - virtual bool Load ( int Index, bool & Value ) const; - virtual bool Load ( int Index, uint32_t & Value ) const; - virtual bool Load ( int Index, stdstr & Value ) const; + virtual bool Load ( int32_t Index, bool & Value ) const; + virtual bool Load ( int32_t Index, uint32_t & Value ) const; + virtual bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - virtual void LoadDefault ( int Index, bool & Value ) const; - virtual void LoadDefault ( int Index, uint32_t & Value ) const; - virtual void LoadDefault ( int Index, stdstr & Value ) const; + virtual void LoadDefault ( int32_t Index, bool & Value ) const; + virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const; + virtual void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - virtual void Save ( int Index, bool Value ); - virtual void Save ( int Index, uint32_t Value ); - virtual void Save ( int Index, const stdstr & Value ); - virtual void Save ( int Index, const char * Value ); + virtual void Save ( int32_t Index, bool Value ); + virtual void Save ( int32_t Index, uint32_t Value ); + virtual void Save ( int32_t Index, const stdstr & Value ); + virtual void Save ( int32_t Index, const char * Value ); // Delete the setting - virtual void Delete ( int Index ); + virtual void Delete ( int32_t Index ); private: CSettingTypeSelectedDirectory(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempBool.h b/Source/Project64/Settings/SettingType/SettingsType-TempBool.h index 891db0ed1..05dfb0146 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempBool.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempBool.h @@ -23,23 +23,23 @@ public: SettingType GetSettingType ( void ) const { return SettingType_BoolVariable; } //return the values - bool Load ( int Index, bool & Value ) const; - bool Load ( int Index, uint32_t & Value ) const; - bool Load ( int Index, stdstr & Value ) const; + bool Load ( int32_t Index, bool & Value ) const; + bool Load ( int32_t Index, uint32_t & Value ) const; + bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - void LoadDefault ( int Index, bool & Value ) const; - void LoadDefault ( int Index, uint32_t & Value ) const; - void LoadDefault ( int Index, stdstr & Value ) const; + void LoadDefault ( int32_t Index, bool & Value ) const; + void LoadDefault ( int32_t Index, uint32_t & Value ) const; + void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - void Save ( int Index, bool Value ); - void Save ( int Index, uint32_t Value ); - void Save ( int Index, const stdstr & Value ); - void Save ( int Index, const char * Value ); + void Save ( int32_t Index, bool Value ); + void Save ( int32_t Index, uint32_t Value ); + void Save ( int32_t Index, const stdstr & Value ); + void Save ( int32_t Index, const char * Value ); // Delete the setting - void Delete ( int Index ); + void Delete ( int32_t Index ); private: CSettingTypeTempBool(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h index 459d8dafb..2011a751d 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h @@ -23,23 +23,23 @@ public: SettingType GetSettingType ( void ) const { return SettingType_NumberVariable; } //return the values - bool Load ( int Index, bool & Value ) const; - bool Load ( int Index, uint32_t & Value ) const; - bool Load ( int Index, stdstr & Value ) const; + bool Load ( int32_t Index, bool & Value ) const; + bool Load ( int32_t Index, uint32_t & Value ) const; + bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - void LoadDefault ( int Index, bool & Value ) const; - void LoadDefault ( int Index, uint32_t & Value ) const; - void LoadDefault ( int Index, stdstr & Value ) const; + void LoadDefault ( int32_t Index, bool & Value ) const; + void LoadDefault ( int32_t Index, uint32_t & Value ) const; + void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - void Save ( int Index, bool Value ); - void Save ( int Index, uint32_t Value ); - void Save ( int Index, const stdstr & Value ); - void Save ( int Index, const char * Value ); + void Save ( int32_t Index, bool Value ); + void Save ( int32_t Index, uint32_t Value ); + void Save ( int32_t Index, const stdstr & Value ); + void Save ( int32_t Index, const char * Value ); // Delete the setting - void Delete ( int Index ); + void Delete ( int32_t Index ); private: CSettingTypeTempNumber(void); // Disable default constructor diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempString.h b/Source/Project64/Settings/SettingType/SettingsType-TempString.h index 4bb512d7d..0c2143d19 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempString.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempString.h @@ -23,23 +23,23 @@ public: SettingType GetSettingType ( void ) const { return SettingType_StringVariable; } //return the values - bool Load ( int Index, bool & Value ) const; - bool Load ( int Index, uint32_t & Value ) const; - bool Load ( int Index, stdstr & Value ) const; + bool Load ( int32_t Index, bool & Value ) const; + bool Load ( int32_t Index, uint32_t & Value ) const; + bool Load ( int32_t Index, stdstr & Value ) const; //return the default values - void LoadDefault ( int Index, bool & Value ) const; - void LoadDefault ( int Index, uint32_t & Value ) const; - void LoadDefault ( int Index, stdstr & Value ) const; + void LoadDefault ( int32_t Index, bool & Value ) const; + void LoadDefault ( int32_t Index, uint32_t & Value ) const; + void LoadDefault ( int32_t Index, stdstr & Value ) const; //Update the settings - void Save ( int Index, bool Value ); - void Save ( int Index, uint32_t Value ); - void Save ( int Index, const stdstr & Value ); - void Save ( int Index, const char * Value ); + void Save ( int32_t Index, bool Value ); + void Save ( int32_t Index, uint32_t Value ); + void Save ( int32_t Index, const stdstr & Value ); + void Save ( int32_t Index, const char * Value ); // Delete the setting - void Delete ( int Index ); + void Delete ( int32_t Index ); private: CSettingTypeTempString(void); // Disable default constructor diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index 9ee570798..e050d3854 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -30,6 +30,7 @@ #include "SettingType/SettingsType-TempNumber.h" #include "SettingType/SettingsType-TempBool.h" #include "Settings Class.h" +#include "N64 System/N64 Types.h" #include CSettings * g_Settings = NULL; @@ -419,7 +420,7 @@ const char * CSettings::GetSettingSz(CSettings * _this, SettingID Type, char * B return Buffer; } -void CSettings::SetSetting(CSettings * _this, SettingID ID, unsigned int Value) +void CSettings::SetSetting(CSettings * _this, SettingID ID, uint32_t Value) { _this->SaveDword(ID, Value); } @@ -460,7 +461,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value)); } - else { + else + { _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; @@ -469,7 +471,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, "")); } - else { + else + { _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; @@ -490,7 +493,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau _this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value)); _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting)); } - else { + else + { _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); } break; @@ -499,7 +503,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), "")); } - else { + else + { _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); } break; @@ -516,7 +521,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true)); } - else { + else + { _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true)); } break; @@ -525,7 +531,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true)); } - else { + else + { _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true)); } break; @@ -541,7 +548,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau { _this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true)); } - else { + else + { SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; _this->m_NextAutoSettingId += 1; _this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true)); @@ -589,7 +597,8 @@ bool CSettings::LoadBool(SettingID Type, bool & Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { return FindInfo->second->Load(0, Value); } return false; @@ -615,7 +624,8 @@ bool CSettings::LoadBoolIndex(SettingID Type, int index, bool & Value) { return FindInfo->second->Load(index, Value); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; @@ -641,7 +651,8 @@ bool CSettings::LoadDword(SettingID Type, uint32_t & Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { return FindInfo->second->Load(0, Value); } return false; @@ -667,7 +678,8 @@ bool CSettings::LoadDwordIndex(SettingID Type, int index, uint32_t & Value) { return FindInfo->second->Load(index, Value); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; @@ -693,7 +705,8 @@ bool CSettings::LoadStringVal(SettingID Type, stdstr & Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { return FindInfo->second->Load(0, Value); } return false; @@ -713,7 +726,8 @@ bool CSettings::LoadStringVal(SettingID Type, char * Buffer, int BufferSize) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { stdstr Value; bRes = FindInfo->second->Load(0, Value); int len = BufferSize; @@ -746,7 +760,8 @@ bool CSettings::LoadStringIndex(SettingID Type, int index, stdstr & Value) { return FindInfo->second->Load(index, Value); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; @@ -774,12 +789,14 @@ void CSettings::LoadDefaultBool(SettingID Type, bool & Value) //if not found do nothing UnknownSetting(Type); } - else { + else + { if (FindInfo->second->IndexBasedSetting()) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->LoadDefault(0, Value); } } @@ -811,12 +828,14 @@ void CSettings::LoadDefaultDword(SettingID Type, uint32_t & Value) //if not found do nothing UnknownSetting(Type); } - else { + else + { if (FindInfo->second->IndexBasedSetting()) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->LoadDefault(0, Value); } } @@ -848,12 +867,14 @@ void CSettings::LoadDefaultString(SettingID Type, stdstr & Value) //if not found do nothing UnknownSetting(Type); } - else { + else + { if (FindInfo->second->IndexBasedSetting()) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->LoadDefault(0, Value); } } @@ -893,7 +914,8 @@ void CSettings::SaveBool(SettingID Type, bool Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); @@ -912,7 +934,8 @@ void CSettings::SaveBoolIndex(SettingID Type, int index, bool Value) { FindInfo->second->Save(index, Value); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); @@ -931,7 +954,8 @@ void CSettings::SaveDword(SettingID Type, uint32_t Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); @@ -950,7 +974,8 @@ void CSettings::SaveDwordIndex(SettingID Type, int index, uint32_t Value) { FindInfo->second->Save(index, Value); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); @@ -969,7 +994,8 @@ void CSettings::SaveString(SettingID Type, const stdstr & Value) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); @@ -987,7 +1013,8 @@ void CSettings::SaveString(SettingID Type, const char * Buffer) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->Save(0, Buffer); } NotifyCallBacks(Type); @@ -1005,7 +1032,8 @@ void CSettings::SaveStringIndex(SettingID Type, int index, const char * Buffer) { FindInfo->second->Save(index, Buffer); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); @@ -1028,7 +1056,8 @@ void CSettings::DeleteSetting(SettingID Type) { g_Notify->BreakPoint(__FILEW__, __LINE__); } - else { + else + { FindInfo->second->Delete(0); } NotifyCallBacks(Type); @@ -1046,7 +1075,8 @@ void CSettings::DeleteSettingIndex(SettingID Type, int index) { FindInfo->second->Delete(index); } - else { + else + { g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); @@ -1125,7 +1155,8 @@ void CSettings::RegisterChangeCB(SettingID Type, void * Data, SettingChangedFunc } item->Next = new_item; } - else { + else + { m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item)); } } @@ -1155,11 +1186,13 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu m_Callback.erase(Callback); m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next)); } - else { + else + { m_Callback.erase(Callback); } } - else { + else + { PrevItem->Next = item->Next; } delete item; @@ -1170,7 +1203,8 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu item = item->Next; } } - else { + else + { UnknownSetting(Type); return; } diff --git a/Source/Project64/Settings/Settings Class.h b/Source/Project64/Settings/Settings Class.h index 056fe255c..cdd2cc0ea 100644 --- a/Source/Project64/Settings/Settings Class.h +++ b/Source/Project64/Settings/Settings Class.h @@ -53,48 +53,48 @@ public: //return the values bool LoadBool ( SettingID Type ); bool LoadBool ( SettingID Type, bool & Value ); - bool LoadBoolIndex ( SettingID Type, int index ); - bool LoadBoolIndex ( SettingID Type, int index , bool & Value ); + bool LoadBoolIndex ( SettingID Type, int32_t index ); + bool LoadBoolIndex ( SettingID Type, int32_t index , bool & Value ); uint32_t LoadDword ( SettingID Type ); - bool LoadDword ( SettingID Type, uint32_t & Value); - uint32_t LoadDwordIndex ( SettingID Type, int index ); - bool LoadDwordIndex ( SettingID Type, int index, uint32_t & Value); + bool LoadDword ( SettingID Type, uint32_t & Value ); + uint32_t LoadDwordIndex ( SettingID Type, int32_t index ); + bool LoadDwordIndex ( SettingID Type, int32_t index, uint32_t & Value ); stdstr LoadStringVal ( SettingID Type ); - bool LoadStringVal (SettingID Type, stdstr & Value); - bool LoadStringVal (SettingID Type, char * Buffer, int BufferSize); - stdstr LoadStringIndex ( SettingID Type, int index ); - bool LoadStringIndex ( SettingID Type, int index, stdstr & Value ); - bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); + bool LoadStringVal (SettingID Type, stdstr & Value); + bool LoadStringVal (SettingID Type, char * Buffer, int32_t BufferSize ); + stdstr LoadStringIndex ( SettingID Type, int32_t index ); + bool LoadStringIndex ( SettingID Type, int32_t index, stdstr & Value ); + bool LoadStringIndex ( SettingID Type, int32_t index, char * Buffer, int32_t BufferSize ); //Load the default value for the setting bool LoadDefaultBool ( SettingID Type ); void LoadDefaultBool ( SettingID Type, bool & Value ); - bool LoadDefaultBoolIndex ( SettingID Type, int index ); - void LoadDefaultBoolIndex ( SettingID Type, int index , bool & Value ); + bool LoadDefaultBoolIndex ( SettingID Type, int32_t index ); + void LoadDefaultBoolIndex ( SettingID Type, int32_t index , bool & Value ); uint32_t LoadDefaultDword ( SettingID Type ); void LoadDefaultDword ( SettingID Type, uint32_t & Value); - uint32_t LoadDefaultDwordIndex ( SettingID Type, int index ); - void LoadDefaultDwordIndex ( SettingID Type, int index, uint32_t & Value); + uint32_t LoadDefaultDwordIndex ( SettingID Type, int32_t index ); + void LoadDefaultDwordIndex ( SettingID Type, int32_t index, uint32_t & Value); stdstr LoadDefaultString ( SettingID Type ); void LoadDefaultString ( SettingID Type, stdstr & Value ); - void LoadDefaultString ( SettingID Type, char * Buffer, int BufferSize ); - stdstr LoadDefaultStringIndex ( SettingID Type, int index ); - void LoadDefaultStringIndex ( SettingID Type, int index, stdstr & Value ); - void LoadDefaultStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); + void LoadDefaultString ( SettingID Type, char * Buffer, int32_t BufferSize ); + stdstr LoadDefaultStringIndex ( SettingID Type, int32_t index ); + void LoadDefaultStringIndex ( SettingID Type, int32_t index, stdstr & Value ); + void LoadDefaultStringIndex ( SettingID Type, int32_t index, char * Buffer, int32_t BufferSize ); //Update the settings void SaveBool ( SettingID Type, bool Value ); - void SaveBoolIndex ( SettingID Type, int index, bool Value ); + void SaveBoolIndex ( SettingID Type, int32_t index, bool Value ); void SaveDword ( SettingID Type, uint32_t Value ); - void SaveDwordIndex ( SettingID Type, int index, uint32_t Value ); + void SaveDwordIndex ( SettingID Type, int32_t index, uint32_t Value ); void SaveString ( SettingID Type, const stdstr & Value ); - void SaveStringIndex ( SettingID Type, int index, const stdstr & Value ); + void SaveStringIndex ( SettingID Type, int32_t index, const stdstr & Value ); void SaveString ( SettingID Type, const char * Buffer ); - void SaveStringIndex ( SettingID Type, int index, const char * Buffer ); + void SaveStringIndex ( SettingID Type, int32_t index, const char * Buffer ); // Delete a setting void DeleteSetting ( SettingID Type ); - void DeleteSettingIndex ( SettingID Type, int index ); + void DeleteSettingIndex ( SettingID Type, int32_t index ); //Register Notification of change void RegisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func); @@ -107,8 +107,8 @@ public: // static functions for plugins static uint32_t GetSetting ( CSettings * _this, SettingID Type ); - static const char * GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ); - static void SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ); + static const char * GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int32_t BufferSize ); + static void SetSetting ( CSettings * _this, SettingID ID, uint32_t Value ); static void SetSettingSz ( CSettings * _this, SettingID ID, const char * Value ); static void RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, SettingType Type, const char * Category, const char * DefaultStr, @@ -121,7 +121,7 @@ private: SETTING_MAP m_SettingInfo; SETTING_CALLBACK m_Callback; - int m_NextAutoSettingId; + int32_t m_NextAutoSettingId; }; extern CSettings * g_Settings;