change hold explosion format

This commit is contained in:
Chris Danford
2004-01-01 01:53:25 +00:00
parent f979d8474f
commit 7fa80e5530
9 changed files with 41 additions and 53 deletions
+14 -39
View File
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
Class: HoldGhostArrow
Desc: A graphic displayed in the HoldJudgment during Dancing.
Desc: See header
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Ben Nordstrom
@@ -15,57 +15,32 @@
#include "PrefsManager.h"
#include "RageException.h"
#include "RageTimer.h"
#include <math.h>
#include "ThemeManager.h"
CachedThemeMetricF WARM_UP_SECONDS ("HoldGhostArrow","WarmUpSeconds");
#include "NoteSkinManager.h"
#include "GameState.h"
HoldGhostArrow::HoldGhostArrow()
{
WARM_UP_SECONDS.Refresh();
m_bHoldIsActive = false;
}
m_bWasSteppedOnLastFrame = false;
m_fHeatLevel = 0;
// LoadFromSpriteFile( THEME->GetPathTo(GRAPHIC_HOLD_GHOST_ARROW) );
SetDiffuse( RageColor(1,1,1,1) );
void HoldGhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement )
{
Sprite::Load( NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement) ); // not optional
m_sOnCommand = NOTESKIN->GetMetric(sNoteSkin,"HoldGhostArrow","OnCommand");
this->Command( m_sOnCommand );
}
void HoldGhostArrow::Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
if( m_bWasSteppedOnLastFrame )
m_fHeatLevel += fDeltaTime/(float)WARM_UP_SECONDS;
else
m_fHeatLevel -= fDeltaTime/(float)WARM_UP_SECONDS;
CLAMP( m_fHeatLevel, 0, 1 );
int iStateNum = (int)min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 );
SetState( iStateNum );
if( m_fHeatLevel == 1 )
{
bool bZooomALittle = fmodf( RageTimer::GetTimeSinceStart(), 1/20.0f ) > 1/40.0f;
SetZoom( bZooomALittle ? 1.04f : 1.0f );
}
else
SetZoom( 1 );
SetDiffuse( RageColor(1,1,1,m_fHeatLevel*3) );
m_bWasSteppedOnLastFrame = false; // reset for next frame
m_bHoldIsActive = false;
}
void HoldGhostArrow::DrawPrimitives()
{
if( !m_bHoldIsActive )
return;
Sprite::DrawPrimitives();
}
void HoldGhostArrow::Step()
{
m_bWasSteppedOnLastFrame = true;
}