[Project64] Add Directory_Log setting

This commit is contained in:
zilmar 2016-02-01 17:30:22 +11:00
parent e2f9881864
commit 2e70c734b5
3 changed files with 60 additions and 14 deletions

View File

@ -37,8 +37,7 @@ void InitializeLog(void)
void AddLogModule(void)
{
CPath LogFilePath(g_Settings->LoadStringVal(Cmd_BaseDirectory).c_str(), "");
LogFilePath.AppendDirectory("Logs");
CPath LogFilePath(g_Settings->LoadStringVal(Directory_Log).c_str(), "");
if (!LogFilePath.DirectoryExists())
{
LogFilePath.DirectoryCreate();
@ -227,7 +226,7 @@ bool AppInit(CNotification * Notify, const char * BaseDirectory, int argc, char
//Create the plugin container
WriteTrace(TraceAppInit, TraceInfo, "Create Plugins");
g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin));
g_Plugins = new CPlugins(Directory_Plugin);
g_Lang = new CLanguage();
g_Lang->LoadCurrentStrings();
@ -261,21 +260,55 @@ void AppCleanup(void)
void FixDirectories(void)
{
WriteTrace(TraceAppInit, TraceDebug, "Starting");
CPath Directory(g_Settings->LoadStringVal(Cmd_BaseDirectory).c_str(), "");
Directory.AppendDirectory("Config");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
if (!Directory.DirectoryExists())
{
WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
Directory.DirectoryCreate();
}
else
{
WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
}
Directory.UpDirectory();
Directory.AppendDirectory("Save");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
if (!Directory.DirectoryExists())
{
WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
Directory.DirectoryCreate();
}
else
{
WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
}
Directory.UpDirectory();
Directory.AppendDirectory("Screenshots");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
if (!Directory.DirectoryExists())
{
WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
Directory.DirectoryCreate();
}
else
{
WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
}
Directory.UpDirectory();
Directory.AppendDirectory("textures");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
if (!Directory.DirectoryExists())
{
WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
Directory.DirectoryCreate();
}
else
{
WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
}
WriteTrace(TraceAppInit, TraceDebug, "Done");
}
#ifdef _WIN32

View File

@ -220,6 +220,10 @@ enum SettingID
Directory_TextureInitial,
Directory_TextureSelected,
Directory_TextureUseSelected,
Directory_Log,
Directory_LogInitial,
Directory_LogSelected,
Directory_LogUseSelected,
//File Info
File_RecentGameFileCount,

View File

@ -136,10 +136,14 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name", Game_GameName));
AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type", SaveChip_Auto));
#ifdef _WIN32
#ifdef _DEBUG
AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_SyncCores));
#else
AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_Recompiler));
#endif
#else
AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_Interpreter));
#endif
AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size", 0x400000));
AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor", 2));
@ -252,12 +256,12 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
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));
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));
AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected, Directory_Plugin));
#ifdef _M_IX86
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", ""));
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial));
@ -270,26 +274,31 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin64", ""));
#endif
AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot", Directory_SnapShotInitial, Directory_SnapShotSelected, Directory_SnapShotUseSelected));
AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot", Directory_SnapShotInitial, Directory_SnapShotSelected, Directory_SnapShotUseSelected, Directory_SnapShot));
AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots", ""));
AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory", "Snap Shot", Directory_SnapShotInitial));
AddHandler(Directory_SnapShotUseSelected, new CSettingTypeApplication("Directory", "Snap Shot - Use Selected", false));
AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave", Directory_NativeSaveInitial, Directory_NativeSaveSelected, Directory_NativeSaveUseSelected));
AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave", Directory_NativeSaveInitial, Directory_NativeSaveSelected, Directory_NativeSaveUseSelected, Directory_NativeSave));
AddHandler(Directory_NativeSaveInitial, new CSettingTypeRelativePath("Save", ""));
AddHandler(Directory_NativeSaveSelected, new CSettingTypeApplicationPath("Directory", "Save", Directory_NativeSaveInitial));
AddHandler(Directory_NativeSaveUseSelected, new CSettingTypeApplication("Directory", "Save - Use Selected", false));
AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave", Directory_InstantSaveInitial, Directory_InstantSaveSelected, Directory_InstantSaveUseSelected));
AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave", Directory_InstantSaveInitial, Directory_InstantSaveSelected, Directory_InstantSaveUseSelected, Directory_InstantSave));
AddHandler(Directory_InstantSaveInitial, new CSettingTypeRelativePath("Save", ""));
AddHandler(Directory_InstantSaveSelected, new CSettingTypeApplicationPath("Directory", "Instant Save", Directory_InstantSaveInitial));
AddHandler(Directory_InstantSaveUseSelected, new CSettingTypeApplication("Directory", "Instant Save - Use Selected", false));
AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture", Directory_TextureInitial, Directory_TextureSelected, Directory_TextureUseSelected));
AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture", Directory_TextureInitial, Directory_TextureSelected, Directory_TextureUseSelected, Directory_Texture));
AddHandler(Directory_TextureInitial, new CSettingTypeRelativePath("Textures", ""));
AddHandler(Directory_TextureSelected, new CSettingTypeApplicationPath("Directory", "Texture Dir", Directory_InstantSaveInitial));
AddHandler(Directory_TextureUseSelected, new CSettingTypeApplication("Directory", "Texture Dir - Use Selected", false));
AddHandler(Directory_Log, new CSettingTypeSelectedDirectory("Dir:Log", Directory_LogInitial, Directory_LogSelected, Directory_LogUseSelected, Directory_Log));
AddHandler(Directory_LogInitial, new CSettingTypeRelativePath("Logs", ""));
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(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false));
@ -1242,4 +1251,4 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
}
}