[Project64] Get settings to use standard types

This commit is contained in:
zilmar 2015-11-15 08:49:08 +11:00
parent 68513c1101
commit 46fea05262
30 changed files with 342 additions and 302 deletions

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Debug Settings.h"
int CDebugSettings::m_RefCount = 0;

View File

@ -10,7 +10,7 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
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;
};

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64\N64 System\System Globals.h>
#include <Project64\N64 System\N64 Class.h>
#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;

View File

@ -10,7 +10,7 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
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;

View File

@ -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;

View File

@ -33,5 +33,5 @@ private:
static bool m_bShowDListAListCount;
static bool m_bDisplayFrameRate;
static int m_RefCount;
static int32_t m_RefCount;
};

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Recompiler Settings.h"
int CRecompilerSettings::m_RefCount = 0;

View File

@ -10,7 +10,7 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
class CRecompilerSettings
{
@ -34,5 +34,5 @@ private:
static bool m_bShowRecompMemSize;
static bool m_bProfiling;
static int m_RefCount;
static int32_t m_RefCount;
};

View File

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

View File

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

View File

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

View File

@ -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;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 );
@ -58,7 +58,7 @@ protected:
mutable stdstr m_KeyName;
const char *const m_DefaultStr;
const int m_DefaultValue;
const int32_t m_DefaultValue;
const SettingID m_DefaultSetting;
const bool m_DeleteOnDefault;
bool m_GlideSetting;

View File

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

View File

@ -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;

View File

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

View File

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

View File

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

View File

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

View File

@ -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 <Common/TraceDefs.h>
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;
}

View File

@ -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, 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;