diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 74132299b3..f156669cb3 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -482,8 +482,8 @@ bool GameCommand::IsPlayable( CString *why ) const switch( GAMESTATE->GetCoinMode() ) { - case COIN_HOME: - case COIN_FREE: + case COIN_MODE_HOME: + case COIN_MODE_FREE: iCredits = NUM_PLAYERS; /* not iNumCreditsPaid */ } @@ -685,7 +685,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const // players joined. If enough players aren't joined, then // we need to subtract credits for the sides that will be // joined as a result of applying this option. - if( PREFSMAN->m_CoinMode == COIN_PAY ) + if( PREFSMAN->m_CoinMode == COIN_MODE_PAY ) { int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle); int iNumCreditsPaid = GetNumCreditsPaid(); diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index 1fdc125732..35ad06a41e 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -104,7 +104,7 @@ static void LuaCoinMode(lua_State* L) { CString s = CoinModeNames[i]; s.MakeUpper(); - LUA->SetGlobal( "COIN_"+s, i ); + LUA->SetGlobal( "COIN_MODE_"+s, i ); } } REGISTER_WITH_LUA_FUNCTION( LuaCoinMode ); diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 5d19c41d61..b63f69fa41 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -267,7 +267,13 @@ const int ITEM_NONE = -1; // Coin stuff // -enum CoinMode { COIN_HOME, COIN_PAY, COIN_FREE, NUM_COIN_MODES }; +enum CoinMode +{ + COIN_MODE_HOME, + COIN_MODE_PAY, + COIN_MODE_FREE, + NUM_COIN_MODES +}; #define FOREACH_CoinMode( i ) FOREACH_ENUM( CoinMode, NUM_COIN_MODES, i ) const CString& CoinModeToString( CoinMode cm ); @@ -275,7 +281,13 @@ const CString& CoinModeToString( CoinMode cm ); // // Premium // -enum Premium { PREMIUM_NONE, PREMIUM_DOUBLE, PREMIUM_JOINT, NUM_PREMIUMS }; +enum Premium +{ + PREMIUM_NONE, + PREMIUM_DOUBLE, + PREMIUM_JOINT, + NUM_PREMIUMS +}; #define FOREACH_Premium( i ) FOREACH_ENUM( Premium, NUM_PREMIUMS, i ) const CString& PremiumToString( Premium p ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 35d50da22a..fbe72470be 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -253,7 +253,7 @@ int GameState::GetCoinsNeededToJoin() const { int iCoinsToCharge = 0; - if( GAMESTATE->GetCoinMode() == COIN_PAY ) + if( GAMESTATE->GetCoinMode() == COIN_MODE_PAY ) iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit; // If joint premium don't take away a credit for the 2nd join. @@ -1835,8 +1835,8 @@ bool GameState::IsEventMode() const CoinMode GameState::GetCoinMode() { - if( IsEventMode() && PREFSMAN->m_CoinMode == COIN_PAY ) - return COIN_FREE; + if( IsEventMode() && PREFSMAN->m_CoinMode == COIN_MODE_PAY ) + return COIN_MODE_FREE; else return PREFSMAN->m_CoinMode; } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 910555ab2e..c5541611f6 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -196,7 +196,7 @@ PrefsManager::PrefsManager() : m_iCoinsPerCredit ( "CoinsPerCredit", 1 ), m_iSongsPerPlay ( "SongsPerPlay", 3 ), - m_CoinMode ( "CoinMode", COIN_HOME ), + m_CoinMode ( "CoinMode", COIN_MODE_HOME ), m_Premium ( "Premium", PREMIUM_NONE ), m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ), m_bPickExtraStage ( "PickExtraStage", false ), diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index a3aa15e24d..303eee0d32 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -72,13 +72,13 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy case MENU_BUTTON_COIN: switch( GAMESTATE->GetCoinMode() ) { - case COIN_PAY: + case COIN_MODE_PAY: LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit.Get() ); if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) break; // don't fall through // fall through - case COIN_HOME: - case COIN_FREE: + case COIN_MODE_HOME: + case COIN_MODE_FREE: if( pScreen->IsTransitioning() ) return; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 60cfc2ec0e..85b441052f 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -322,13 +322,13 @@ static void MarvelousTiming( int &sel, bool ToSel, const ConfOption *pConfOption static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption ) { - const CoinMode mapping[] = { COIN_HOME, COIN_PAY, COIN_FREE }; + const CoinMode mapping[] = { COIN_MODE_HOME, COIN_MODE_PAY, COIN_MODE_FREE }; MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) ); } static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption ) { - const CoinMode mapping[] = { COIN_PAY, COIN_FREE }; + const CoinMode mapping[] = { COIN_MODE_PAY, COIN_MODE_FREE }; MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) ); } diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index fc5924a48d..e9794bd002 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -116,7 +116,7 @@ void ScreenSelect::Update( float fDelta ) } // don't time out on this screen is coin mode is pay. // If we're here, then there's a credit in the machine. - if( GAMESTATE->GetCoinMode() != COIN_PAY ) + if( GAMESTATE->GetCoinMode() != COIN_MODE_PAY ) { if( IDLE_TIMEOUT_SECONDS > 0 && m_timerIdleTimeout.PeekDeltaTime() >= IDLE_TIMEOUT_SECONDS ) { diff --git a/stepmania/src/ScreenSystemLayer.cpp b/stepmania/src/ScreenSystemLayer.cpp index 968f4ab73b..db11c7686a 100644 --- a/stepmania/src/ScreenSystemLayer.cpp +++ b/stepmania/src/ScreenSystemLayer.cpp @@ -180,13 +180,13 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const { switch( GAMESTATE->GetCoinMode() ) { - case COIN_HOME: + case COIN_MODE_HOME: if( GAMESTATE->PlayersCanJoin() ) return CREDITS_PRESS_START.GetValue(); else return CREDITS_NOT_PRESENT.GetValue(); - case COIN_PAY: + case COIN_MODE_PAY: { int Credits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit; int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit; @@ -197,7 +197,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const sCredits += ssprintf(" %d/%d", Coins, PREFSMAN->m_iCoinsPerCredit.Get() ); return sCredits; } - case COIN_FREE: + case COIN_MODE_FREE: if( GAMESTATE->PlayersCanJoin() ) return CREDITS_FREE_PLAY.GetValue(); else diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 801a67f9be..c4e38cbfef 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -37,7 +37,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sScreenName ) : // Don't show screen title menu (says "Press Start") // if there are 0 credits and inserted and CoinMode is pay. - if( GAMESTATE->GetCoinMode() == COIN_PAY && + if( GAMESTATE->GetCoinMode() == COIN_MODE_PAY && GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) { SCREENMAN->SetNewScreen( INITIAL_SCREEN );