merge dupe code into GrayArrow::Load
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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; c<m_iNumCols; c++ )
|
||||
{
|
||||
CString Button = g_NoteFieldMode[m_PlayerNumber].GrayButtonNames[c];
|
||||
if(Button == "")
|
||||
Button = NoteSkinManager::ColToButtonName(c);
|
||||
|
||||
CString sPath = NOTESKIN->GetPathTo(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 )
|
||||
|
||||
@@ -36,18 +36,7 @@ void NoteFieldPlus::Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelT
|
||||
// GrayArrowRow
|
||||
//
|
||||
for( c=0; c<m_iNumCols; c++ )
|
||||
{
|
||||
CString Button = g_NoteFieldMode[m_PlayerNumber].GrayButtonNames[c];
|
||||
if(Button == "")
|
||||
Button = NoteSkinManager::ColToButtonName(c);
|
||||
|
||||
CString sPath = NOTESKIN->GetPathTo(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 );
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
#include "NoteField.h"
|
||||
#include "GrayArrowRow.h"
|
||||
#include "GrayArrow.h"
|
||||
#include "GhostArrowRow.h"
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "RageSound.h"
|
||||
#include "BGAnimation.h"
|
||||
#include "SnapDisplay.h"
|
||||
#include "GrayArrowRow.h"
|
||||
|
||||
|
||||
const int NUM_ACTION_MENU_ITEMS = 23;
|
||||
|
||||
Reference in New Issue
Block a user