diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 7e8c7b363e..50b6c63e80 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -303,3 +303,23 @@ void GameState::GetFinalEvalStatsAndSongs( StageStats& statsOut, vector& } } } + +/* XXX: Should we store song options, too? */ +/* Store the player's preferred options. This is called at the very beginning + * of gameplay. */ +void GameState::StoreSelectedOptions() +{ + for( int p=0; pm_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p]; +} + +/* Restore the preferred options. This is called after a song ends, before + * setting new course options, so options from one song don't carry into the + * next and we default back to the preferred options. This is also called + * at the end of gameplay to restore options. */ +void GameState::RestoreSelectedOptions() +{ + for( int p=0; pm_PlayerOptions[p] = GAMESTATE->m_SelectedOptions[p]; + GAMESTATE->m_SongOptions.Init(); +} diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index fbc2f1a012..74f1b205c6 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -80,6 +80,9 @@ public: RageColor GetStageColor(); int GetCourseSongIndex(); + void StoreSelectedOptions(); + void RestoreSelectedOptions(); + // // State Info used during gameplay //