Add Reset().
Reset combos and judgements in Player::Load(). const stuff.
This commit is contained in:
+9
-17
@@ -17,11 +17,17 @@
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
void Combo::Reset()
|
||||
{
|
||||
m_iCurCombo = m_iMaxCombo = m_iCurComboOfPerfects = 0;
|
||||
|
||||
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
|
||||
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
|
||||
}
|
||||
|
||||
Combo::Combo()
|
||||
{
|
||||
m_iCurCombo = 0;
|
||||
m_iMaxCombo = 0;
|
||||
m_iCurComboOfPerfects = 0;
|
||||
Reset();
|
||||
|
||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo") );
|
||||
m_sprCombo.TurnShadowOn();
|
||||
@@ -34,10 +40,6 @@ Combo::Combo()
|
||||
m_textComboNumber.SetHorizAlign( Actor::align_right );
|
||||
m_textComboNumber.SetX( 0 );
|
||||
|
||||
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
|
||||
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
|
||||
|
||||
|
||||
this->AddSubActor( &m_textComboNumber );
|
||||
this->AddSubActor( &m_sprCombo );
|
||||
}
|
||||
@@ -124,13 +126,3 @@ void Combo::UpdateScore( TapNoteScore score )
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
int Combo::GetCurrentCombo()
|
||||
{
|
||||
return m_iCurCombo;
|
||||
}
|
||||
|
||||
int Combo::GetMaxCombo()
|
||||
{
|
||||
return m_iMaxCombo;
|
||||
}
|
||||
@@ -24,8 +24,9 @@ public:
|
||||
|
||||
void UpdateScore( TapNoteScore score );
|
||||
|
||||
int GetCurrentCombo();
|
||||
int GetMaxCombo();
|
||||
int GetCurrentCombo() const { return m_iCurCombo; }
|
||||
int GetMaxCombo() const { return m_iMaxCombo; }
|
||||
void Reset();
|
||||
|
||||
protected:
|
||||
int m_iCurCombo;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _Judgement_H_
|
||||
#define _Judgement_H_
|
||||
#ifndef JUDGEMENT_H
|
||||
#define JUDGEMENT_H
|
||||
|
||||
|
||||
#include "Sprite.h"
|
||||
@@ -24,9 +24,11 @@ class Judgement : public ActorFrame
|
||||
{
|
||||
public:
|
||||
Judgement();
|
||||
virtual ~Judgement() { }
|
||||
void SetJudgement( TapNoteScore score );
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
virtual void Reset() { m_fDisplayCountdown = .0f; }
|
||||
|
||||
protected:
|
||||
Sprite m_sprJudgement;
|
||||
|
||||
@@ -77,6 +77,12 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY && GAMESTATE->m_fSecondsBeforeFail[m_PlayerNumber] != -1 ) // Oni dead
|
||||
this->ClearAll();
|
||||
|
||||
/* The editor reuses Players ... so we really need to make sure everything
|
||||
* is reset and not tweening. Perhaps ActorFrame should recurse to subactors;
|
||||
* then we could just this->StopTweening()? -glenn */
|
||||
m_frameJudgement.StopTweening();
|
||||
m_Combo.Reset();
|
||||
m_Judgement.Reset();
|
||||
|
||||
m_iNumTapNotes = pNoteData->GetNumTapNotes();
|
||||
m_iTapNotesHit = 0;
|
||||
|
||||
Reference in New Issue
Block a user