diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 574f296e3d..e554cf2af3 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -152,7 +152,7 @@ void Player::Init( void Player::Load( const NoteData& noteData ) { - m_iDCState = AS2D_IDLE; + m_LastTapNoteScore = TNS_NONE; m_iRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this? m_iMineRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this? @@ -911,16 +911,7 @@ void Player::Step( int col, const RageTimer &tm ) OnRowCompletelyJudged( iIndexOverlappingNote ); } - if( score == TNS_MISS || score == TNS_BOO ) - m_iDCState = AS2D_MISS; - else if( score == TNS_GOOD || score == TNS_GREAT ) - m_iDCState = AS2D_GOOD; - else if( score == TNS_PERFECT || score == TNS_MARVELOUS ) - { - m_iDCState = AS2D_GREAT; - if( m_pLifeMeter && m_pLifeMeter->GetLife() == 1.0f) // full life - m_iDCState = AS2D_FEVER; // super celebrate time :) - } + m_LastTapNoteScore = score; } if( m_pNoteField ) @@ -1205,8 +1196,8 @@ void Player::HandleTapRowScore( unsigned row ) case TNS_MISS: ++iCurMissCombo; - m_iDCState = AS2D_MISS; // update dancing 2d characters that may have missed a note - + m_LastTapNoteScore = TNS_MISS; + case TNS_GOOD: case TNS_BOO: if( iCurCombo > 50 ) diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index f48f76c6ee..68d5279e5e 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -48,8 +48,7 @@ public: void Step( int col, const RageTimer &tm ); void RandomizeNotes( int iNoteRow ); void FadeToFail(); - int GetDancingCharacterState() const { return m_iDCState; }; - void SetCharacterState(int iDCState) { m_iDCState = iDCState; }; + TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; } void ApplyWaitingTransforms(); static float GetMaxStepDistanceSeconds(); @@ -87,7 +86,7 @@ protected: AttackDisplay m_AttackDisplay; - int m_iDCState; + TapNoteScore m_LastTapNoteScore; LifeMeter* m_pLifeMeter; CombinedLifeMeter* m_pCombinedLifeMeter; ScoreDisplay* m_pScoreDisplay; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index ad5ec79870..f343a75af1 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1458,7 +1458,27 @@ void ScreenGameplay::Update( float fDeltaTime ) { DancingCharacters *pCharacter = m_Background.GetDancingCharacters(); if( pCharacter != NULL ) - pCharacter->Change2DAnimState( p, m_Player[p].GetDancingCharacterState() ); + { + TapNoteScore tns = m_Player[p].GetLastTapNoteScore(); + + ANIM_STATES_2D StateMap[NUM_TAP_NOTE_SCORES] = + { + AS2D_MISS, /* TNS_NONE (shouldn't happen) */ + AS2D_MISS, /* TNS_HIT_MINE (shouldn't happen) */ + AS2D_MISS, /* TNS_MISS */ + AS2D_MISS, /* TNS_BOO */ + AS2D_GOOD, /* TNS_GOOD */ + AS2D_GOOD, /* TNS_GREAT */ + AS2D_GREAT, /* TNS_PERFECT */ + AS2D_GREAT /* TNS_MARVELOUS */ + }; + + ANIM_STATES_2D state = StateMap[tns]; + if( state == AS2D_GREAT && m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life + state = AS2D_FEVER; + + pCharacter->Change2DAnimState( p, state ); + } } //