From 5cba9d1d41d71ec90569076c23c69d2d2ffa74f0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 23 Aug 2002 00:19:31 +0000 Subject: [PATCH] More const. Move NotesTypeToNumTracks, StringToNotesType, NotesTypeToString into GameManager.cpp and make them use the table. --- stepmania/src/GameManager.cpp | 112 ++++++++++++++++++++++++++++++++-- stepmania/src/GameManager.h | 4 ++ 2 files changed, 110 insertions(+), 6 deletions(-) diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index d077b21937..ff5bc793d5 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -923,8 +923,8 @@ void GameManager::SwitchNoteSkin( CString sNewNoteSkin ) CString GameManager::GetPathTo( const int col, const SkinElement gbg ) // looks in GAMESTATE for the current Style { - StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); - GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); + const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); + const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); StyleInput SI( PLAYER_1, col ); GameInput GI = pStyleDef->StyleInputToGameInput( SI ); @@ -936,8 +936,8 @@ void GameManager::GetTapTweenColors( const int col, CArray { ASSERT( m_sCurNoteSkin != "" ); // if this == NULL, SwitchGame() was never called - StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); - GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); + const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); + const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); StyleInput SI( PLAYER_1, col ); GameInput GI = pStyleDef->StyleInputToGameInput( SI ); @@ -949,8 +949,8 @@ void GameManager::GetHoldTweenColors( const int col, CArray { ASSERT( m_sCurNoteSkin != "" ); // if this == NULL, SwitchGame() was never called - StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); - GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); + const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); + const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); StyleInput SI( PLAYER_1, col ); GameInput GI = pStyleDef->StyleInputToGameInput( SI ); @@ -969,3 +969,103 @@ void GameManager::GetEnabledGames( CArray& aGamesOut ) aGamesOut.Add( game ); } } + +int GameManager::NotesTypeToNumTracks( NotesType nt ) +{ + for( int i=0; i& aGamesOut ); + static int NotesTypeToNumTracks( NotesType nt ); + static NotesType StringToNotesType( CString sNotesType ); + static CString NotesTypeToString( NotesType nt ); + protected: void GetNoteSkinNames( Game game, CStringArray &AddTo );