Files
itgmania212121/stepmania/src/HoldJudgement.cpp
T

77 lines
1.8 KiB
C++
Raw Normal View History

2002-02-24 01:43:11 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: HoldJudgement
2002-02-24 01:43:11 +00:00
Desc: A graphic displayed in the HoldJudgement during Dancing.
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
2002-02-24 01:43:11 +00:00
-----------------------------------------------------------------------------
*/
#include "HoldJudgement.h"
#include "RageUtil.h"
2002-05-01 19:14:55 +00:00
#include "GameConstantsAndTypes.h"
2002-07-23 01:41:40 +00:00
#include "PrefsManager.h"
2002-02-24 01:43:11 +00:00
#define JUDGEMENT_DISPLAY_TIME THEME->GetMetricF("HoldJudgement","DisplayTime")
2002-02-24 01:43:11 +00:00
HoldJudgement::HoldJudgement()
{
m_fDisplayCountdown = 0;
m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay hold judgement") );
2002-02-24 01:43:11 +00:00
m_sprJudgement.StopAnimating();
2002-05-29 09:47:24 +00:00
m_sprJudgement.TurnShadowOn();
2002-07-23 01:41:40 +00:00
this->AddSubActor( &m_sprJudgement );
2002-02-24 01:43:11 +00:00
}
void HoldJudgement::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
m_fDisplayCountdown -= fDeltaTime;
if( m_fDisplayCountdown < 0 )
m_fDisplayCountdown = 0;
}
2002-05-19 01:59:48 +00:00
void HoldJudgement::DrawPrimitives()
2002-02-24 01:43:11 +00:00
{
if( m_fDisplayCountdown > 0 )
{
2002-05-19 01:59:48 +00:00
ActorFrame::DrawPrimitives();
2002-02-24 01:43:11 +00:00
}
}
2002-06-14 22:25:22 +00:00
void HoldJudgement::SetHoldJudgement( HoldNoteScore hns )
2002-02-24 01:43:11 +00:00
{
//LOG->Trace( "Judgement::SetJudgement()" );
2002-02-24 01:43:11 +00:00
2002-06-14 22:25:22 +00:00
switch( hns )
2002-02-24 01:43:11 +00:00
{
2002-06-14 22:25:22 +00:00
case HNS_NONE: m_sprJudgement.SetState( 0 ); break;
case HNS_OK: m_sprJudgement.SetState( 0 ); break;
case HNS_NG: m_sprJudgement.SetState( 1 ); break;
2002-02-24 01:43:11 +00:00
default: ASSERT( false );
}
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
2002-06-14 22:25:22 +00:00
if( hns == HNS_NG )
2002-02-24 01:43:11 +00:00
{
// falling down
m_sprJudgement.SetY( -10 );
m_sprJudgement.SetZoom( 1.0f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME );
m_sprJudgement.SetTweenY( 10 );
}
2002-06-14 22:25:22 +00:00
else // hns == HNS_OK
2002-02-24 01:43:11 +00:00
{
// zooming out
m_sprJudgement.SetZoom( 1.5f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0f );
m_sprJudgement.SetTweenZoom( 1.0f );
}
}