Fix scoring when using transforms.
This commit is contained in:
@@ -42,7 +42,8 @@ public:
|
||||
virtual void DrawPrimitives() { }
|
||||
virtual void Update( float fDelta ) { }
|
||||
|
||||
virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes ) = 0; // before a song plays (called multiple times if course)
|
||||
/* Note that pNoteData will include any transformations due to modifiers. */
|
||||
virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course)
|
||||
|
||||
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0;
|
||||
virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0;
|
||||
|
||||
@@ -72,7 +72,7 @@ ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Notes*>& apNotes_, PlayerNumber p
|
||||
m_bIsLastSongInCourse = false;
|
||||
}
|
||||
|
||||
void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes )
|
||||
void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteData* pNoteData )
|
||||
{
|
||||
/*
|
||||
http://www.aaroninjapan.com/ddr2.html
|
||||
@@ -128,9 +128,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes )
|
||||
ASSERT( m_iMaxPossiblePoints >= 0 );
|
||||
m_iMaxScoreSoFar += m_iMaxPossiblePoints;
|
||||
|
||||
NoteData noteData;
|
||||
pNotes->GetNoteData( ¬eData );
|
||||
m_iNumTapsAndHolds = noteData.GetNumRowsWithTaps() + noteData.GetNumHoldNotes();
|
||||
m_iNumTapsAndHolds = pNoteData->GetNumRowsWithTaps() + pNoteData->GetNumHoldNotes();
|
||||
|
||||
m_iPointBonus = m_iMaxPossiblePoints;
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ class ScoreKeeperMAX2: public ScoreKeeper
|
||||
public:
|
||||
ScoreKeeperMAX2( const vector<Notes*>& apNotes, PlayerNumber pn);
|
||||
|
||||
void OnNextSong( int iSongInCourseIndex, Notes* pNotes ); // before a song plays (called multiple times if course)
|
||||
// before a song plays (called multiple times if course)
|
||||
void OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteData* pNoteData );
|
||||
|
||||
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
|
||||
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
||||
|
||||
@@ -29,7 +29,7 @@ ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn)
|
||||
m_soundAttackEnding.Load( THEME->GetPathToS(ssprintf("ScoreKeeperRave attack end p%d",pn+1)) );
|
||||
}
|
||||
|
||||
void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, Notes* pNotes )
|
||||
void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteData* pNoteData )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
// Overrides
|
||||
ScoreKeeperRave(PlayerNumber pn);
|
||||
virtual void Update( float fDelta );
|
||||
virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes ); // before a song plays (called multiple times if course)
|
||||
virtual void OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteData* pNoteData ); // before a song plays (called multiple times if course)
|
||||
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
|
||||
virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
||||
virtual int TapNoteScoreToDancePoints( TapNoteScore tns ) { return 0; };
|
||||
|
||||
@@ -688,9 +688,6 @@ void ScreenGameplay::LoadNextSong()
|
||||
continue;
|
||||
|
||||
GAMESTATE->m_pCurNotes[p] = m_apNotesQueue[p][iPlaySongIndex];
|
||||
m_pPrimaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p] );
|
||||
if( m_pSecondaryScoreKeeper[p] )
|
||||
m_pSecondaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p] );
|
||||
|
||||
// Put courses options into effect.
|
||||
GAMESTATE->ApplyModifiers( (PlayerNumber)p, m_asModifiersQueue[p][iPlaySongIndex] );
|
||||
@@ -714,8 +711,15 @@ void ScreenGameplay::LoadNextSong()
|
||||
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||
NoteData pNewNoteData;
|
||||
pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, &pOriginalNoteData, &pNewNoteData );
|
||||
|
||||
m_Player[p].Load( (PlayerNumber)p, &pNewNoteData, m_pLifeMeter[p], m_pCombinedLifeMeter, m_pScoreDisplay[p], m_pInventory[p], m_pPrimaryScoreKeeper[p], m_pSecondaryScoreKeeper[p] );
|
||||
|
||||
/* The actual note data for scoring is the base class of Player. This includes
|
||||
* transforms, like Wide. Otherwise, the scoring will operate on the worng
|
||||
* data. */
|
||||
m_pPrimaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p], &m_Player[p] );
|
||||
if( m_pSecondaryScoreKeeper[p] )
|
||||
m_pSecondaryScoreKeeper[p]->OnNextSong( GAMESTATE->GetCourseSongIndex(), GAMESTATE->m_pCurNotes[p], &m_Player[p] );
|
||||
|
||||
if( m_bDemonstration )
|
||||
{
|
||||
GAMESTATE->m_PlayerController[p] = PC_CPU;
|
||||
|
||||
Reference in New Issue
Block a user