From 6e5a5efe7352b0817dad1b2975d9f203fdc88bdf Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 16 Oct 2003 08:55:32 +0000 Subject: [PATCH] add g_bAutoRestart --- stepmania/src/PrefsManager.cpp | 6 +++++- stepmania/src/PrefsManager.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 47888e2c8c..51dccfaa44 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -26,6 +26,8 @@ PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our pro const float DEFAULT_SOUND_VOLUME = 0.50; +bool g_bAutoRestart = false; + PrefsManager::PrefsManager() { #ifdef DEBUG @@ -144,7 +146,7 @@ PrefsManager::PrefsManager() m_fCenterImageScaleY = 1; m_bAttractSound = true; - + g_bAutoRestart = false; /* XXX: Set these defaults for individual consoles using VideoCardDefaults.ini. */ #ifdef _XBOX @@ -310,6 +312,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX ); ini.GetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY ); ini.GetValue( "Options", "AttractSound", m_bAttractSound ); + ini.GetValue( "Options", "AutoRestart", g_bAutoRestart ); CString sAdditionalSongFolders; if( ini.GetValue( "Options", "AdditionalSongFolders", sAdditionalSongFolders ) ) @@ -437,6 +440,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX ); ini.SetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY ); ini.SetValue( "Options", "AttractSound", m_bAttractSound ); + ini.SetValue( "Options", "AutoRestart", g_bAutoRestart ); /* Only write these if they aren't the default. This ensures that we can change * the default and have it take effect for everyone (except people who diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index c152a4582d..7475c49f39 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -154,6 +154,10 @@ public: void SaveGamePrefsToDisk(); }; +/* This is global, because it can be accessed by crash handlers and error handlers + * that are run after PREFSMAN shuts down (and probably don't want to deref tht + * pointer anyway). */ +extern bool g_bAutoRestart; extern PrefsManager* PREFSMAN; // global and accessable from anywhere in our program