diff --git a/Source/Project64-core/Settings/Settings.h b/Source/Project64-core/Settings/Settings.h
index b3d27d64f..db8cc0015 100644
--- a/Source/Project64-core/Settings/Settings.h
+++ b/Source/Project64-core/Settings/Settings.h
@@ -21,9 +21,6 @@ enum SettingID
Default_None,
Default_Constant,
- //information - temp keys
- Info_ShortCutsChanged,
-
//Command Settings
Cmd_BaseDirectory,
Cmd_RomFile,
@@ -42,23 +39,13 @@ enum SettingID
SupportFile_NotesDefault,
SupportFile_ExtInfo,
SupportFile_ExtInfoDefault,
- SupportFile_ShortCuts,
- SupportFile_ShortCutsDefault,
- SupportFile_RomListCache,
- SupportFile_RomListCacheDefault,
- SupportFile_7zipCache,
- SupportFile_7zipCacheDefault,
//Settings
Setting_ApplicationName,
Setting_UseFromRegistry,
Setting_RdbEditor,
Setting_CN64TimeCritical,
- Setting_PluginPageFirst,
- Setting_DisableScrSaver,
- Setting_AutoSleep,
Setting_AutoStart,
- Setting_AutoFullscreen,
Setting_CheckEmuRunning,
Setting_EraseGameDefaults,
@@ -69,7 +56,7 @@ enum SettingID
Setting_CurrentLanguage,
Setting_EnableDisk,
- //RDB TLB Settings
+ //RDB Settings
Rdb_GoodName,
Rdb_SaveChip,
Rdb_CpuType,
@@ -80,9 +67,6 @@ enum SettingID
Rdb_DelaySi,
Rdb_32Bit,
Rdb_FastSP,
- Rdb_Status,
- Rdb_NotesCore,
- Rdb_NotesPlugin,
Rdb_FixedAudio,
Rdb_SyncViaAudio,
Rdb_RspAudioSignal,
@@ -174,33 +158,9 @@ enum SettingID
UserInterface_BasicMode,
UserInterface_ShowCPUPer,
UserInterface_DisplayFrameRate,
- UserInterface_InFullScreen,
UserInterface_FrameDisplayType,
- UserInterface_MainWindowTop,
- UserInterface_MainWindowLeft,
- UserInterface_AlwaysOnTop,
-
- RomBrowser_Enabled,
- RomBrowser_ColoumnsChanged,
- RomBrowser_Top,
- RomBrowser_Left,
- RomBrowser_Width,
- RomBrowser_Height,
- RomBrowser_PosIndex,
- RomBrowser_WidthIndex,
- RomBrowser_SortFieldIndex,
- RomBrowser_SortAscendingIndex,
- RomBrowser_Recursive,
- RomBrowser_Maximized,
//Directory Info
- Directory_LastSave,
- Directory_RecentGameDirCount,
- Directory_RecentGameDirIndex,
- Directory_Game,
- Directory_GameInitial,
- Directory_GameSelected,
- Directory_GameUseSelected,
Directory_Plugin,
Directory_PluginInitial,
Directory_PluginSelected,
@@ -227,9 +187,18 @@ enum SettingID
Directory_LogSelected,
Directory_LogUseSelected,
+ //Rom List
+ RomList_RomListCache,
+ RomList_RomListCacheDefault,
+ RomList_GameDir,
+ RomList_GameDirInitial,
+ RomList_GameDirSelected,
+ RomList_GameDirUseSelected,
+ RomList_GameDirRecursive,
+ RomList_7zipCache,
+ RomList_7zipCacheDefault,
+
//File Info
- File_RecentGameFileCount,
- File_RecentGameFileIndex,
File_DiskIPLPath,
//Debugger
@@ -265,6 +234,7 @@ enum SettingID
Debugger_TraceTLB,
Debugger_TraceProtectedMEM,
Debugger_TraceUserInterface,
+ Debugger_TraceRomList,
//Plugins
Plugin_RSP_Current,
@@ -313,6 +283,7 @@ enum SettingID
Cheat_Range,
Cheat_RangeNotes,
+ FirstUISettings, LastUISettings = FirstUISettings + MaxPluginSetting,
FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting,
FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting,
FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting,
diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp
index af5cb4891..d94b1f653 100644
--- a/Source/Project64-core/Settings/SettingsClass.cpp
+++ b/Source/Project64-core/Settings/SettingsClass.cpp
@@ -37,7 +37,7 @@
CSettings * g_Settings = NULL;
CSettings::CSettings() :
-m_NextAutoSettingId(0x200000)
+ m_NextAutoSettingId(0x200000)
{
}
@@ -84,9 +84,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
{
WriteTrace(TraceAppInit, TraceDebug, "Start");
- //information - temp keys
- AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false));
-
//Command Settings
AddHandler(Cmd_BaseDirectory, new CSettingTypeTempString(BaseDirectory));
AddHandler(Cmd_ShowHelp, new CSettingTypeTempBool(false));
@@ -105,12 +102,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config", "Project64.rdn"));
AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("", "ExtInfo", SupportFile_ExtInfoDefault));
AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config", "Project64.rdx"));
- AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("", "ShortCuts", SupportFile_ShortCutsDefault));
- AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config", "Project64.sc3"));
- AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", SupportFile_RomListCacheDefault));
- AddHandler(SupportFile_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3"));
- AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", SupportFile_7zipCacheDefault));
- AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache"));
//AddHandler(SyncPluginDir, new CSettingTypeRelativePath("SyncPlugin",""));
@@ -119,11 +110,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false));
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false));
AddHandler(Setting_CN64TimeCritical, new CSettingTypeApplication("", "CN64TimeCritical", false));
- AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false));
- AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true));
- AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true));
AddHandler(Setting_AutoStart, new CSettingTypeApplication("", "Auto Start", (uint32_t)true));
- AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("", "Auto Full Screen", (uint32_t)false));
AddHandler(Setting_AutoZipInstantSave, new CSettingTypeApplication("", "Auto Zip Saves", (uint32_t)true));
AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true));
AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true));
@@ -152,9 +139,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false));
AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true));
AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true));
- AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status", "Unknown"));
- AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note", ""));
- AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note", ""));
AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true));
AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", false));
AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false));
@@ -232,39 +216,11 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None));
//User Interface
- AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true));
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false));
AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("", "Display Frame Rate", (uint32_t)true));
- AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false));
AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("", "Frame Rate Display Type", (uint32_t)FR_VIs));
- AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window", "Top", Default_None));
- AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window", "Left", Default_None));
- AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("", "Always on top", (uint32_t)false));
-
- AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser", "Rom Browser", true));
- AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false));
- AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser", "Top", Default_None));
- AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser", "Left", Default_None));
- AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)640));
- AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)480));
- AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None));
- AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None));
- AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None));
- AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None));
- AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser", "Recursive", false));
- AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser", "Maximized", false));
-
- AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("", "Remembered Rom Dirs", (uint32_t)10));
- AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None));
-
- //Directory_Game,
- AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game", Directory_GameInitial, Directory_GameSelected, Directory_GameUseSelected, Directory_Game));
- AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory", ""));
- AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory", "Game", Directory_GameInitial));
- AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory", "Game - Use Selected", false));
-
AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected, Directory_Plugin));
-#ifdef _M_IX86
+#ifndef _M_X64
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", ""));
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial));
AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false));
@@ -301,7 +257,15 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Directory_LogSelected, new CSettingTypeApplicationPath("Directory", "Log Dir", Directory_InstantSaveInitial));
AddHandler(Directory_LogUseSelected, new CSettingTypeApplication("Directory", "Log Dir - Use Selected", false));
- AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave));
+ AddHandler(RomList_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3"));
+ AddHandler(RomList_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", RomList_RomListCacheDefault));
+ AddHandler(RomList_GameDir, new CSettingTypeSelectedDirectory("Dir:Game", RomList_GameDirInitial, RomList_GameDirSelected, RomList_GameDirUseSelected, RomList_GameDir));
+ AddHandler(RomList_GameDirInitial, new CSettingTypeRelativePath("Game Directory", ""));
+ AddHandler(RomList_GameDirSelected, new CSettingTypeApplication("Game Directory", "Directory", RomList_GameDirInitial));
+ AddHandler(RomList_GameDirUseSelected, new CSettingTypeApplication("Game Directory", "Use Selected", false));
+ AddHandler(RomList_GameDirRecursive, new CSettingTypeApplication("Game Directory", "Recursive", false));
+ AddHandler(RomList_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", RomList_7zipCacheDefault));
+ AddHandler(RomList_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache"));
AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false));
AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false));
@@ -312,8 +276,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60));
AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false));
- AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10));
- AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None));
+ AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true));
AddHandler(File_DiskIPLPath, new CSettingTypeApplicationPath("", "Disk IPL ROM Path", Default_None));
AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger", "Debugger", false));
@@ -347,6 +310,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Debugger_TraceTLB, new CSettingTypeApplication("Logging", "TLB", (uint32_t)g_ModuleLogLevel[TraceTLB]));
AddHandler(Debugger_TraceProtectedMEM, new CSettingTypeApplication("Logging", "Protected MEM", (uint32_t)g_ModuleLogLevel[TraceProtectedMem]));
AddHandler(Debugger_TraceUserInterface, new CSettingTypeApplication("Logging", "User Interface", (uint32_t)g_ModuleLogLevel[TraceUserInterface]));
+ AddHandler(Debugger_TraceRomList, new CSettingTypeApplication("Logging", "Rom List", (uint32_t)g_ModuleLogLevel[TraceUserInterface]));
//Plugin
AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll"));
@@ -469,8 +433,8 @@ void CSettings::SetSettingSz(CSettings * _this, SettingID ID, const char * Value
}
void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType,
- SettingType Type, const char * Category, const char * DefaultStr,
- uint32_t Value)
+ SettingType Type, const char * Category, const char * DefaultStr,
+ uint32_t Value)
{
switch (Type)
{
diff --git a/Source/Project64-core/Settings/SettingsClass.h b/Source/Project64-core/Settings/SettingsClass.h
index b614217d2..55384e2ce 100644
--- a/Source/Project64-core/Settings/SettingsClass.h
+++ b/Source/Project64-core/Settings/SettingsClass.h
@@ -103,9 +103,9 @@ public:
//Notification
void NotifyCallBacks(SettingID Type);
+ void AddHandler(SettingID TypeID, CSettingType * Handler);
private:
- void AddHandler(SettingID TypeID, CSettingType * Handler);
void AddHowToHandleSetting(const char * BaseDirectory);
void UnknownSetting(SettingID Type);
diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj
index 4e250ae8e..18cd3804f 100644
--- a/Source/Project64/Project64.vcxproj
+++ b/Source/Project64/Project64.vcxproj
@@ -54,6 +54,7 @@
+
Create
@@ -91,6 +92,9 @@
+
+
+
diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters
index 70fa2759d..74c85c08d 100644
--- a/Source/Project64/Project64.vcxproj.filters
+++ b/Source/Project64/Project64.vcxproj.filters
@@ -52,6 +52,9 @@
{c4249d55-df70-4453-b017-b548514ad094}
+
+ {8eaf5c00-c88d-418e-a27c-d658c547ab79}
+
@@ -156,6 +159,9 @@
Source Files\User Interface Source
+
+ Source Files\Settings Files
+
@@ -278,6 +284,15 @@
Header Files\User Interface Headers
+
+ Header Files\Settings
+
+
+ Header Files\Settings
+
+
+ Header Files\Settings
+
diff --git a/Source/Project64/Settings/GuiSettings.cpp b/Source/Project64/Settings/GuiSettings.cpp
index 8003eb37f..4f53f19e4 100644
--- a/Source/Project64/Settings/GuiSettings.cpp
+++ b/Source/Project64/Settings/GuiSettings.cpp
@@ -10,34 +10,33 @@
****************************************************************************/
#include "stdafx.h"
-int CGuiSettings::m_RefCount = 0;
-bool CGuiSettings::m_bCPURunning;
-bool CGuiSettings::m_bAutoSleep;
+int CGuiSettings::m_RefCount = 0;
+bool CGuiSettings::m_bCPURunning;
+bool CGuiSettings::m_bAutoSleep;
CGuiSettings::CGuiSettings()
-{
- m_RefCount += 1;
- if (m_RefCount == 1)
- {
- g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
- g_Settings->RegisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
- RefreshSettings(NULL);
- }
+{
+ m_RefCount += 1;
+ if (m_RefCount == 1)
+ {
+ g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
+ g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
+ RefreshSettings(NULL);
+ }
}
CGuiSettings::~CGuiSettings()
{
- m_RefCount -= 1;
- if (m_RefCount == 0)
- {
- g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
- g_Settings->UnregisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
- }
+ m_RefCount -= 1;
+ if (m_RefCount == 0)
+ {
+ g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
+ g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
+ }
}
void CGuiSettings::RefreshSettings(void *)
{
- m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
- m_bAutoSleep = g_Settings->LoadBool(Setting_AutoSleep);
+ m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
+ m_bAutoSleep = UISettingsLoadBool(Setting_AutoSleep);
}
-
diff --git a/Source/Project64/Settings/NotificationSettings.cpp b/Source/Project64/Settings/NotificationSettings.cpp
index b94460571..85676a682 100644
--- a/Source/Project64/Settings/NotificationSettings.cpp
+++ b/Source/Project64/Settings/NotificationSettings.cpp
@@ -20,17 +20,17 @@ CNotificationSettings::~CNotificationSettings()
{
if (g_Settings)
{
- g_Settings->UnregisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
+ g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
}
}
void CNotificationSettings::RegisterNotifications()
{
- g_Settings->RegisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
+ g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
void CNotificationSettings::RefreshSettings()
{
- m_bInFullScreen = g_Settings->LoadBool(UserInterface_InFullScreen);
+ m_bInFullScreen = UISettingsLoadBool(UserInterface_InFullScreen);
}
\ No newline at end of file
diff --git a/Source/Project64/UserInterface/GuiClass.cpp b/Source/Project64/UserInterface/GuiClass.cpp
index 31ecd1c5a..7621a7a15 100644
--- a/Source/Project64/UserInterface/GuiClass.cpp
+++ b/Source/Project64/UserInterface/GuiClass.cpp
@@ -47,9 +47,9 @@ CMainGui::CMainGui(bool bMainWindow, const char * WindowTitle) :
if (m_bMainWindow)
{
- g_Settings->RegisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
- g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
- g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
+ g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
+ g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
+ g_Settings->RegisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->RegisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
@@ -66,9 +66,9 @@ CMainGui::~CMainGui(void)
WriteTrace(TraceUserInterface, TraceDebug, "Start");
if (m_bMainWindow)
{
- g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
- g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
- g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
+ g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
+ g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
+ g_Settings->UnregisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
@@ -107,12 +107,12 @@ void CMainGui::AddRecentRom(const char * ImagePath)
if (HIWORD(ImagePath) == NULL) { return; }
//Get Information about the stored rom list
- size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount);
+ size_t MaxRememberedFiles = UISettingsLoadDword(File_RecentGameFileCount);
strlist RecentGames;
size_t i;
for (i = 0; i < MaxRememberedFiles; i++)
{
- stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex, i);
+ stdstr RecentGame = UISettingsLoadStringIndex(File_RecentGameFileIndex, i);
if (RecentGame.empty())
{
break;
@@ -139,7 +139,7 @@ void CMainGui::AddRecentRom(const char * ImagePath)
for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++)
{
- g_Settings->SaveStringIndex(File_RecentGameFileIndex, i, *iter);
+ UISettingsSaveStringIndex(File_RecentGameFileIndex, i, *iter);
}
}
@@ -148,14 +148,14 @@ void CMainGui::SetWindowCaption(const wchar_t * title)
static const size_t TITLE_SIZE = 256;
wchar_t WinTitle[TITLE_SIZE];
- _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", title, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str());
+ _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", title, stdstr(g_Settings->LoadStringVal(Setting_ApplicationName)).ToUTF16().c_str());
WinTitle[TITLE_SIZE - 1] = 0;
Caption(WinTitle);
}
void CMainGui::ShowRomBrowser(void)
{
- if (g_Settings->LoadDword(RomBrowser_Enabled))
+ if (UISettingsLoadBool(RomBrowser_Enabled))
{
ShowRomList();
HighLightLastRom();
@@ -164,7 +164,7 @@ void CMainGui::ShowRomBrowser(void)
void RomBowserEnabledChanged(CMainGui * Gui)
{
- if (Gui && g_Settings->LoadBool(RomBrowser_Enabled))
+ if (Gui && UISettingsLoadBool(RomBrowser_Enabled))
{
if (!Gui->RomBrowserVisible())
{
@@ -186,7 +186,7 @@ void CMainGui::LoadingInProgressChanged(CMainGui * Gui)
if (!g_Settings->LoadBool(GameRunning_LoadingInProgress) && g_Settings->LoadStringVal(Game_File).length() == 0)
{
Notify().WindowMode();
- if (g_Settings->LoadDword(RomBrowser_Enabled))
+ if (UISettingsLoadBool(RomBrowser_Enabled))
{
Gui->ShowRomBrowser();
}
@@ -201,7 +201,7 @@ void CMainGui::GameLoaded(CMainGui * Gui)
{
WriteTrace(TraceUserInterface, TraceDebug, "Add Recent Rom");
Gui->AddRecentRom(FileLoc.c_str());
- Gui->SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str());
+ Gui->SetWindowCaption(stdstr(g_Settings->LoadStringVal(Game_GoodName)).ToUTF16().c_str());
Gui->HideRomList();
}
}
@@ -215,12 +215,12 @@ void CMainGui::GameCpuRunning(CMainGui * Gui)
{
if (g_Settings->LoadBool(GameRunning_CPU_Running))
{
- Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
- if (g_Settings->LoadBool(Setting_AutoFullscreen))
+ Gui->MakeWindowOnTop(UISettingsLoadBool(UserInterface_AlwaysOnTop));
+ if (UISettingsLoadBool(Setting_AutoFullscreen))
{
WriteTrace(TraceUserInterface, TraceDebug, "15");
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
- stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
+ std::string Status = UISettingsLoadStringVal(Rdb_Status);
char String[100];
RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String));
@@ -633,16 +633,16 @@ void CMainGui::SaveWindowLoc(void)
if (m_SaveMainWindowPos)
{
m_SaveMainWindowPos = false;
- g_Settings->SaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop);
- g_Settings->SaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft);
+ UISettingsSaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop);
+ UISettingsSaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft);
flush = true;
}
if (m_SaveRomBrowserPos)
{
m_SaveRomBrowserPos = false;
- g_Settings->SaveDword(RomBrowser_Top, m_SaveRomBrowserTop);
- g_Settings->SaveDword(RomBrowser_Left, m_SaveRomBrowserLeft);
+ UISettingsSaveDword(RomBrowser_Top, m_SaveRomBrowserTop);
+ UISettingsSaveDword(RomBrowser_Left, m_SaveRomBrowserLeft);
flush = true;
}
@@ -670,8 +670,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
int X = (GetSystemMetrics(SM_CXSCREEN) - _this->Width()) / 2;
int Y = (GetSystemMetrics(SM_CYSCREEN) - _this->Height()) / 2;
- g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
- g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
+ UISettingsLoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
+ UISettingsLoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
_this->SetPos(X, Y);
@@ -687,7 +687,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
if (_this &&
_this->bCPURunning() &&
!g_Settings->LoadBool(GameRunning_CPU_Paused) &&
- g_Settings->LoadDword(Setting_DisableScrSaver))
+ UISettingsLoadBool(Setting_DisableScrSaver))
{
return 0;
}
@@ -906,7 +906,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
}
if (_this->m_bMainWindow && bCPURunning())
{
- if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen))
+ if (!fActive && UISettingsLoadBool(UserInterface_InFullScreen))
{
Notify().WindowMode();
if (bAutoSleep() && g_BaseSystem)
@@ -962,7 +962,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
Notify().WindowMode();
- if (g_Settings->LoadDword(RomBrowser_Enabled))
+ if (UISettingsLoadBool(RomBrowser_Enabled))
{
_this->ShowRomBrowser();
}
@@ -991,7 +991,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename));
- strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
+ strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
@@ -1022,7 +1022,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename));
- strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
+ strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
@@ -1163,7 +1163,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename));
- strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
+ strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
@@ -1210,7 +1210,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
return TRUE;
}
-DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
+DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lParam*/)
{
static HBITMAP hbmpBackgroundTop = NULL;
static HFONT hPageHeadingFont = NULL;
diff --git a/Source/Project64/UserInterface/MainMenuClass.cpp b/Source/Project64/UserInterface/MainMenuClass.cpp
index 83d2801c1..5ac828a2c 100644
--- a/Source/Project64/UserInterface/MainMenuClass.cpp
+++ b/Source/Project64/UserInterface/MainMenuClass.cpp
@@ -13,10 +13,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
hMainWindow->SetWindowMenu(this);
- m_ChangeSettingList.push_back(Info_ShortCutsChanged);
+ m_ChangeUISettingList.push_back(Info_ShortCutsChanged);
m_ChangeSettingList.push_back(GameRunning_LimitFPS);
- m_ChangeSettingList.push_back(UserInterface_InFullScreen);
- m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop);
+ m_ChangeUISettingList.push_back(UserInterface_InFullScreen);
+ m_ChangeUISettingList.push_back(UserInterface_AlwaysOnTop);
m_ChangeSettingList.push_back(UserInterface_ShowCPUPer);
m_ChangeSettingList.push_back(Logging_GenerateLog);
m_ChangeSettingList.push_back(Debugger_ProfileCode);
@@ -50,6 +50,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
m_ChangeSettingList.push_back(Game_CurrentSaveState);
m_ChangeSettingList.push_back(Setting_CurrentLanguage);
+ for (UISettingList::const_iterator iter = m_ChangeUISettingList.begin(); iter != m_ChangeUISettingList.end(); iter++)
+ {
+ g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + *iter), this, (CSettings::SettingChangedFunc)SettingsChanged);
+ }
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
{
g_Settings->RegisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
@@ -58,6 +62,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
CMainMenu::~CMainMenu()
{
+ for (UISettingList::const_iterator iter = m_ChangeUISettingList.begin(); iter != m_ChangeUISettingList.end(); iter++)
+ {
+ g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + *iter), this, (CSettings::SettingChangedFunc)SettingsChanged);
+ }
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
{
g_Settings->UnregisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
@@ -88,7 +96,7 @@ stdstr CMainMenu::ChooseFileToOpen(HWND hParent)
memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename));
- strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
+ strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hParent;
@@ -140,7 +148,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename));
- strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
+ strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
@@ -234,7 +242,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
memset(&SaveFile, 0, sizeof(SaveFile));
memset(&openfilename, 0, sizeof(openfilename));
- g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
+ UISettingsLoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
@@ -261,7 +269,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
char SaveDir[MAX_PATH];
_makepath(SaveDir, drive, dir, NULL, NULL);
- g_Settings->SaveString(Directory_LastSave, SaveDir);
+ UISettingsSaveString(Directory_LastSave, SaveDir);
g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState);
}
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame);
@@ -276,7 +284,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
memset(&SaveFile, 0, sizeof(SaveFile));
memset(&openfilename, 0, sizeof(openfilename));
- g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
+ UISettingsLoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = (HWND)hWnd;
@@ -293,7 +301,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
char SaveDir[MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
_splitpath(SaveFile, drive, dir, fname, ext);
_makepath(SaveDir, drive, dir, NULL, NULL);
- g_Settings->SaveString(Directory_LastSave, SaveDir);
+ UISettingsSaveString(Directory_LastSave, SaveDir);
g_System->LoadState();
}
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame);
@@ -335,7 +343,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen);
break;
case ID_OPTIONS_FULLSCREEN2:
- if (g_Settings->LoadBool(UserInterface_InFullScreen))
+ if (UISettingsLoadBool(UserInterface_InFullScreen))
{
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN a");
m_Gui->MakeWindowOnTop(false);
@@ -345,8 +353,8 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
WriteTrace(TraceGFXPlugin, TraceDebug, "ChangeWindow: Done");
ShowCursor(true);
m_Gui->ShowStatusBar(true);
- m_Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
- g_Settings->SaveBool(UserInterface_InFullScreen, (DWORD)false);
+ m_Gui->MakeWindowOnTop(UISettingsLoadBool(UserInterface_AlwaysOnTop));
+ UISettingsSaveBool(UserInterface_InFullScreen, (DWORD)false);
}
else
{
@@ -373,20 +381,20 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 5");
Notify().SetGfxPlugin(g_Plugins->Gfx());
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 3");
- g_Settings->SaveBool(UserInterface_InFullScreen, true);
+ UISettingsSaveBool(UserInterface_InFullScreen, true);
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 6");
}
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN 1");
break;
case ID_OPTIONS_ALWAYSONTOP:
- if (g_Settings->LoadDword(UserInterface_AlwaysOnTop))
+ if (UISettingsLoadBool(UserInterface_AlwaysOnTop))
{
- g_Settings->SaveBool(UserInterface_AlwaysOnTop, false);
+ UISettingsSaveBool(UserInterface_AlwaysOnTop, false);
m_Gui->MakeWindowOnTop(false);
}
else
{
- g_Settings->SaveBool(UserInterface_AlwaysOnTop, true);
+ UISettingsSaveBool(UserInterface_AlwaysOnTop, true);
m_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running));
}
break;
@@ -517,7 +525,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END)
{
stdstr FileName;
- if (g_Settings->LoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) &&
+ if (UISettingsLoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) &&
FileName.length() > 0)
{
g_BaseSystem->RunFileImage(FileName.c_str());
@@ -526,10 +534,10 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END)
{
int Offset = MenuID - ID_RECENT_DIR_START;
- stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, Offset);
+ stdstr Dir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, Offset);
if (Dir.length() > 0)
{
- g_Settings->SaveString(Directory_Game, Dir.c_str());
+ g_Settings->SaveString(RomList_GameDir, Dir.c_str());
Notify().AddRecentDir(Dir.c_str());
m_Gui->RefreshMenu();
if (m_Gui->RomBrowserVisible())
@@ -668,12 +676,12 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress);
bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0;
- bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning;
+ bool RomList = UISettingsLoadBool(RomBrowser_Enabled) && !CPURunning;
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
if (g_Settings->LoadBool(GameRunning_CPU_Running))
{
- AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
+ AccessLevel = UISettingsLoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
}
//Get the system information to make the menu
@@ -693,11 +701,11 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
//Go through the settings to create a list of Recent Roms
MenuItemList RecentRomMenu;
- DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount);
+ DWORD count, RomsToRemember = UISettingsLoadDword(File_RecentGameFileCount);
for (count = 0; count < RomsToRemember; count++)
{
- stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, count);
+ stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, count);
if (LastRom.empty())
{
break;
@@ -710,11 +718,11 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
/* Recent Dir
****************/
MenuItemList RecentDirMenu;
- DWORD DirsToRemember = g_Settings->LoadDword(Directory_RecentGameDirCount);
+ DWORD DirsToRemember = UISettingsLoadDword(Directory_RecentGameDirCount);
for (count = 0; count < DirsToRemember; count++)
{
- stdstr LastDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, count);
+ stdstr LastDir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, count);
if (LastDir.empty())
{
break;
@@ -886,7 +894,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
if (!inBasicMode)
{
Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP, m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP, AccessLevel));
- if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); }
+ if (UISettingsLoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); }
Item.SetItemEnabled(CPURunning);
OptionMenu.push_back(Item);
}
@@ -1241,7 +1249,7 @@ void CMainMenu::RebuildAccelerators(void)
void CMainMenu::ResetMenu(void)
{
WriteTrace(TraceUserInterface, TraceDebug, "Start");
- if (!g_Settings->LoadBool(UserInterface_InFullScreen))
+ if (!UISettingsLoadBool(UserInterface_InFullScreen))
{
//Create a new window with all the items
WriteTrace(TraceUserInterface, TraceDebug, "Create Menu");
diff --git a/Source/Project64/UserInterface/MainMenuClass.h b/Source/Project64/UserInterface/MainMenuClass.h
index d9c3dd43b..d00474463 100644
--- a/Source/Project64/UserInterface/MainMenuClass.h
+++ b/Source/Project64/UserInterface/MainMenuClass.h
@@ -1,4 +1,5 @@
#pragma once
+#include
enum MainMenuID
{
@@ -82,12 +83,14 @@ private:
static void SettingsChanged(CMainMenu * _this);
typedef std::list SettingList;
+ typedef std::list UISettingList;
CMainGui * m_Gui;
- void * m_AccelTable;
- bool m_ResetAccelerators;
- CShortCuts m_ShortCuts;
- SettingList m_ChangeSettingList;
+ void * m_AccelTable;
+ bool m_ResetAccelerators;
+ CShortCuts m_ShortCuts;
+ SettingList m_ChangeSettingList;
+ UISettingList m_ChangeUISettingList;
CriticalSection m_CS;
};
diff --git a/Source/Project64/UserInterface/MenuShortCuts.cpp b/Source/Project64/UserInterface/MenuShortCuts.cpp
index 74de71e60..25e50c116 100644
--- a/Source/Project64/UserInterface/MenuShortCuts.cpp
+++ b/Source/Project64/UserInterface/MenuShortCuts.cpp
@@ -350,7 +350,7 @@ void CShortCuts::Load(bool InitialValues)
AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING);
AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN);
- CPath ShortCutFile = g_Settings->LoadStringVal(SupportFile_ShortCuts);
+ CPath ShortCutFile = UISettingsLoadStringVal(SupportFile_ShortCuts);
if (!ShortCutFile.Exists() || InitialValues)
{
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O', TRUE, false, false, CMenuShortCutKey::GAME_RUNNING);
@@ -422,7 +422,7 @@ void CShortCuts::Save(void)
{
CGuard CS(m_CS);
- stdstr FileName = g_Settings->LoadStringVal(SupportFile_ShortCuts);
+ stdstr FileName = UISettingsLoadStringVal(SupportFile_ShortCuts);
FILE *file = fopen(FileName.c_str(), "w");
if (file == NULL)
{
@@ -455,9 +455,7 @@ HACCEL CShortCuts::GetAcceleratorTable(void)
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
if (g_Settings->LoadBool(GameRunning_CPU_Running))
{
- AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ?
- CMenuShortCutKey::GAME_RUNNING_FULLSCREEN :
- CMenuShortCutKey::GAME_RUNNING_WINDOW;
+ AccessLevel = UISettingsLoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
}
int size = 0, MaxSize = m_ShortCuts.size() * 5;
diff --git a/Source/Project64/UserInterface/NotificationClass.cpp b/Source/Project64/UserInterface/NotificationClass.cpp
index e4beee6d9..c04b21087 100644
--- a/Source/Project64/UserInterface/NotificationClass.cpp
+++ b/Source/Project64/UserInterface/NotificationClass.cpp
@@ -17,6 +17,7 @@ CNotificationImp::CNotificationImp() :
void CNotificationImp::AppInitDone(void)
{
+ RegisterUISettings();
CNotificationSettings::RegisterNotifications();
}
@@ -159,12 +160,12 @@ void CNotificationImp::AddRecentDir(const char * RomDir)
if (HIWORD(RomDir) == NULL) { return; }
//Get Information about the stored rom list
- size_t MaxRememberedDirs = g_Settings->LoadDword(Directory_RecentGameDirCount);
+ size_t MaxRememberedDirs = UISettingsLoadDword(Directory_RecentGameDirCount);
strlist RecentDirs;
size_t i;
for (i = 0; i < MaxRememberedDirs; i++)
{
- stdstr RecentDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, i);
+ stdstr RecentDir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, i);
if (RecentDir.empty())
{
break;
@@ -191,7 +192,7 @@ void CNotificationImp::AddRecentDir(const char * RomDir)
for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++)
{
- g_Settings->SaveStringIndex(Directory_RecentGameDirIndex, i, *iter);
+ UISettingsSaveStringIndex(Directory_RecentGameDirIndex, i, *iter);
}
}
@@ -211,7 +212,7 @@ void CNotificationImp::HideRomBrowser(void)
void CNotificationImp::ShowRomBrowser(void)
{
if (m_hWnd == NULL) { return; }
- if (g_Settings->LoadDword(RomBrowser_Enabled))
+ if (UISettingsLoadBool(RomBrowser_Enabled))
{
//Display the rom browser
m_hWnd->ShowRomList();
diff --git a/Source/Project64/UserInterface/RomBrowser.h b/Source/Project64/UserInterface/RomBrowser.h
index 99b5f9aeb..31a4afba1 100644
--- a/Source/Project64/UserInterface/RomBrowser.h
+++ b/Source/Project64/UserInterface/RomBrowser.h
@@ -11,6 +11,7 @@
#pragma once
#include
+#include
class CMainGui;
class CPlugins;
@@ -37,8 +38,8 @@ public:
{
if (!UseDefault)
{
- m_PosChanged = g_Settings->LoadDwordIndex(RomBrowser_PosIndex, m_ID, (uint32_t &)m_Pos);
- g_Settings->LoadDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
+ m_PosChanged = UISettingsLoadDwordIndex(RomBrowser_PosIndex, m_ID, (uint32_t &)m_Pos);
+ UISettingsLoadDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
}
}
inline LPCSTR Name(void) const { return m_Name.c_str(); }
@@ -51,18 +52,18 @@ public:
void SetColWidth(int ColWidth)
{
m_ColWidth = ColWidth;
- g_Settings->SaveDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
+ UISettingsSaveDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
}
void SetColPos(int Pos)
{
m_Pos = Pos;
- g_Settings->SaveDwordIndex(RomBrowser_PosIndex, m_ID, m_Pos);
+ UISettingsSaveDwordIndex(RomBrowser_PosIndex, m_ID, m_Pos);
m_PosChanged = true;
}
void ResetPos(void)
{
m_Pos = m_DefaultPos;
- g_Settings->DeleteSettingIndex(RomBrowser_PosIndex, m_ID);
+ UISettingsDeleteSettingIndex(RomBrowser_PosIndex, m_ID);
m_PosChanged = false;
}
};
@@ -81,6 +82,28 @@ struct SORT_FIELD
class C7zip;
class CRomBrowser
{
+public:
+ CRomBrowser(HWND & hMainWindow, HWND & StatusWindow);
+ ~CRomBrowser(void);
+ void HighLightLastRom(void);
+ void HideRomList(void);
+ void RefreshRomBrowser(void);
+ void ResetRomBrowserColomuns(void);
+ void ResizeRomList(WORD nWidth, WORD nHeight);
+ void RomBrowserToTop(void);
+ void RomBrowserMaximize(bool Mazimize);
+ bool RomBrowserVisible(void);
+ bool RomListDrawItem(int idCtrl, uint32_t lParam);
+ bool RomListNotify(int idCtrl, uint32_t pnmh);
+ void SaveRomListColoumnInfo(void);
+ void SelectRomDir(void);
+ void ShowRomList(void);
+ bool ShowingRomBrowser(void) { return m_ShowingRomBrowser; }
+ const char * CurrentedSelectedRom(void) { return m_SelectedRom.c_str(); }
+
+ static void GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault = false);
+
+private:
enum { IDC_ROMLIST = 223 };
enum
{
@@ -136,24 +159,6 @@ class CRomBrowser
typedef std::vector ROMINFO_LIST;
- HWND & m_MainWindow;
- HWND & m_StatusWindow;
- HWND m_hRomList;
- ROMBROWSER_FIELDS_LIST m_Fields;
- FIELD_TYPE_LIST m_FieldType;
- ROMINFO_LIST m_RomInfo;
- std::string m_SelectedRom;
- bool m_Visible;
- bool m_ShowingRomBrowser;
- HANDLE m_RefreshThread;
- bool m_StopRefresh;
- CIniFile * m_RomIniFile;
- CIniFile * m_NotesIniFile;
- CIniFile * m_ExtIniFile;
- CIniFile * m_ZipIniFile;
- bool m_AllowSelectionLastRom;
- static std::wstring m_UnknownGoodName;
-
void AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File);
void AddRomToList(const char * RomLocation, const char * lpLastRom);
void AddRomInfoToList(ROM_INFO &RomInfo, const char * lpLastRom);
@@ -164,7 +169,7 @@ class CRomBrowser
void DeallocateBrushs(void);
void FillRomExtensionInfo(ROM_INFO * pRomInfo);
bool FillRomInfo(ROM_INFO * pRomInfo);
- void FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom);
+ void FillRomList(strlist & FileList, const CPath & BaseDirectory, const char * Directory, const char * lpLastRom);
void FixRomListWindow(void);
static int32_t GetCicChipID(uint8_t * RomData);
bool LoadDataFromRomFile(const char * FileName, uint8_t * Data, int32_t DataLen, int32_t * RomSize, FILE_FORMAT & FileFormat);
@@ -176,7 +181,7 @@ class CRomBrowser
void RomList_OpenRom(uint32_t pnmh);
void RomList_PopupMenu(uint32_t pnmh);
void RomList_SortList(void);
- bool GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, bool InWatchThread);
+ bool GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const std::string & Directory, bool InWatchThread);
MD5 RomListHash(strlist & FileList);
static void NotificationCB(const char * Status, CRomBrowser * _this);
@@ -196,24 +201,21 @@ class CRomBrowser
static int CALLBACK SelectRomDirCallBack(HWND hwnd, uint32_t uMsg, uint32_t lp, uint32_t lpData);
static int CALLBACK RomList_CompareItems(uint32_t lParam1, uint32_t lParam2, uint32_t lParamSort);
-public:
- CRomBrowser(HWND & hMainWindow, HWND & StatusWindow);
- ~CRomBrowser(void);
- void HighLightLastRom(void);
- void HideRomList(void);
- void RefreshRomBrowser(void);
- void ResetRomBrowserColomuns(void);
- void ResizeRomList(WORD nWidth, WORD nHeight);
- void RomBrowserToTop(void);
- void RomBrowserMaximize(bool Mazimize);
- bool RomBrowserVisible(void);
- bool RomListDrawItem(int idCtrl, uint32_t lParam);
- bool RomListNotify(int idCtrl, uint32_t pnmh);
- void SaveRomListColoumnInfo(void);
- void SelectRomDir(void);
- void ShowRomList(void);
- bool ShowingRomBrowser(void) { return m_ShowingRomBrowser; }
- const char * CurrentedSelectedRom(void) { return m_SelectedRom.c_str(); }
-
- static void GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault = false);
+ HWND & m_MainWindow;
+ HWND & m_StatusWindow;
+ HWND m_hRomList;
+ ROMBROWSER_FIELDS_LIST m_Fields;
+ FIELD_TYPE_LIST m_FieldType;
+ ROMINFO_LIST m_RomInfo;
+ std::string m_SelectedRom;
+ bool m_Visible;
+ bool m_ShowingRomBrowser;
+ HANDLE m_RefreshThread;
+ bool m_StopRefresh;
+ CIniFile * m_RomIniFile;
+ CIniFile * m_NotesIniFile;
+ CIniFile * m_ExtIniFile;
+ CIniFile * m_ZipIniFile;
+ bool m_AllowSelectionLastRom;
+ static std::wstring m_UnknownGoodName;
};
diff --git a/Source/Project64/UserInterface/RomBrowserClass.cpp b/Source/Project64/UserInterface/RomBrowserClass.cpp
index 76028bbc9..22492304d 100644
--- a/Source/Project64/UserInterface/RomBrowserClass.cpp
+++ b/Source/Project64/UserInterface/RomBrowserClass.cpp
@@ -9,6 +9,7 @@
* *
****************************************************************************/
#include "stdafx.h"
+#include
#include
#include
@@ -16,23 +17,23 @@
std::wstring CRomBrowser::m_UnknownGoodName;
CRomBrowser::CRomBrowser(HWND & MainWindow, HWND & StatusWindow) :
-m_MainWindow(MainWindow),
-m_StatusWindow(StatusWindow),
-m_ShowingRomBrowser(false),
-m_RefreshThread(NULL),
-m_RomIniFile(NULL),
-m_NotesIniFile(NULL),
-m_ExtIniFile(NULL),
-m_ZipIniFile(NULL),
-m_AllowSelectionLastRom(true),
-m_WatchThreadID(0)
+ m_MainWindow(MainWindow),
+ m_StatusWindow(StatusWindow),
+ m_ShowingRomBrowser(false),
+ m_RefreshThread(NULL),
+ m_RomIniFile(NULL),
+ m_NotesIniFile(NULL),
+ m_ExtIniFile(NULL),
+ m_ZipIniFile(NULL),
+ m_AllowSelectionLastRom(true),
+ m_WatchThreadID(0)
{
if (g_Settings)
{
m_RomIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_NotesIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Notes).c_str());
m_ExtIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str());
- m_ZipIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_7zipCache).c_str());
+ m_ZipIniFile = new CIniFile(g_Settings->LoadStringVal(RomList_7zipCache).c_str());
}
m_hRomList = 0;
@@ -114,7 +115,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
for (int32_t SortIndex = NoOfSortKeys; SortIndex >= 0; SortIndex--)
{
- stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
+ std::string SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
if (SortFieldName.length() == 0)
{
continue;
@@ -134,7 +135,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
SORT_FIELD SortFieldInfo;
SortFieldInfo._this = this;
SortFieldInfo.Key = index;
- SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
+ SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
//calc new start and end
int32_t LastTestPos = -1;
@@ -253,7 +254,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
//Compare end with item to see if we should do it after or before it
for (int32_t SortIndex = 0; SortIndex < NoOfSortKeys; SortIndex++)
{
- stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
+ std::string SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
if (SortFieldName.length() == 0)
{
continue;
@@ -268,7 +269,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
SORT_FIELD SortFieldInfo;
SortFieldInfo._this = this;
SortFieldInfo.Key = index;
- SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex) != 0;
+ SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex) != 0;
LVITEMW lvItem;
memset(&lvItem, 0, sizeof(LVITEMW));
@@ -312,9 +313,7 @@ void CRomBrowser::AddRomInfoToList(ROM_INFO &RomInfo, const char * lpLastRom)
lvItem.pszText = LPSTR_TEXTCALLBACKW;
int32_t index = ListView_InsertItem(m_hRomList, &lvItem);
-
int32_t iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
- //if (iItem == -1) { return; }
//if the last rom then highlight the item
if (iItem < 0 && _stricmp(RomInfo.szFullFileName, lpLastRom) == 0)
@@ -511,7 +510,7 @@ bool CRomBrowser::FillRomInfo(ROM_INFO * pRomInfo)
}
}
-bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, bool InWatchThread)
+bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const std::string & Directory, bool InWatchThread)
{
if (!BaseDirectory.DirectoryExists())
{
@@ -534,9 +533,10 @@ bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirector
if (SearchPath.IsDirectory())
{
- if (g_Settings->LoadDword(RomBrowser_Recursive))
+ if (g_Settings->LoadBool(RomList_GameDirRecursive))
{
- stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
+ CPath CurrentDir(Directory);
+ CurrentDir.AppendDirectory(SearchPath.GetLastDirectory().c_str());
GetRomFileNames(FileList, BaseDirectory, CurrentDir, InWatchThread);
}
}
@@ -582,10 +582,10 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory
}
}
-void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom)
+void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const char * Directory, const char * lpLastRom)
{
- CPath SearchPath(BaseDirectory, "*.*");
- SearchPath.AppendDirectory(Directory.c_str());
+ CPath SearchPath(BaseDirectory, "*");
+ SearchPath.AppendDirectory(Directory);
WriteTrace(TraceUserInterface, TraceDebug, "1 %s", (const char *)SearchPath);
if (!SearchPath.FindFirst(CPath::FIND_ATTRIBUTE_ALLFILES))
@@ -604,9 +604,10 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
if (SearchPath.IsDirectory())
{
- if (g_Settings->LoadDword(RomBrowser_Recursive))
+ if (g_Settings->LoadBool(RomList_GameDirRecursive))
{
- stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
+ CPath CurrentDir(Directory);
+ CurrentDir.AppendDirectory(SearchPath.GetLastDirectory().c_str());
FillRomList(FileList, BaseDirectory, CurrentDir, lpLastRom);
}
continue;
@@ -614,8 +615,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
AddFileNameToList(FileList, Directory, SearchPath);
- stdstr Extension = SearchPath.GetExtension();
- Extension.ToLower();
+ stdstr Extension = stdstr(SearchPath.GetExtension()).ToLower();
for (ext_ID = 0; ext_ID < exts; ext_ID++)
{
@@ -719,7 +719,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
const char backup_character = szHeader[2 * x + delimit_offset];
szHeader[2 * x + delimit_offset] = '\0';
- *(uint32_t *)&RomData[x] = std::strtoul(&szHeader[2 * x], NULL, 16);
+ *(uint32_t *)&RomData[x] = strtoul(&szHeader[2 * x], NULL, 16);
szHeader[2 * x + delimit_offset] = backup_character;
}
@@ -809,7 +809,7 @@ void CRomBrowser::HighLightLastRom(void)
if (!RomBrowserVisible()) { return; }
//Get the string to the last rom
- stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, 0);
+ stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
LPCSTR lpLastRom = LastRom.c_str();
LVITEMW lvItem;
@@ -858,8 +858,8 @@ bool CRomBrowser::LoadDataFromRomFile(const char * FileName, uint8_t * Data, int
if (file == NULL) { return false; }
port = unzGoToFirstFile(file);
- FoundRom = FALSE;
- while (port == UNZ_OK && FoundRom == FALSE)
+ FoundRom = false;
+ while (port == UNZ_OK && FoundRom == false)
{
unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0);
if (unzLocateFile(file, zname, 1) != UNZ_OK)
@@ -959,34 +959,35 @@ void CRomBrowser::ByteSwapRomData(uint8_t * Data, int32_t DataLen)
void CRomBrowser::LoadRomList(void)
{
- stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
+ CPath FileName(g_Settings->LoadStringVal(RomList_RomListCache));
+ CFile file(FileName, CFileBase::modeRead | CFileBase::modeNoTruncate);
- //Open the cache file
- HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
- if (hFile == INVALID_HANDLE_VALUE)
+ if (!file.IsOpen())
{
//if file does not exist then refresh the data
RefreshRomBrowser();
return;
}
-
- DWORD dwRead;
unsigned char md5[16];
- ReadFile(hFile, &md5, sizeof(md5), &dwRead, NULL);
+ if (!file.Read(md5, sizeof(md5)))
+ {
+ file.Close();
+ RefreshRomBrowser();
+ return;
+ }
//Read the size of ROM_INFO
- int32_t RomInfoSize = 0;
- ReadFile(hFile, &RomInfoSize, sizeof(RomInfoSize), &dwRead, NULL);
- if (RomInfoSize != sizeof(ROM_INFO) || dwRead != sizeof(RomInfoSize))
+ int32_t RomInfoSize = 0;
+ if (!file.Read(&RomInfoSize, sizeof(RomInfoSize)) || RomInfoSize != sizeof(ROM_INFO))
{
- CloseHandle(hFile);
+ file.Close();
RefreshRomBrowser();
return;
}
//Read the Number of entries
int32_t Entries = 0;
- ReadFile(hFile, &Entries, sizeof(Entries), &dwRead, NULL);
+ file.Read(&Entries, sizeof(Entries));
//Read Every Entry
DeallocateBrushs();
@@ -994,7 +995,7 @@ void CRomBrowser::LoadRomList(void)
for (int32_t count = 0; count < Entries; count++)
{
ROM_INFO RomInfo;
- ReadFile(hFile, &RomInfo, RomInfoSize, &dwRead, NULL);
+ file.Read(&RomInfo, RomInfoSize);
RomInfo.SelColorBrush = NULL;
LVITEMW lvItem;
@@ -1007,7 +1008,6 @@ void CRomBrowser::LoadRomList(void)
SendMessageW(m_hRomList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
m_RomInfo.push_back(RomInfo);
}
- CloseHandle(hFile);
AllocateBrushs();
RomList_SortList();
}
@@ -1055,8 +1055,7 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
if (_this->m_hRomList == NULL) { return; }
//delete cache
- stdstr CacheFileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
- DeleteFile(CacheFileName.c_str());
+ CPath(g_Settings->LoadStringVal(RomList_RomListCache)).Delete();
//clear all current items
WriteTrace(TraceUserInterface, TraceDebug, "1");
@@ -1068,7 +1067,7 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
Sleep(100);
WriteTrace(TraceUserInterface, TraceDebug, "3");
- if (_this->m_WatchRomDir != g_Settings->LoadStringVal(Directory_Game))
+ if (_this->m_WatchRomDir != g_Settings->LoadStringVal(RomList_GameDir))
{
WriteTrace(TraceUserInterface, TraceDebug, "4");
_this->WatchThreadStop();
@@ -1078,12 +1077,12 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
}
WriteTrace(TraceUserInterface, TraceDebug, "7");
- stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
- stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, 0);
+ stdstr RomDir = g_Settings->LoadStringVal(RomList_GameDir);
+ stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
WriteTrace(TraceUserInterface, TraceDebug, "8");
strlist FileNames;
- _this->FillRomList(FileNames, CPath(RomDir), stdstr(""), LastRom.c_str());
+ _this->FillRomList(FileNames, CPath(RomDir), "", LastRom.c_str());
WriteTrace(TraceUserInterface, TraceDebug, "9");
_this->SaveRomList(FileNames);
WriteTrace(TraceUserInterface, TraceDebug, "10");
@@ -1141,15 +1140,15 @@ void CRomBrowser::ResizeRomList(WORD nWidth, WORD nHeight)
{
if (RomBrowserVisible())
{
- if (g_Settings->LoadDword(RomBrowser_Maximized) == 0 && nHeight != 0)
+ if (UISettingsLoadBool(RomBrowser_Maximized) == 0 && nHeight != 0)
{
- if (g_Settings->LoadDword(RomBrowser_Width) != nWidth)
+ if (UISettingsLoadDword(RomBrowser_Width) != nWidth)
{
- g_Settings->SaveDword(RomBrowser_Width, nWidth);
+ UISettingsSaveDword(RomBrowser_Width, nWidth);
}
- if (g_Settings->LoadDword(RomBrowser_Height) != nHeight)
+ if (UISettingsLoadDword(RomBrowser_Height) != nHeight)
{
- g_Settings->SaveDword(RomBrowser_Height, nHeight);
+ UISettingsSaveDword(RomBrowser_Height, nHeight);
}
}
if (IsWindow((HWND)m_StatusWindow))
@@ -1179,7 +1178,7 @@ void CRomBrowser::RomBrowserToTop(void)
void CRomBrowser::RomBrowserMaximize(bool Mazimize)
{
- g_Settings->SaveDword(RomBrowser_Maximized, (uint32_t)Mazimize);
+ UISettingsSaveBool(RomBrowser_Maximized, Mazimize);
}
bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
@@ -1275,14 +1274,14 @@ bool CRomBrowser::RomListNotify(int32_t idCtrl, uint32_t pnmh)
case LVN_GETDISPINFOW: RomList_GetDispInfo(pnmh); break;
case NM_RCLICK: RomList_PopupMenu(pnmh); break;
case NM_CLICK:
- {
- LONG iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
- if (iItem != -1)
{
- m_AllowSelectionLastRom = false;
+ LONG iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
+ if (iItem != -1)
+ {
+ m_AllowSelectionLastRom = false;
+ }
}
- }
- break;
+ break;
default:
return false;
}
@@ -1299,9 +1298,9 @@ void CRomBrowser::RomList_ColoumnSortList(uint32_t pnmh)
if (m_Fields[index].Pos() == (size_t)pnmv->iSubItem) { break; }
}
if (m_Fields.size() == index) { return; }
- if (_stricmp(g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, 0).c_str(), m_Fields[index].Name()) == 0)
+ if (_stricmp(UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, 0).c_str(), m_Fields[index].Name()) == 0)
{
- g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, 0, !g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, 0));
+ UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, 0, !UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, 0));
}
else
{
@@ -1309,11 +1308,11 @@ void CRomBrowser::RomList_ColoumnSortList(uint32_t pnmh)
for (count = NoOfSortKeys; count > 0; count--)
{
- g_Settings->SaveStringIndex(RomBrowser_SortFieldIndex, count, g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, count - 1).c_str());
- g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, count, g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, count - 1));
+ UISettingsSaveStringIndex(RomBrowser_SortFieldIndex, count, UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, count - 1).c_str());
+ UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, count, UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, count - 1));
}
- g_Settings->SaveStringIndex(RomBrowser_SortFieldIndex, 0, m_Fields[index].Name());
- g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, 0, true);
+ UISettingsSaveStringIndex(RomBrowser_SortFieldIndex, 0, m_Fields[index].Name());
+ UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, 0, true);
}
RomList_SortList();
}
@@ -1575,7 +1574,7 @@ void CRomBrowser::RomList_SortList(void)
for (int32_t count = NoOfSortKeys; count >= 0; count--)
{
- stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, count);
+ stdstr SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, count);
size_t index;
for (index = 0; index < m_Fields.size(); index++)
@@ -1585,7 +1584,7 @@ void CRomBrowser::RomList_SortList(void)
if (index >= m_Fields.size()) { continue; }
SortFieldInfo._this = this;
SortFieldInfo.Key = index;
- SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, count) != 0;
+ SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, count) != 0;
ListView_SortItems(m_hRomList, RomList_CompareItems, &SortFieldInfo);
}
}
@@ -1598,29 +1597,26 @@ void CRomBrowser::SaveRomList(strlist & FileList)
{
MD5 ListHash = RomListHash(FileList);
- stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
- HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
-
- DWORD dwWritten;
- WriteFile(hFile, ListHash.raw_digest(), 16, &dwWritten, NULL);
+ CPath FileName(g_Settings->LoadStringVal(RomList_RomListCache));
+ CFile file(FileName, CFileBase::modeWrite | CFileBase::modeCreate);
+ file.Write(ListHash.raw_digest(), 16);
//Write the size of ROM_INFO
int32_t RomInfoSize = sizeof(ROM_INFO);
- WriteFile(hFile, &RomInfoSize, sizeof(RomInfoSize), &dwWritten, NULL);
+ file.Write(&RomInfoSize, sizeof(RomInfoSize));
//Write the Number of entries
int32_t Entries = m_RomInfo.size();
- WriteFile(hFile, &Entries, sizeof(Entries), &dwWritten, NULL);
+ file.Write(&Entries, sizeof(Entries));
//Write Every Entry
for (int32_t count = 0; count < Entries; count++)
{
- ROM_INFO * RomInfo = &m_RomInfo[count];
- WriteFile(hFile, RomInfo, RomInfoSize, &dwWritten, NULL);
+ file.Write(&m_RomInfo[count], RomInfoSize);
}
//Close the file handle
- CloseHandle(hFile);
+ file.Close();
}
void CRomBrowser::SaveRomListColoumnInfo(void)
@@ -1683,7 +1679,7 @@ void CRomBrowser::SelectRomDir(void)
std::wstring title = wGS(SELECT_ROM_DIR);
WriteTrace(TraceUserInterface, TraceDebug, "1");
- stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
+ stdstr RomDir = g_Settings->LoadStringVal(RomList_GameDir).c_str();
bi.hwndOwner = m_MainWindow;
bi.pidlRoot = NULL;
bi.pszDisplayName = SelectedDir;
@@ -1707,7 +1703,7 @@ void CRomBrowser::SelectRomDir(void)
}
WriteTrace(TraceUserInterface, TraceDebug, "5");
WriteTrace(TraceUserInterface, TraceDebug, "6");
- g_Settings->SaveString(Directory_Game, Directory);
+ g_Settings->SaveString(RomList_GameDir, Directory);
WriteTrace(TraceUserInterface, TraceDebug, "7");
Notify().AddRecentDir(Directory);
WriteTrace(TraceUserInterface, TraceDebug, "8");
@@ -1732,14 +1728,14 @@ void CRomBrowser::FixRomListWindow(void)
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
//Load the value from settings, if none is available, default to above
- g_Settings->LoadDword(RomBrowser_Top, (uint32_t &)Y);
- g_Settings->LoadDword(RomBrowser_Left, (uint32_t &)X);
+ UISettingsLoadDword(RomBrowser_Top, (uint32_t &)Y);
+ UISettingsLoadDword(RomBrowser_Left, (uint32_t &)X);
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
//Fix height and width
- int32_t Width = g_Settings->LoadDword(RomBrowser_Width);
- int32_t Height = g_Settings->LoadDword(RomBrowser_Height);
+ int32_t Width = UISettingsLoadDword(RomBrowser_Width);
+ int32_t Height = UISettingsLoadDword(RomBrowser_Height);
if (Width < 200) { Width = 200; }
if (Height < 200) { Height = 200; }
@@ -1803,7 +1799,7 @@ void CRomBrowser::HideRomList(void)
EnableWindow(m_hRomList, FALSE);
ShowWindow(m_hRomList, SW_HIDE);
- if (g_Settings->LoadBool(RomBrowser_Maximized)) { ShowWindow(m_MainWindow, SW_RESTORE); }
+ if (UISettingsLoadBool(RomBrowser_Maximized)) { ShowWindow(m_MainWindow, SW_RESTORE); }
//Change the window style
long Style = GetWindowLong(m_MainWindow, GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX);
@@ -1814,8 +1810,8 @@ void CRomBrowser::HideRomList(void)
GetWindowRect(m_MainWindow, &rect);
int32_t X = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
- g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
- g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
+ UISettingsLoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
+ UISettingsLoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
//Mark the window as not visible
@@ -1832,7 +1828,7 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
//Get Old MD5 of file names
- stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
+ stdstr FileName = g_Settings->LoadStringVal(RomList_RomListCache);
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
@@ -1847,7 +1843,7 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
//Get Current MD5 of file names
strlist FileNames;
- if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(Directory_Game)), stdstr(""), InWatchThread))
+ if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(RomList_GameDir)), stdstr(""), InWatchThread))
{
return false;
}
@@ -1880,7 +1876,7 @@ void CRomBrowser::WatchRomDirChanged(CRomBrowser * _this)
try
{
WriteTrace(TraceUserInterface, TraceDebug, "1");
- _this->m_WatchRomDir = g_Settings->LoadStringVal(Directory_Game);
+ _this->m_WatchRomDir = g_Settings->LoadStringVal(RomList_GameDir);
WriteTrace(TraceUserInterface, TraceDebug, "2");
if (_this->RomDirNeedsRefresh())
{
@@ -1888,9 +1884,10 @@ void CRomBrowser::WatchRomDirChanged(CRomBrowser * _this)
PostMessage((HWND)_this->m_MainWindow, WM_COMMAND, ID_FILE_REFRESHROMLIST, 0);
}
WriteTrace(TraceUserInterface, TraceDebug, "3");
- HANDLE hChange[] = {
+ HANDLE hChange[] =
+ {
_this->m_WatchStopEvent,
- FindFirstChangeNotification(_this->m_WatchRomDir.c_str(), g_Settings->LoadDword(RomBrowser_Recursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
+ FindFirstChangeNotification(_this->m_WatchRomDir.c_str(), g_Settings->LoadBool(RomList_GameDirRecursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
};
WriteTrace(TraceUserInterface, TraceDebug, "4");
for (;;)
@@ -1927,7 +1924,10 @@ void CRomBrowser::WatchThreadStart(void)
WriteTrace(TraceUserInterface, TraceDebug, "1");
WatchThreadStop();
WriteTrace(TraceUserInterface, TraceDebug, "2");
- m_WatchStopEvent = CreateEvent(NULL, true, false, NULL);
+ if (m_WatchStopEvent == NULL)
+ {
+ m_WatchStopEvent = CreateEvent(NULL, true, false, NULL);
+ }
WriteTrace(TraceUserInterface, TraceDebug, "3");
m_WatchThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WatchRomDirChanged, this, 0, &m_WatchThreadID);
WriteTrace(TraceUserInterface, TraceDebug, "4");
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-Game-Status.cpp b/Source/Project64/UserInterface/Settings/SettingsPage-Game-Status.cpp
index 0c890fa70..446fb1ab1 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage-Game-Status.cpp
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-Game-Status.cpp
@@ -23,7 +23,7 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
strlist Keys;
RomIniFile.GetKeyList("Rom Status", Keys);
- stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
+ stdstr Status = UISettingsLoadStringVal(Rdb_Status);
CModifiedComboBoxTxt * ComboBox;
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE), Rdb_Status);
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-GameBrowser.cpp b/Source/Project64/UserInterface/Settings/SettingsPage-GameBrowser.cpp
index c7c8bbe91..67a12317c 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage-GameBrowser.cpp
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-GameBrowser.cpp
@@ -13,8 +13,8 @@
#include "SettingsPage.h"
COptionsGameBrowserPage::COptionsGameBrowserPage(HWND hParent, const RECT & rcDispay) :
-m_OrderChanged(false),
-m_OrderReset(false)
+ m_OrderChanged(false),
+ m_OrderReset(false)
{
if (!Create(hParent, rcDispay))
{
@@ -33,7 +33,7 @@ m_OrderReset(false)
SetDlgItemTextW(m_hWnd, IDC_DOWN, wGS(RB_DOWN).c_str());
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), RomBrowser_Enabled);
- AddModCheckBox(GetDlgItem(IDC_RECURSION), RomBrowser_Recursive);
+ AddModCheckBox(GetDlgItem(IDC_RECURSION), RomList_GameDirRecursive);
m_Avaliable.Attach(GetDlgItem(IDC_AVALIABLE));
m_Using.Attach(GetDlgItem(IDC_USING));
@@ -231,7 +231,7 @@ void COptionsGameBrowserPage::ApplySettings(bool UpdateScreen)
}
if (bColChanged)
{
- g_Settings->SaveBool(RomBrowser_ColoumnsChanged, !g_Settings->LoadBool(RomBrowser_ColoumnsChanged));
+ UISettingsSaveBool(RomBrowser_ColoumnsChanged, !UISettingsLoadBool(RomBrowser_ColoumnsChanged));
}
CSettingsPageImpl::ApplySettings(UpdateScreen);
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-KeyboardShortcuts.cpp b/Source/Project64/UserInterface/Settings/SettingsPage-KeyboardShortcuts.cpp
index 28c37feea..6866de7da 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage-KeyboardShortcuts.cpp
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-KeyboardShortcuts.cpp
@@ -13,7 +13,7 @@
#include "SettingsPage.h"
COptionsShortCutsPage::COptionsShortCutsPage(HWND hParent, const RECT & rcDispay) :
-m_EnableReset(false)
+ m_EnableReset(false)
{
if (!Create(hParent, rcDispay))
{
@@ -356,7 +356,7 @@ void COptionsShortCutsPage::ShowPage()
void COptionsShortCutsPage::ApplySettings(bool /*UpdateScreen*/)
{
m_ShortCuts.Save();
- g_Settings->SaveBool(Info_ShortCutsChanged, true);
+ UISettingsSaveBool(Info_ShortCutsChanged, true);
}
bool COptionsShortCutsPage::EnableReset(void)
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage.h b/Source/Project64/UserInterface/Settings/SettingsPage.h
index 11b1935f3..1c39307e6 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage.h
+++ b/Source/Project64/UserInterface/Settings/SettingsPage.h
@@ -101,7 +101,8 @@ protected:
{
g_Settings->SaveString(Type, Value);
}
- else {
+ else
+ {
DWORD dwValue = atoi(Value.c_str());
g_Settings->SaveDword(Type, dwValue);
}
@@ -156,7 +157,8 @@ protected:
EditBox.SetWindowText(Value.c_str());
EditBox.SetReset(true);
}
- else {
+ else
+ {
DWORD Value = g_Settings->LoadDefaultDword(Type);
EditBox.SetWindowText(stdstr_f("%d", Value).c_str());
EditBox.SetReset(true);
@@ -182,6 +184,11 @@ protected:
return NULL;
}
+ CModifiedEditBox * AddModTextBox(HWND hWnd, UISettingID Type, bool bString)
+ {
+ return AddModTextBox(hWnd, (SettingID)(FirstUISettings + Type), bString);
+ }
+
void AddModCheckBox(HWND hWnd, SettingID Type)
{
ButtonList::iterator item = m_ButtonList.find(Type);
@@ -198,6 +205,11 @@ protected:
}
}
+ void AddModCheckBox(HWND hWnd, UISettingID Type)
+ {
+ AddModCheckBox(hWnd, (SettingID)(FirstUISettings + Type));
+ }
+
CModifiedComboBox * AddModComboBox(HWND hWnd, SettingID Type)
{
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
@@ -234,6 +246,11 @@ protected:
return ComboBox;
}
+ CModifiedComboBoxTxt * AddModComboBoxTxt(HWND hWnd, UISettingID Type)
+ {
+ return AddModComboBoxTxt(hWnd, (SettingID)(FirstUISettings + Type));
+ }
+
void UpdateCheckBoxes(void)
{
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
@@ -280,7 +297,8 @@ protected:
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first, SelectedValue));
TextBox->SetWindowText(SelectedValue.c_str());
}
- else {
+ else
+ {
uint32_t SelectedValue;
TextBox->SetChanged(g_Settings->LoadDword(iter->first, SelectedValue));
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).c_str());
diff --git a/Source/Project64/UserInterface/SettingsConfig.cpp b/Source/Project64/UserInterface/SettingsConfig.cpp
index 6cbbd624b..110b792bc 100644
--- a/Source/Project64/UserInterface/SettingsConfig.cpp
+++ b/Source/Project64/UserInterface/SettingsConfig.cpp
@@ -5,10 +5,10 @@
#include
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
-m_CurrentPage(NULL),
-m_GeneralOptionsPage(NULL),
-m_AdvancedPage(NULL),
-m_GameConfig(bJustGameSetting)
+ m_CurrentPage(NULL),
+ m_GeneralOptionsPage(NULL),
+ m_AdvancedPage(NULL),
+ m_GameConfig(bJustGameSetting)
{
}
@@ -118,7 +118,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
::SetWindowTextW(m_hWnd, wGS(OPTIONS_TITLE).c_str());
}
- if (g_Settings->LoadBool(Setting_PluginPageFirst))
+ if (UISettingsLoadBool(Setting_PluginPageFirst))
{
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
@@ -142,7 +142,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
SettingsSection->AddPage(new COptionsShortCutsPage(this->m_hWnd, rcSettingInfo));
m_Sections.push_back(SettingsSection);
- if (!g_Settings->LoadBool(Setting_PluginPageFirst))
+ if (!UISettingsLoadBool(Setting_PluginPageFirst))
{
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp
index 6d6c560c3..d403532a9 100644
--- a/Source/Project64/main.cpp
+++ b/Source/Project64/main.cpp
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include
#include "Multilanguage\LanguageSelector.h"
+#include "Settings/UISettings.h"
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/)
{
@@ -27,7 +28,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
}
else
{
- if (g_Settings->LoadDword(RomBrowser_Enabled))
+ if (UISettingsLoadBool(RomBrowser_Enabled))
{
WriteTrace(TraceUserInterface, TraceDebug, "Show Rom Browser");
//Display the rom browser