diff --git a/stepmania/src/Game.cpp b/stepmania/src/Game.cpp index 333957dd84..10a1f80bde 100644 --- a/stepmania/src/Game.cpp +++ b/stepmania/src/Game.cpp @@ -83,18 +83,6 @@ void Game::MenuButtonToGameInputs( MenuButton MenuI, PlayerNumber pn, GameInput } } -RString Game::ColToButtonName( int iCol ) const -{ - const Style *pStyle = GAMESTATE->GetCurrentStyle(); - const char *pzColumnName = pStyle->m_ColumnInfo[PLAYER_1][iCol].pzName; - if( pzColumnName != NULL ) - return pzColumnName; - - GameInput GI = pStyle->StyleInputToGameInput( iCol, PLAYER_1 ); - - return m_szButtonNames[GI.button]; -} - TapNoteScore Game::MapTapNoteScore( TapNoteScore tns ) const { switch( tns ) diff --git a/stepmania/src/Game.h b/stepmania/src/Game.h index b52a7a189b..26e1c85947 100644 --- a/stepmania/src/Game.h +++ b/stepmania/src/Game.h @@ -51,7 +51,6 @@ public: GameButton ButtonNameToIndex( const RString &sButtonName ) const; MenuButton GameInputToMenuButton( GameInput GameI ) const; void MenuButtonToGameInputs( MenuButton MenuI, PlayerNumber pn, GameInput GameIout[4] ) const; // looks up current style in GAMESTATE. Yuck. - RString ColToButtonName( int col ) const; // looks up current style. Yuck. TapNoteScore MapTapNoteScore( TapNoteScore tns ) const; TapNoteScore m_mapW1To; diff --git a/stepmania/src/GhostArrowRow.cpp b/stepmania/src/GhostArrowRow.cpp index 8106eedacc..01714ce5b5 100644 --- a/stepmania/src/GhostArrowRow.cpp +++ b/stepmania/src/GhostArrowRow.cpp @@ -25,7 +25,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset // init arrows for( int c=0; cm_iColsPerPlayer; c++ ) { - const RString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( c ); + const RString &sButton = GAMESTATE->GetCurrentStyle()->ColToButtonName( c ); m_bHoldIsActive.push_back( false ); m_bHoldWasActive.push_back( false ); diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 5202d47554..a0fcaa3487 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -6,7 +6,7 @@ #include "RageLog.h" #include "RageDisplay.h" #include "ActorUtil.h" -#include "Game.h" +#include "Style.h" #include "PlayerState.h" #include "Sprite.h" #include "NoteTypes.h" @@ -259,7 +259,7 @@ void NoteDisplay::Load( int iColNum, const PlayerState* pPlayerState, float fYRe m_pPlayerState = pPlayerState; m_fYReverseOffsetPixels = fYReverseOffsetPixels; - const RString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNum ); + const RString &sButton = GAMESTATE->GetCurrentStyle()->ColToButtonName( iColNum ); cache->Load( sButton ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index f66dc587e3..7e3fab58c9 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2025,8 +2025,8 @@ void ScreenGameplay::SendCrossedMessages() // Send col-specific crossed if( i == 0 ) { - const Game* pGame = GAMESTATE->GetCurrentGame(); - RString sButton = pGame->ColToButtonName( t ); + const Style *pStyle = GAMESTATE->GetCurrentStyle(); + RString sButton = pStyle->ColToButtonName( t ); RString sMessageName = "NoteCrossed" + sButton; MESSAGEMAN->Broadcast( sMessageName ); } diff --git a/stepmania/src/Style.cpp b/stepmania/src/Style.cpp index f3000659cf..fabb9a0a6b 100644 --- a/stepmania/src/Style.cpp +++ b/stepmania/src/Style.cpp @@ -95,6 +95,18 @@ void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut } } +RString Style::ColToButtonName( int iCol ) const +{ + const char *pzColumnName = m_ColumnInfo[PLAYER_1][iCol].pzName; + if( pzColumnName != NULL ) + return pzColumnName; + + GameInput GI = StyleInputToGameInput( iCol, PLAYER_1 ); + + const Game *pGame = GAMESTATE->GetCurrentGame(); + return pGame->m_szButtonNames[GI.button]; +} + // Lua bindings #include "LuaBinding.h" diff --git a/stepmania/src/Style.h b/stepmania/src/Style.h index ebe0fe05e6..4d8678f433 100644 --- a/stepmania/src/Style.h +++ b/stepmania/src/Style.h @@ -55,6 +55,7 @@ public: GameInput StyleInputToGameInput( int iCol, PlayerNumber pn ) const; int GameInputToColumn( const GameInput &GameI ) const; + RString ColToButtonName( int iCol ) const; PlayerNumber ControllerToPlayerNumber( GameController controller ) const;