diff --git a/stepmania/src/GrayArrow.cpp b/stepmania/src/GrayArrow.cpp index 9315e14de8..d33326d86d 100644 --- a/stepmania/src/GrayArrow.cpp +++ b/stepmania/src/GrayArrow.cpp @@ -16,6 +16,8 @@ #include "GameState.h" #include #include "ThemeManager.h" +#include "NoteFieldPositioning.h" +#include "NoteSkinManager.h" #include "RageLog.h" @@ -31,6 +33,23 @@ GrayArrow::GrayArrow() StopAnimating(); } +bool GrayArrow::Load( PlayerNumber pn, int iColNo ) +{ + CString Button = g_NoteFieldMode[pn].GrayButtonNames[iColNo]; + if( Button == "" ) + Button = NoteSkinManager::ColToButtonName( iColNo ); + + CString sPath = NOTESKIN->GetPathTo( pn, Button, "receptor" ); + bool ret = Sprite::Load( sPath ); + + // XXX + if( GetNumStates() != 2 && + GetNumStates() != 3 ) + RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() ); + + return ret; +} + void GrayArrow::Update( float fDeltaTime ) { ASSERT( Sprite::GetNumStates() > 0 ); // you forgot to call Load() diff --git a/stepmania/src/GrayArrow.h b/stepmania/src/GrayArrow.h index 491a8b5038..12004adb5e 100644 --- a/stepmania/src/GrayArrow.h +++ b/stepmania/src/GrayArrow.h @@ -1,5 +1,5 @@ -#ifndef _GrayArrow_H_ -#define _GrayArrow_H_ +#ifndef GRAY_ARROW_H +#define GRAY_ARROW_H /* ----------------------------------------------------------------------------- Class: GrayArrow @@ -14,11 +14,13 @@ #include "Sprite.h" +#include "PlayerNumber.h" class GrayArrow : public Sprite { public: GrayArrow(); + bool Load( PlayerNumber pn, int iColNo ); virtual void Update( float fDeltaTime ); void Step(); diff --git a/stepmania/src/GrayArrowRow.cpp b/stepmania/src/GrayArrowRow.cpp index 7205934673..e18813839f 100644 --- a/stepmania/src/GrayArrowRow.cpp +++ b/stepmania/src/GrayArrowRow.cpp @@ -15,7 +15,6 @@ #include "GameConstantsAndTypes.h" #include "PrefsManager.h" #include "ArrowEffects.h" -#include "NoteSkinManager.h" #include "GameState.h" #include "PrefsManager.h" #include "NoteFieldPositioning.h" @@ -35,19 +34,7 @@ void GrayArrowRow::Load( PlayerNumber pn ) m_iNumCols = pStyleDef->m_iColsPerPlayer; for( int c=0; cGetPathTo(pn, Button, "receptor"); - m_GrayArrow[c].Load( sPath ); - // XXX - if( m_GrayArrow[c].GetNumStates() != 2 && - m_GrayArrow[c].GetNumStates() != 3 ) - RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() ); - m_GrayArrow[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset ); - } + m_GrayArrow[c].Load( m_PlayerNumber, c ); } void GrayArrowRow::Update( float fDeltaTime ) diff --git a/stepmania/src/NoteFieldPlus.cpp b/stepmania/src/NoteFieldPlus.cpp index 376801c0bb..36ad367519 100644 --- a/stepmania/src/NoteFieldPlus.cpp +++ b/stepmania/src/NoteFieldPlus.cpp @@ -36,18 +36,7 @@ void NoteFieldPlus::Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelT // GrayArrowRow // for( c=0; cGetPathTo(pn, Button, "receptor"); - m_GrayArrow[c].Load( sPath ); - // XXX - if( m_GrayArrow[c].GetNumStates() != 2 && - m_GrayArrow[c].GetNumStates() != 3 ) - RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() ); - } + m_GrayArrow[c].Load( pn, c ); // diff --git a/stepmania/src/NoteFieldPlus.h b/stepmania/src/NoteFieldPlus.h index f48e36ed03..ccbe9c03f9 100644 --- a/stepmania/src/NoteFieldPlus.h +++ b/stepmania/src/NoteFieldPlus.h @@ -13,7 +13,7 @@ #include "NoteField.h" -#include "GrayArrowRow.h" +#include "GrayArrow.h" #include "GhostArrowRow.h" diff --git a/stepmania/src/ScreenEdit.h b/stepmania/src/ScreenEdit.h index 1764ba83eb..acab622f1f 100644 --- a/stepmania/src/ScreenEdit.h +++ b/stepmania/src/ScreenEdit.h @@ -17,6 +17,7 @@ #include "RageSound.h" #include "BGAnimation.h" #include "SnapDisplay.h" +#include "GrayArrowRow.h" const int NUM_ACTION_MENU_ITEMS = 23;