Files
itgmania212121/stepmania/src/GhostArrowBright.cpp
T

81 lines
2.4 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-07-28 20:28:37 +00:00
/*
-----------------------------------------------------------------------------
Class: GhostArrowBright
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Ben Nordstrom
Chris Danford
-----------------------------------------------------------------------------
*/
2001-12-28 10:15:59 +00:00
#include "GhostArrowBright.h"
2002-07-23 01:41:40 +00:00
#include "PrefsManager.h"
#include "ThemeManager.h"
2001-12-28 10:15:59 +00:00
CachedThemeMetricF GAB_SHOW_SECONDS ("GhostArrowBright","ShowSeconds");
CachedThemeMetricF GAB_ZOOM_START ("GhostArrowBright","ZoomStart");
CachedThemeMetricF GAB_ZOOM_END ("GhostArrowBright","ZoomEnd");
CachedThemeMetricC GAB_COLOR_MARVELOUS ("GhostArrowBright","ColorMarvelous");
CachedThemeMetricC GAB_COLOR_PERFECT ("GhostArrowBright","ColorPerfect");
CachedThemeMetricC GAB_COLOR_GREAT ("GhostArrowBright","ColorGreat");
CachedThemeMetricC GAB_COLOR_GOOD ("GhostArrowBright","ColorGood");
CachedThemeMetricC GAB_COLOR_BOO ("GhostArrowBright","ColorBoo");
2001-12-28 10:15:59 +00:00
GhostArrowBright::GhostArrowBright()
{
GAB_SHOW_SECONDS.Refresh();
GAB_ZOOM_START.Refresh();
GAB_ZOOM_END.Refresh();
GAB_COLOR_MARVELOUS.Refresh();
GAB_COLOR_PERFECT.Refresh();
GAB_COLOR_GREAT.Refresh();
GAB_COLOR_GOOD.Refresh();
GAB_COLOR_BOO.Refresh();
SetDiffuse( RageColor(1,1,1,0) );
2001-12-28 10:15:59 +00:00
}
2002-07-28 20:28:37 +00:00
void GhostArrowBright::Update( float fDeltaTime )
2001-12-28 10:15:59 +00:00
{
2002-07-28 20:28:37 +00:00
Sprite::Update( fDeltaTime );
2001-12-28 10:15:59 +00:00
}
void GhostArrowBright::Step( TapNoteScore score )
2001-12-28 10:15:59 +00:00
{
// HACK: set the length of each frame so the animation plays in exactly 1 pop up time.
// We can't do this in the constructor because the image hasn't been loaded yet
for( int i=0; i<Sprite::GetNumStates(); i++ )
2003-05-22 05:28:37 +00:00
Sprite::m_States[i].fDelay = GAB_SHOW_SECONDS / Sprite::GetNumStates();
RageColor colorStart;
2001-12-28 10:15:59 +00:00
switch( score )
{
case TNS_MARVELOUS: colorStart = GAB_COLOR_MARVELOUS; break;
case TNS_PERFECT: colorStart = GAB_COLOR_PERFECT; break;
case TNS_GREAT: colorStart = GAB_COLOR_GREAT; break;
case TNS_GOOD: colorStart = GAB_COLOR_GOOD; break;
case TNS_BOO: colorStart = GAB_COLOR_BOO; break;
case TNS_MISS: // miss should never be passed in here
default:
ASSERT(0);
2001-12-28 10:15:59 +00:00
}
RageColor colorEnd = colorStart;
colorEnd.a = 0;
StopTweening();
SetDiffuse( colorStart );
2001-12-28 10:15:59 +00:00
SetState( 0 );
SetZoom( GAB_ZOOM_START );
BeginTweening( (float)GAB_SHOW_SECONDS/2 );
2003-04-12 06:16:12 +00:00
SetZoom( ((float)GAB_ZOOM_START+(float)GAB_ZOOM_END)/2 );
BeginTweening( (float)GAB_SHOW_SECONDS/2 );
2003-04-12 06:16:12 +00:00
SetZoom( GAB_ZOOM_END );
SetDiffuse( colorEnd );
2001-12-28 10:15:59 +00:00
}