diff --git a/stepmania/src/Game.cpp b/stepmania/src/Game.cpp index 7956791d8e..9ec01bbeb8 100644 --- a/stepmania/src/Game.cpp +++ b/stepmania/src/Game.cpp @@ -104,6 +104,16 @@ void Game::MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const } } +CString Game::ColToButtonName( int col ) const +{ + const Style* pStyle = GAMESTATE->GetCurrentStyle(); + + StyleInput SI( PLAYER_1, col ); + GameInput GI = pStyle->StyleInputToGameInput( SI ); + + return m_szButtonNames[GI.button]; +} + /* * (c) 2001-2002 Chris Danford * All rights reserved. diff --git a/stepmania/src/Game.h b/stepmania/src/Game.h index 8bbe69ffad..b69f796410 100644 --- a/stepmania/src/Game.h +++ b/stepmania/src/Game.h @@ -53,6 +53,7 @@ public: GameButton ButtonNameToIndex( const CString &sButtonName ) const; MenuInput GameInputToMenuInput( GameInput GameI ) const; void MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const; + CString ColToButtonName( int col ) const; TapNoteScore m_mapMarvelousTo; TapNoteScore m_mapPerfectTo; diff --git a/stepmania/src/GhostArrowRow.cpp b/stepmania/src/GhostArrowRow.cpp index 729f7ae059..a01088edb9 100644 --- a/stepmania/src/GhostArrowRow.cpp +++ b/stepmania/src/GhostArrowRow.cpp @@ -8,6 +8,7 @@ #include "GameState.h" #include "PrefsManager.h" #include "NoteFieldPositioning.h" +#include "Game.h" GhostArrowRow::GhostArrowRow() @@ -31,8 +32,8 @@ void GhostArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffs { NoteFieldMode &mode = g_NoteFieldMode[pn]; CString Button = mode.GhostButtonNames[c]; - if(Button == "") - Button = NoteSkinManager::ColToButtonName(c); + if( Button == "" ) + Button = GAMESTATE->GetCurrentGame()->ColToButtonName( c ); m_GhostDim.push_back( new GhostArrow ); m_GhostBright.push_back( new GhostArrow ); diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index ce0fa03fe6..f62466fbc5 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -12,6 +12,7 @@ #include "NoteFieldPositioning.h" #include "ActorUtil.h" #include "NoteDataWithScoring.h" +#include "Game.h" enum part { @@ -231,8 +232,8 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn, CString NoteSkin, float fY /* Normally, this is empty and we use the style table entry via ColToButtonName. */ NoteFieldMode &mode = g_NoteFieldMode[pn]; CString Button = mode.NoteButtonNames[iColNum]; - if(Button == "") - Button = NoteSkinManager::ColToButtonName(iColNum); + if( Button == "" ) + Button = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNum ); cache->Load( NoteSkin, Button ); diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 391a749942..f11cfeacd9 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -206,16 +206,6 @@ RageColor NoteSkinManager::GetMetricC( CString sNoteSkinName, CString sButtonNam } -CString NoteSkinManager::ColToButtonName(int col) -{ - const Style* pStyle = GAMESTATE->GetCurrentStyle(); - const Game* pGame = GAMESTATE->GetCurrentGame(); - - StyleInput SI( PLAYER_1, col ); - GameInput GI = pStyle->StyleInputToGameInput( SI ); - return pGame->m_szButtonNames[GI.button]; -} - CString NoteSkinManager::GetPathToFromNoteSkinAndButton( CString NoteSkin, CString sButtonName, CString sElement, bool bOptional ) { try_again: diff --git a/stepmania/src/NoteSkinManager.h b/stepmania/src/NoteSkinManager.h index c27dd8f6b9..e9ae277509 100644 --- a/stepmania/src/NoteSkinManager.h +++ b/stepmania/src/NoteSkinManager.h @@ -28,8 +28,6 @@ public: bool GetMetricB( CString sNoteSkinName, CString sButtonName, CString sValueName ); RageColor GetMetricC( CString sNoteSkinName, CString sButtonName, CString sValueName ); - static CString ColToButtonName(int col); - CString GetNoteSkinDir( const CString &sSkinName ); protected: diff --git a/stepmania/src/ReceptorArrow.cpp b/stepmania/src/ReceptorArrow.cpp index 4a8383fe55..c60dd64ba9 100644 --- a/stepmania/src/ReceptorArrow.cpp +++ b/stepmania/src/ReceptorArrow.cpp @@ -7,6 +7,7 @@ #include "NoteSkinManager.h" #include "RageLog.h" #include "RageUtil.h" +#include "Game.h" ReceptorArrow::ReceptorArrow() @@ -23,7 +24,7 @@ bool ReceptorArrow::Load( CString NoteSkin, PlayerNumber pn, int iColNo ) NoteFieldMode &mode = g_NoteFieldMode[pn]; CString sButton = mode.GrayButtonNames[iColNo]; if( sButton == "" ) - sButton = NoteSkinManager::ColToButtonName( iColNo ); + sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNo ); CString sPath; m_pReceptorWaiting.Load( NOTESKIN->GetPathToFromNoteSkinAndButton(NoteSkin,sButton,"receptor waiting") );