functions moved

This commit is contained in:
Glenn Maynard
2003-10-02 01:41:09 +00:00
parent e41a094ee5
commit 75a3a7f8b8
3 changed files with 4 additions and 50 deletions
-47
View File
@@ -13,20 +13,14 @@
#include "PrefsManager.h"
#include "IniFile.h"
#include "NoteSkinManager.h"
#include "GameState.h"
#include "RageException.h"
#include "RageDisplay.h"
#include "RageUtil.h"
#include "GameDef.h"
#include "AnnouncerManager.h"
#include "ThemeManager.h"
#include "GameConstantsAndTypes.h"
#include "arch/arch.h" /* for default driver specs */
#include "RageSoundReader_Resample.h" /* for ResampleQuality */
#define STEPMANIA_INI_PATH BASE_PATH "Data" SLASH "StepMania.ini"
#define GAMEPREFS_INI_PATH BASE_PATH "Data" SLASH "GamePrefs.ini"
PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program
@@ -435,44 +429,3 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.WriteFile();
}
void PrefsManager::ReadGamePrefsFromDisk()
{
if( !GAMESTATE )
return;
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
IniFile ini;
ini.SetPath( GAMEPREFS_INI_PATH );
ini.ReadFile(); // it's OK if this fails
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
// if these calls fail, the three strings will keep the initial values set above.
ini.GetValue( sGameName, "Announcer", sAnnouncer );
ini.GetValue( sGameName, "Theme", sTheme );
ini.GetValue( sGameName, "DefaultModifiers", m_sDefaultModifiers );
// it's OK to call these functions with names that don't exist.
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
THEME->SwitchThemeAndLanguage( sTheme, m_sLanguage );
// NOTESKIN->SwitchNoteSkin( sNoteSkin );
}
void PrefsManager::SaveGamePrefsToDisk()
{
if( !GAMESTATE )
return;
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
IniFile ini;
ini.SetPath( GAMEPREFS_INI_PATH );
ini.ReadFile(); // it's OK if this fails
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
ini.SetValue( sGameName, "DefaultModifiers", m_sDefaultModifiers );
ini.WriteFile();
}