merge dupe code into GrayArrow::Load

This commit is contained in:
Glenn Maynard
2003-09-12 06:37:10 +00:00
parent b0adf33f18
commit f79f9ad322
6 changed files with 27 additions and 29 deletions
+19
View File
@@ -16,6 +16,8 @@
#include "GameState.h"
#include <math.h>
#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()