You know the drill.

This commit is contained in:
Jason Felds
2011-02-18 15:34:33 -05:00
parent 32af73f23c
commit 4a4b2ff440
3 changed files with 48 additions and 22 deletions
+14 -6
View File
@@ -1,4 +1,4 @@
/* RollingNumbers - animates from one number to another by scrolling its digits. */ /** @brief RollingNumbers - animates from one number to another by scrolling its digits. */
#ifndef RollingNumbers_H #ifndef RollingNumbers_H
#define RollingNumbers_H #define RollingNumbers_H
@@ -17,6 +17,9 @@ public:
virtual void DrawPrimitives(); virtual void DrawPrimitives();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
/**
* @brief Set the new target number to be reached.
* @param fTargetNumber the new target number. */
void SetTargetNumber( float fTargetNumber ); void SetTargetNumber( float fTargetNumber );
void UpdateText(); void UpdateText();
@@ -30,15 +33,20 @@ private:
ThemeMetric<bool> COMMIFY; ThemeMetric<bool> COMMIFY;
ThemeMetric<RageColor> LEADING_ZERO_MULTIPLY_COLOR; ThemeMetric<RageColor> LEADING_ZERO_MULTIPLY_COLOR;
float m_fCurrentNumber; // currently showing this /** @brief The currently showing number. */
float m_fTargetNumber; // approach this float m_fCurrentNumber;
float m_fScoreVelocity; // approach target at this speed /** @brief The number we are trying to approach. */
float m_fTargetNumber;
/** @brief The speed we are trying to reach the target number. */
float m_fScoreVelocity;
}; };
#endif #endif
/* /**
* (c) 2001-2004 Chris Danford * @file
* @author Chris Danford (c) 2001-2004
* @section LICENSE
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
+16 -7
View File
@@ -1,4 +1,4 @@
/* Sprite - A bitmap Actor that animates and moves around. */ /** @brief Sprite - A bitmap Actor that animates and moves around. */
#ifndef SPRITE_H #ifndef SPRITE_H
#define SPRITE_H #define SPRITE_H
@@ -61,8 +61,12 @@ public:
void SetEffectMode( EffectMode em ) { m_EffectMode = em; } void SetEffectMode( EffectMode em ) { m_EffectMode = em; }
void SetTexCoordVelocity(float fVelX, float fVelY); void SetTexCoordVelocity(float fVelX, float fVelY);
// Scale the Sprite maintaining the aspect ratio so that it fits /**
// within (fWidth,fHeight) and is clipped to (fWidth,fHeight). * @brief Scale the Sprite while maintaining the aspect ratio.
*
* It has to fit within and become clipped to the given parameters.
* @param fWidth the new width.
* @param fHeight the new height. */
void ScaleToClipped( float fWidth, float fHeight ); void ScaleToClipped( float fWidth, float fHeight );
void CropTo( float fWidth, float fHeight ); void CropTo( float fWidth, float fHeight );
static bool IsDiagonalBanner( int iWidth, int iHeight ); static bool IsDiagonalBanner( int iWidth, int iHeight );
@@ -82,14 +86,17 @@ private:
RageTexture* m_pTexture; RageTexture* m_pTexture;
/** @brief The Sprite's present state. */
struct State struct State
{ {
RectF rect; RectF rect;
float fDelay; // "seconds to show" /** @brief The number of "seconds to show". */
float fDelay;
}; };
vector<State> m_States; vector<State> m_States;
int m_iCurState; int m_iCurState;
float m_fSecsIntoState; // number of seconds that have elapsed since we switched to this frame /** @brief The number of seconds that have elapsed since we switched to this frame. */
float m_fSecsIntoState;
EffectMode m_EffectMode; EffectMode m_EffectMode;
bool m_bUsingCustomTexCoords; bool m_bUsingCustomTexCoords;
@@ -106,8 +113,10 @@ private:
#endif #endif
/* /**
* (c) 2001-2004 Chris Danford * @file
* @author Chris Danford (c) 2001-2004
* @section LICENSE
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
+18 -9
View File
@@ -1,4 +1,4 @@
/* ITween - Interface for simple interpolation. */ /** @brief ITween - Interface for simple interpolation. */
#ifndef TWEEN_H #ifndef TWEEN_H
#define TWEEN_H #define TWEEN_H
@@ -8,22 +8,29 @@
struct lua_State; struct lua_State;
typedef lua_State Lua; typedef lua_State Lua;
/** @brief The different tweening types available. */
enum TweenType enum TweenType
{ {
TWEEN_LINEAR, TWEEN_LINEAR, /**< A linear tween. */
TWEEN_ACCELERATE, TWEEN_ACCELERATE, /**< An accelerating tween. */
TWEEN_DECELERATE, TWEEN_DECELERATE, /**< A decelerating tween. */
TWEEN_SPRING, TWEEN_SPRING, /**< A spring tween. */
TWEEN_BEZIER, TWEEN_BEZIER, /**< A bezier tween. */
NUM_TweenType, NUM_TweenType, /**< The number of tween types. */
TweenType_Invalid TweenType_Invalid
}; };
/** @brief A custom foreach loop iterating through the tween types. */
#define FOREACH_TweenType( tt ) FOREACH_ENUM( TweenType, tt ) #define FOREACH_TweenType( tt ) FOREACH_ENUM( TweenType, tt )
LuaDeclareType( TweenType ); LuaDeclareType( TweenType );
/**
* @brief The interface for simple interpolation.
*
* Funny enough, this is a class. */
class ITween class ITween
{ {
public: public:
/** @brief Create the initial interface. */
virtual ~ITween() { } virtual ~ITween() { }
virtual float Tween( float f ) const = 0; virtual float Tween( float f ) const = 0;
virtual ITween *Copy() const = 0; virtual ITween *Copy() const = 0;
@@ -34,8 +41,10 @@ public:
#endif #endif
/* /**
* (c) 2006 Glenn Maynard * @file
* @author Glenn Maynard (c) 2006
* @section LICENSE
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a