remove Actor::Fade*, remove unnessary virtuals in Actor
This commit is contained in:
@@ -78,8 +78,8 @@ void Actor::Draw()
|
|||||||
return; // early abort
|
return; // early abort
|
||||||
if( m_fHibernateSecondsLeft > 0 )
|
if( m_fHibernateSecondsLeft > 0 )
|
||||||
return; // early abort
|
return; // early abort
|
||||||
// if( this->EarlyAbortDraw() )
|
if( this->EarlyAbortDraw() )
|
||||||
// return;
|
return;
|
||||||
|
|
||||||
// call the most-derived versions
|
// call the most-derived versions
|
||||||
this->BeginDraw();
|
this->BeginDraw();
|
||||||
|
|||||||
+107
-106
@@ -19,8 +19,8 @@ class Actor
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Actor();
|
Actor();
|
||||||
virtual ~Actor() { }
|
virtual ~Actor() {}
|
||||||
void Reset();
|
virtual void Reset();
|
||||||
|
|
||||||
enum TweenType {
|
enum TweenType {
|
||||||
TWEEN_LINEAR,
|
TWEEN_LINEAR,
|
||||||
@@ -58,16 +58,17 @@ public:
|
|||||||
|
|
||||||
enum EffectClock { CLOCK_TIMER, CLOCK_BGM };
|
enum EffectClock { CLOCK_TIMER, CLOCK_BGM };
|
||||||
|
|
||||||
// let subclasses override
|
void Draw(); // calls, NeedsDraw, BeginDraw, DrawPrimitives, EndDraw
|
||||||
virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
|
virtual bool EarlyAbortDraw() { return false; } // return true to early abort drawing of this Actor
|
||||||
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
||||||
virtual void SetRenderStates(); // Actor should call at beginning of their DrawPrimitives()
|
virtual void SetRenderStates(); // Actor should call at beginning of their DrawPrimitives() after setting textures
|
||||||
virtual void DrawPrimitives() {}; // Derivitives should override
|
virtual void DrawPrimitives() {}; // Derivitives should override
|
||||||
virtual void EndDraw(); // pops transform from world matrix stack
|
virtual void EndDraw(); // pops transform from world matrix stack
|
||||||
|
|
||||||
bool IsFirstUpdate();
|
bool IsFirstUpdate();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void UpdateTweening( float fDeltaTime );
|
void UpdateTweening( float fDeltaTime );
|
||||||
virtual void CopyTweening( const Actor &from );
|
void CopyTweening( const Actor &from );
|
||||||
|
|
||||||
|
|
||||||
CString m_sName, m_sID;
|
CString m_sName, m_sID;
|
||||||
@@ -93,104 +94,105 @@ public:
|
|||||||
* is somewhat abstracted. Hmmm. -glenn */
|
* is somewhat abstracted. Hmmm. -glenn */
|
||||||
/* Things like the cursor on ScreenSelectDifficutly need to know the dest coordinates.
|
/* Things like the cursor on ScreenSelectDifficutly need to know the dest coordinates.
|
||||||
* -Chris */
|
* -Chris */
|
||||||
virtual float GetX() const { return m_current.pos.x; };
|
float GetX() const { return m_current.pos.x; };
|
||||||
virtual float GetY() const { return m_current.pos.y; };
|
float GetY() const { return m_current.pos.y; };
|
||||||
virtual float GetZ() const { return m_current.pos.z; };
|
float GetZ() const { return m_current.pos.z; };
|
||||||
virtual float GetDestX() { return DestTweenState().pos.x; };
|
float GetDestX() { return DestTweenState().pos.x; };
|
||||||
virtual float GetDestY() { return DestTweenState().pos.y; };
|
float GetDestY() { return DestTweenState().pos.y; };
|
||||||
virtual float GetDestZ() { return DestTweenState().pos.z; };
|
float GetDestZ() { return DestTweenState().pos.z; };
|
||||||
virtual void SetX( float x ) { DestTweenState().pos.x = x; };
|
void SetX( float x ) { DestTweenState().pos.x = x; };
|
||||||
virtual void SetY( float y ) { DestTweenState().pos.y = y; };
|
void SetY( float y ) { DestTweenState().pos.y = y; };
|
||||||
virtual void SetZ( float z ) { DestTweenState().pos.z = z; };
|
void SetZ( float z ) { DestTweenState().pos.z = z; };
|
||||||
virtual void SetXY( float x, float y ) { DestTweenState().pos.x = x; DestTweenState().pos.y = y; };
|
void SetXY( float x, float y ) { DestTweenState().pos.x = x; DestTweenState().pos.y = y; };
|
||||||
|
|
||||||
// height and width vary depending on zoom
|
// height and width vary depending on zoom
|
||||||
virtual float GetUnzoomedWidth() { return m_size.x; }
|
float GetUnzoomedWidth() { return m_size.x; }
|
||||||
virtual float GetUnzoomedHeight() { return m_size.y; }
|
float GetUnzoomedHeight() { return m_size.y; }
|
||||||
virtual float GetZoomedWidth() { return m_size.x * DestTweenState().scale.x; }
|
float GetZoomedWidth() { return m_size.x * DestTweenState().scale.x; }
|
||||||
virtual float GetZoomedHeight() { return m_size.y * DestTweenState().scale.y; }
|
float GetZoomedHeight() { return m_size.y * DestTweenState().scale.y; }
|
||||||
virtual void SetWidth( float width ) { m_size.x = width; }
|
void SetWidth( float width ) { m_size.x = width; }
|
||||||
virtual void SetHeight( float height ) { m_size.y = height; }
|
void SetHeight( float height ) { m_size.y = height; }
|
||||||
|
|
||||||
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
|
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
|
||||||
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
|
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
|
||||||
void SetBaseZoomZ( float zoom ) { m_baseScale.z = zoom; }
|
void SetBaseZoomZ( float zoom ) { m_baseScale.z = zoom; }
|
||||||
virtual void SetBaseRotationX( float rot ) { m_baseRotation.x = rot; }
|
void SetBaseRotationX( float rot ) { m_baseRotation.x = rot; }
|
||||||
virtual void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
|
void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
|
||||||
virtual void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
|
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
|
||||||
|
|
||||||
virtual float GetZoom() { return DestTweenState().scale.x; } // not accurate in some cases
|
float GetZoom() { return DestTweenState().scale.x; } // not accurate in some cases
|
||||||
virtual float GetZoomX() { return DestTweenState().scale.x; }
|
float GetZoomX() { return DestTweenState().scale.x; }
|
||||||
virtual float GetZoomY() { return DestTweenState().scale.y; }
|
float GetZoomY() { return DestTweenState().scale.y; }
|
||||||
virtual float GetZoomZ() { return DestTweenState().scale.z; }
|
float GetZoomZ() { return DestTweenState().scale.z; }
|
||||||
virtual void SetZoom( float zoom ) { DestTweenState().scale.x = zoom; DestTweenState().scale.y = zoom; }
|
void SetZoom( float zoom ) { DestTweenState().scale.x = zoom; DestTweenState().scale.y = zoom; }
|
||||||
virtual void SetZoomX( float zoom ) { DestTweenState().scale.x = zoom; }
|
void SetZoomX( float zoom ) { DestTweenState().scale.x = zoom; }
|
||||||
virtual void SetZoomY( float zoom ) { DestTweenState().scale.y = zoom; }
|
void SetZoomY( float zoom ) { DestTweenState().scale.y = zoom; }
|
||||||
virtual void SetZoomZ( float zoom ) { DestTweenState().scale.z = zoom; }
|
void SetZoomZ( float zoom ) { DestTweenState().scale.z = zoom; }
|
||||||
virtual void ZoomToWidth( float zoom ) { SetZoomX( zoom / GetUnzoomedWidth() ); }
|
void ZoomToWidth( float zoom ) { SetZoomX( zoom / GetUnzoomedWidth() ); }
|
||||||
virtual void ZoomToHeight( float zoom ){ SetZoomY( zoom / GetUnzoomedHeight() ); }
|
void ZoomToHeight( float zoom ){ SetZoomY( zoom / GetUnzoomedHeight() ); }
|
||||||
|
|
||||||
virtual float GetRotationX() { return DestTweenState().rotation.x; }
|
float GetRotationX() { return DestTweenState().rotation.x; }
|
||||||
virtual float GetRotationY() { return DestTweenState().rotation.y; }
|
float GetRotationY() { return DestTweenState().rotation.y; }
|
||||||
virtual float GetRotationZ() { return DestTweenState().rotation.z; }
|
float GetRotationZ() { return DestTweenState().rotation.z; }
|
||||||
virtual void SetRotationX( float rot ) { DestTweenState().rotation.x = rot; }
|
void SetRotationX( float rot ) { DestTweenState().rotation.x = rot; }
|
||||||
virtual void SetRotationY( float rot ) { DestTweenState().rotation.y = rot; }
|
void SetRotationY( float rot ) { DestTweenState().rotation.y = rot; }
|
||||||
virtual void SetRotationZ( float rot ) { DestTweenState().rotation.z = rot; }
|
void SetRotationZ( float rot ) { DestTweenState().rotation.z = rot; }
|
||||||
virtual void AddRotationH( float rot );
|
void AddRotationH( float rot );
|
||||||
virtual void AddRotationP( float rot );
|
void AddRotationP( float rot );
|
||||||
virtual void AddRotationR( float rot );
|
void AddRotationR( float rot );
|
||||||
|
|
||||||
virtual float GetCropLeft() { return DestTweenState().crop.left; }
|
float GetCropLeft() { return DestTweenState().crop.left; }
|
||||||
virtual float GetCropTop() { return DestTweenState().crop.top; }
|
float GetCropTop() { return DestTweenState().crop.top; }
|
||||||
virtual float GetCropRight() { return DestTweenState().crop.right;}
|
float GetCropRight() { return DestTweenState().crop.right;}
|
||||||
virtual float GetCropBottom() { return DestTweenState().crop.bottom;}
|
float GetCropBottom() { return DestTweenState().crop.bottom;}
|
||||||
virtual void SetCropLeft( float percent ) { DestTweenState().crop.left = percent; }
|
void SetCropLeft( float percent ) { DestTweenState().crop.left = percent; }
|
||||||
virtual void SetCropTop( float percent ) { DestTweenState().crop.top = percent; }
|
void SetCropTop( float percent ) { DestTweenState().crop.top = percent; }
|
||||||
virtual void SetCropRight( float percent ) { DestTweenState().crop.right = percent;}
|
void SetCropRight( float percent ) { DestTweenState().crop.right = percent;}
|
||||||
virtual void SetCropBottom( float percent ){ DestTweenState().crop.bottom = percent;}
|
void SetCropBottom( float percent ){ DestTweenState().crop.bottom = percent;}
|
||||||
|
|
||||||
virtual void SetFadeLeft( float percent ) { DestTweenState().fade.left = percent; }
|
void SetFadeLeft( float percent ) { DestTweenState().fade.left = percent; }
|
||||||
virtual void SetFadeTop( float percent ) { DestTweenState().fade.top = percent; }
|
void SetFadeTop( float percent ) { DestTweenState().fade.top = percent; }
|
||||||
virtual void SetFadeRight( float percent ) { DestTweenState().fade.right = percent;}
|
void SetFadeRight( float percent ) { DestTweenState().fade.right = percent;}
|
||||||
virtual void SetFadeBottom( float percent ){ DestTweenState().fade.bottom = percent;}
|
void SetFadeBottom( float percent ){ DestTweenState().fade.bottom = percent;}
|
||||||
virtual void SetFadeDiffuseColor( const RageColor &c ) { DestTweenState().fadecolor = c; }
|
void SetFadeDiffuseColor( const RageColor &c ) { DestTweenState().fadecolor = c; }
|
||||||
|
|
||||||
virtual void SetGlobalDiffuseColor( RageColor c );
|
void SetGlobalDiffuseColor( RageColor c );
|
||||||
virtual void SetGlobalX( float x );
|
void SetGlobalX( float x );
|
||||||
|
|
||||||
virtual void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) DestTweenState().diffuse[i] = c; };
|
void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) DestTweenState().diffuse[i] = c; };
|
||||||
virtual void SetDiffuseAlpha( float f ) { for(int i = 0; i < 4; ++i) { RageColor c = GetDiffuses( i ); c.a = f; SetDiffuses( i, c ); } }
|
void SetDiffuseAlpha( float f ) { for(int i = 0; i < 4; ++i) { RageColor c = GetDiffuses( i ); c.a = f; SetDiffuses( i, c ); } }
|
||||||
virtual void SetDiffuseColor( RageColor c );
|
void SetDiffuseColor( RageColor c );
|
||||||
virtual void SetDiffuses( int i, RageColor c ) { DestTweenState().diffuse[i] = c; };
|
void SetDiffuses( int i, RageColor c ) { DestTweenState().diffuse[i] = c; };
|
||||||
virtual void SetDiffuseUpperLeft( RageColor c ) { DestTweenState().diffuse[0] = c; };
|
void SetDiffuseUpperLeft( RageColor c ) { DestTweenState().diffuse[0] = c; };
|
||||||
virtual void SetDiffuseUpperRight( RageColor c ) { DestTweenState().diffuse[1] = c; };
|
void SetDiffuseUpperRight( RageColor c ) { DestTweenState().diffuse[1] = c; };
|
||||||
virtual void SetDiffuseLowerLeft( RageColor c ) { DestTweenState().diffuse[2] = c; };
|
void SetDiffuseLowerLeft( RageColor c ) { DestTweenState().diffuse[2] = c; };
|
||||||
virtual void SetDiffuseLowerRight( RageColor c ) { DestTweenState().diffuse[3] = c; };
|
void SetDiffuseLowerRight( RageColor c ) { DestTweenState().diffuse[3] = c; };
|
||||||
virtual void SetDiffuseTopEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[1] = c; };
|
void SetDiffuseTopEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[1] = c; };
|
||||||
virtual void SetDiffuseRightEdge( RageColor c ) { DestTweenState().diffuse[1] = DestTweenState().diffuse[3] = c; };
|
void SetDiffuseRightEdge( RageColor c ) { DestTweenState().diffuse[1] = DestTweenState().diffuse[3] = c; };
|
||||||
virtual void SetDiffuseBottomEdge( RageColor c ) { DestTweenState().diffuse[2] = DestTweenState().diffuse[3] = c; };
|
void SetDiffuseBottomEdge( RageColor c ) { DestTweenState().diffuse[2] = DestTweenState().diffuse[3] = c; };
|
||||||
virtual void SetDiffuseLeftEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[2] = c; };
|
void SetDiffuseLeftEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[2] = c; };
|
||||||
virtual RageColor GetDiffuse() { return DestTweenState().diffuse[0]; };
|
RageColor GetDiffuse() { return DestTweenState().diffuse[0]; };
|
||||||
virtual RageColor GetDiffuses( int i ) { return DestTweenState().diffuse[i]; };
|
RageColor GetDiffuses( int i ) { return DestTweenState().diffuse[i]; };
|
||||||
virtual void SetGlow( RageColor c ) { DestTweenState().glow = c; };
|
void SetGlow( RageColor c ) { DestTweenState().glow = c; };
|
||||||
virtual RageColor GetGlow() { return DestTweenState().glow; };
|
RageColor GetGlow() { return DestTweenState().glow; };
|
||||||
virtual void SetGlowMode( GlowMode m ) { DestTweenState().glowmode = m; };
|
void SetGlowMode( GlowMode m ) { DestTweenState().glowmode = m; };
|
||||||
virtual GlowMode GetGlowMode() { return DestTweenState().glowmode; };
|
GlowMode GetGlowMode() { return DestTweenState().glowmode; };
|
||||||
|
|
||||||
|
|
||||||
virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
||||||
virtual void StopTweening();
|
void StopTweening();
|
||||||
virtual void FinishTweening();
|
void FinishTweening();
|
||||||
virtual void HurryTweening( float factor );
|
void HurryTweening( float factor );
|
||||||
|
// Let ActorFrame and BGAnimation override
|
||||||
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
|
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
|
||||||
virtual TweenState& DestTweenState() // where Actor will end when its tween finish
|
TweenState& DestTweenState() // where Actor will end when its tween finish
|
||||||
{
|
{
|
||||||
if( m_TweenStates.empty() ) // not tweening
|
if( m_TweenStates.empty() ) // not tweening
|
||||||
return m_current;
|
return m_current;
|
||||||
else
|
else
|
||||||
return LatestTween();
|
return LatestTween();
|
||||||
}
|
}
|
||||||
virtual void SetLatestTween( TweenState ts ) { LatestTween() = ts; }
|
void SetLatestTween( TweenState ts ) { LatestTween() = ts; }
|
||||||
|
|
||||||
|
|
||||||
enum StretchType { fit_inside, cover };
|
enum StretchType { fit_inside, cover };
|
||||||
@@ -203,8 +205,9 @@ public:
|
|||||||
void StretchTo( const RectF &rect );
|
void StretchTo( const RectF &rect );
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Alignment settings. These need to be virtual for BitmapText
|
||||||
|
//
|
||||||
enum HorizAlign { align_left, align_center, align_right };
|
enum HorizAlign { align_left, align_center, align_right };
|
||||||
virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; }
|
virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; }
|
||||||
virtual void SetHorizAlign( CString s );
|
virtual void SetHorizAlign( CString s );
|
||||||
@@ -214,7 +217,9 @@ public:
|
|||||||
virtual void SetVertAlign( CString s );
|
virtual void SetVertAlign( CString s );
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
// effects
|
// effects
|
||||||
|
//
|
||||||
void SetEffectNone() { m_Effect = no_effect; }
|
void SetEffectNone() { m_Effect = no_effect; }
|
||||||
Effect GetEffect() { return m_Effect; }
|
Effect GetEffect() { return m_Effect; }
|
||||||
void SetEffectColor1( RageColor c ) { m_effectColor1 = c; }
|
void SetEffectColor1( RageColor c ) { m_effectColor1 = c; }
|
||||||
@@ -272,31 +277,27 @@ public:
|
|||||||
// TODO: Implement hibernate as a tween type?
|
// TODO: Implement hibernate as a tween type?
|
||||||
void SetHibernate( float fSecs ) { m_fHibernateSecondsLeft = fSecs; }
|
void SetHibernate( float fSecs ) { m_fHibernateSecondsLeft = fSecs; }
|
||||||
|
|
||||||
virtual void EnableAnimation( bool b ) { m_bIsAnimating = b; }
|
virtual void EnableAnimation( bool b ) { m_bIsAnimating = b; } // Sprite needs to overload this
|
||||||
virtual void StartAnimating() { this->EnableAnimation(true); };
|
void StartAnimating() { this->EnableAnimation(true); };
|
||||||
virtual void StopAnimating() { this->EnableAnimation(false); };
|
void StopAnimating() { this->EnableAnimation(false); };
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// render states
|
// render states
|
||||||
//
|
//
|
||||||
virtual void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
|
void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
|
||||||
virtual void SetBlendMode( CString );
|
void SetBlendMode( CString );
|
||||||
virtual void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
||||||
virtual void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; }
|
void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; }
|
||||||
virtual void SetUseZBuffer( bool b ) { SetZTest(b); SetZWrite(b); }
|
void SetUseZBuffer( bool b ) { SetZTest(b); SetZWrite(b); }
|
||||||
virtual void SetZTest( bool b ) { m_bZTest = b; }
|
void SetZTest( bool b ) { m_bZTest = b; }
|
||||||
virtual void SetZWrite( bool b ) { m_bZWrite = b; }
|
void SetZWrite( bool b ) { m_bZWrite = b; }
|
||||||
virtual void SetCullMode( CullMode mode ) { m_CullMode = mode; }
|
void SetCullMode( CullMode mode ) { m_CullMode = mode; }
|
||||||
virtual void SetCullMode( CString );
|
void SetCullMode( CString );
|
||||||
|
|
||||||
//
|
//
|
||||||
// fade command
|
// Commands
|
||||||
//
|
//
|
||||||
void Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff );
|
|
||||||
void FadeOn( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,false); };
|
|
||||||
void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); };
|
|
||||||
|
|
||||||
void Command( CString sCommands ); // return length in seconds to execute command
|
void Command( CString sCommands ); // return length in seconds to execute command
|
||||||
virtual void HandleCommand( const ParsedCommand &command ); // derivable
|
virtual void HandleCommand( const ParsedCommand &command ); // derivable
|
||||||
static float GetCommandLength( CString command );
|
static float GetCommandLength( CString command );
|
||||||
@@ -310,8 +311,8 @@ public:
|
|||||||
//
|
//
|
||||||
virtual void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ) {}
|
virtual void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ) {}
|
||||||
virtual void LosingFocus() {}
|
virtual void LosingFocus() {}
|
||||||
virtual void PlayOffCommand() { this->PlayCommand("Off"); }
|
|
||||||
virtual void PlayCommand( const CString &sCommandName ) {}
|
virtual void PlayCommand( const CString &sCommandName ) {}
|
||||||
|
virtual void PlayOffCommand( const CString &sCommandName ) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -365,11 +365,14 @@ void BitmapText::CropToWidth( int iMaxWidthInSourcePixels )
|
|||||||
BuildChars();
|
BuildChars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BitmapText::EarlyAbortDraw()
|
||||||
|
{
|
||||||
|
return m_wTextLines.empty();
|
||||||
|
}
|
||||||
|
|
||||||
// draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale
|
// draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale
|
||||||
void BitmapText::DrawPrimitives()
|
void BitmapText::DrawPrimitives()
|
||||||
{
|
{
|
||||||
if( m_wTextLines.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
Actor::SetRenderStates(); // set Actor-specified render states
|
Actor::SetRenderStates(); // set Actor-specified render states
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
|
|
||||||
void CropToWidth( int iWidthInSourcePixels );
|
void CropToWidth( int iWidthInSourcePixels );
|
||||||
|
|
||||||
|
virtual bool EarlyAbortDraw();
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void TurnRainbowOn() { m_bRainbow = true; };
|
void TurnRainbowOn() { m_bRainbow = true; };
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ void MenuElements::StartTransitioning( ScreenMessage smSendWhenDone )
|
|||||||
UtilOffCommand( m_autoFooter, "MenuElements" );
|
UtilOffCommand( m_autoFooter, "MenuElements" );
|
||||||
UtilOffCommand( m_textHelp, "MenuElements" );
|
UtilOffCommand( m_textHelp, "MenuElements" );
|
||||||
|
|
||||||
m_Background.PlayOffCommand();
|
m_Background.PlayCommand("Off");
|
||||||
|
|
||||||
m_Out.StartTransitioning(smSendWhenDone);
|
m_Out.StartTransitioning(smSendWhenDone);
|
||||||
|
|
||||||
|
|||||||
@@ -409,14 +409,13 @@ void Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Model::EarlyAbortDraw()
|
||||||
|
{
|
||||||
|
return m_pGeometry == NULL || m_pGeometry->m_Meshes.empty();
|
||||||
|
}
|
||||||
|
|
||||||
void Model::DrawPrimitives()
|
void Model::DrawPrimitives()
|
||||||
{
|
{
|
||||||
if( m_pGeometry == NULL ||
|
|
||||||
m_pGeometry->m_Meshes.empty() )
|
|
||||||
{
|
|
||||||
return; // bail early
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Don't if we're fully transparent */
|
/* Don't if we're fully transparent */
|
||||||
if( m_pTempState->diffuse[0].a < 0.001f && m_pTempState->glow.a < 0.001f )
|
if( m_pTempState->diffuse[0].a < 0.001f && m_pTempState->glow.a < 0.001f )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public:
|
|||||||
void PlayAnimation( CString sAniName, float fPlayRate = 1 );
|
void PlayAnimation( CString sAniName, float fPlayRate = 1 );
|
||||||
|
|
||||||
virtual void Update( float fDelta );
|
virtual void Update( float fDelta );
|
||||||
|
virtual bool EarlyAbortDraw();
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void AdvanceFrame (float dt);
|
void AdvanceFrame (float dt);
|
||||||
|
|||||||
@@ -69,14 +69,14 @@ void ReceptorArrow::Update( float fDeltaTime )
|
|||||||
m_pPressBlock->SetVertAlign( bReverse ? Actor::align_bottom : Actor::align_top );
|
m_pPressBlock->SetVertAlign( bReverse ? Actor::align_bottom : Actor::align_top );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceptorArrow::Draw()
|
void ReceptorArrow::DrawPrimitives()
|
||||||
{
|
{
|
||||||
m_pReceptorGo->SetHidden( !GAMESTATE->m_bPastHereWeGo );
|
m_pReceptorGo->SetHidden( !GAMESTATE->m_bPastHereWeGo );
|
||||||
m_pReceptorWaiting->SetHidden( GAMESTATE->m_bPastHereWeGo );
|
m_pReceptorWaiting->SetHidden( GAMESTATE->m_bPastHereWeGo );
|
||||||
m_pPressBlock->SetHidden( !m_bIsPressed );
|
m_pPressBlock->SetHidden( !m_bIsPressed );
|
||||||
m_bIsPressed = false; // it may get turned back on next update
|
m_bIsPressed = false; // it may get turned back on next update
|
||||||
|
|
||||||
ActorFrame::Draw();
|
ActorFrame::DrawPrimitives();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceptorArrow::Step()
|
void ReceptorArrow::Step()
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
ReceptorArrow();
|
ReceptorArrow();
|
||||||
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
|
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
|
||||||
|
|
||||||
virtual void Draw();
|
virtual void DrawPrimitives();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
void Step();
|
void Step();
|
||||||
void SetPressed() { m_bIsPressed = true; };
|
void SetPressed() { m_bIsPressed = true; };
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
case SM_StartClosing:
|
case SM_StartClosing:
|
||||||
if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() && !m_Back.IsTransitioning() )
|
if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() && !m_Back.IsTransitioning() )
|
||||||
{
|
{
|
||||||
m_Background.PlayOffCommand();
|
m_Background.PlayCommand("Off");
|
||||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -92,7 +92,7 @@ void ScreenCaution::MenuStart( PlayerNumber pn )
|
|||||||
{
|
{
|
||||||
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Back.IsTransitioning() )
|
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Back.IsTransitioning() )
|
||||||
return;
|
return;
|
||||||
m_Background.PlayOffCommand();
|
m_Background.PlayCommand("Off");
|
||||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -425,21 +425,21 @@ void ScreenEz2SelectMusic::MenuBack( PlayerNumber pn )
|
|||||||
|
|
||||||
void ScreenEz2SelectMusic::TweenOffScreen()
|
void ScreenEz2SelectMusic::TweenOffScreen()
|
||||||
{
|
{
|
||||||
m_MusicBannerWheel.FadeOff( 0, "foldy", TWEEN_TIME );
|
m_MusicBannerWheel.Command( "linear,0.5;zoomy,0" );
|
||||||
m_PumpDifficultyCircle.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_PumpDifficultyCircle.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_Guide.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_Guide.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_PumpDifficultyRating.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_PumpDifficultyRating.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_Guide.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_Guide.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_ChoiceListFrame.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_ChoiceListFrame.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_ChoiceListHighlight.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_ChoiceListHighlight.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_CurrentGroup.FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_CurrentGroup.Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
for(int i=0; i<NUM_PLAYERS; i++)
|
for(int i=0; i<NUM_PLAYERS; i++)
|
||||||
{
|
{
|
||||||
m_SpeedIcon[i].FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_SpeedIcon[i].Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_MirrorIcon[i].FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_MirrorIcon[i].Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_ShuffleIcon[i].FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_ShuffleIcon[i].Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_HiddenIcon[i].FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_HiddenIcon[i].Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
m_VanishIcon[i].FadeOff( 0, "fade", TWEEN_TIME*2 );
|
m_VanishIcon[i].Command( "Linear,1;DiffuseAlpha,0" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,32 +173,32 @@ void ScreenSelectCourse::Update( float fDelta )
|
|||||||
|
|
||||||
void ScreenSelectCourse::TweenOnScreen()
|
void ScreenSelectCourse::TweenOnScreen()
|
||||||
{
|
{
|
||||||
m_sprExplanation.FadeOn( 0.5f, "left bounce", TWEEN_TIME );
|
m_sprExplanation.Command( "Sleep,0.5;AddX,-640;BounceEnd,0.5;AddX,640" );
|
||||||
m_sprBannerFrame.FadeOn( 0, "left bounce", TWEEN_TIME );
|
m_sprBannerFrame.Command( "AddX,-640;BounceEnd,0.5;AddX,640" );
|
||||||
m_Banner.FadeOn( 0, "left bounce", TWEEN_TIME );
|
m_Banner.Command( "AddX,-640;BounceEnd,0.5;AddX,640" );
|
||||||
m_textNumSongs.FadeOn( 0, "left bounce", TWEEN_TIME );
|
m_textNumSongs.Command( "AddX,-640;BounceEnd,0.5;AddX,640" );
|
||||||
m_textTime.FadeOn( 0, "left bounce", TWEEN_TIME );
|
m_textTime.Command( "AddX,-640;BounceEnd,0.5;AddX,640" );
|
||||||
m_CourseContentsFrame.FadeOn( 0, "foldy", TWEEN_TIME );
|
m_CourseContentsFrame.Command( "ZoomY,0;BounceEnd,0.5;ZoomY,1" );
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
{
|
{
|
||||||
m_sprHighScoreFrame[p].FadeOn( 0, "right bounce", TWEEN_TIME );
|
m_sprHighScoreFrame[p].Command( "AddX,640;BounceEnd,0.5;AddX,-640" );
|
||||||
m_HighScore[p].FadeOn( 0, "right bounce", TWEEN_TIME );
|
m_HighScore[p].Command( "AddX,640;BounceEnd,0.5;AddX,-640" );
|
||||||
}
|
}
|
||||||
m_MusicWheel.TweenOnScreen();
|
m_MusicWheel.TweenOnScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSelectCourse::TweenOffScreen()
|
void ScreenSelectCourse::TweenOffScreen()
|
||||||
{
|
{
|
||||||
m_sprExplanation.FadeOff( 0, "left bounce", TWEEN_TIME );
|
m_sprExplanation.Command( "BounceBegin,0.5;AddX,-640" );
|
||||||
m_sprBannerFrame.FadeOff( 0, "left bounce", TWEEN_TIME );
|
m_sprBannerFrame.Command( "BounceBegin,0.5;AddX,-640" );
|
||||||
m_Banner.FadeOff( 0, "left bounce", TWEEN_TIME );
|
m_Banner.Command( "BounceBegin,0.5;AddX,-640" );
|
||||||
m_textNumSongs.FadeOff( 0, "left bounce", TWEEN_TIME );
|
m_textNumSongs.Command( "BounceBegin,0.5;AddX,-640" );
|
||||||
m_textTime.FadeOff( 0, "left bounce", TWEEN_TIME );
|
m_textTime.Command( "BounceBegin,0.5;AddX,-640" );
|
||||||
m_CourseContentsFrame.FadeOff( 0, "foldy", TWEEN_TIME );
|
m_CourseContentsFrame.Command( "Linear,0.5;ZoomY,0" );
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
{
|
{
|
||||||
m_sprHighScoreFrame[p].FadeOff( 0, "right bounce", TWEEN_TIME );
|
m_sprHighScoreFrame[p].Command( "BounceBegin,0.5;AddX,640" );
|
||||||
m_HighScore[p].FadeOff( 0, "right bounce", TWEEN_TIME );
|
m_HighScore[p].Command( "BounceBegin,0.5;AddX,640" );
|
||||||
}
|
}
|
||||||
m_MusicWheel.TweenOffScreen();
|
m_MusicWheel.TweenOffScreen();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,8 +412,8 @@ void ScreenSelectDifficultyEX::MenuStart( PlayerNumber pn )
|
|||||||
m_sprOK[pn].SetX( GetCursorX(pn) );
|
m_sprOK[pn].SetX( GetCursorX(pn) );
|
||||||
m_sprOK[pn].SetY( GetCursorY(pn) );
|
m_sprOK[pn].SetY( GetCursorY(pn) );
|
||||||
|
|
||||||
m_sprCursor[pn].FadeOn( 0.0, "foldy bounce", 0.3f );
|
m_sprCursor[pn].Command( "ZoomY,0;BounceEnd,0.3;ZoomY,1" );
|
||||||
m_sprOK[pn].FadeOn( 0.0, "foldy bounce", 0.3f );
|
m_sprOK[pn].Command( "ZoomY,0;BounceEnd,0.3;ZoomY,1" );
|
||||||
|
|
||||||
|
|
||||||
// check to see if everyone has chosen
|
// check to see if everyone has chosen
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ void ScreenSelectMusic::TweenCoursePartsOnScreen( bool Initial )
|
|||||||
m_CourseContentsFrame.SetZoomY( 1 );
|
m_CourseContentsFrame.SetZoomY( 1 );
|
||||||
if( Initial )
|
if( Initial )
|
||||||
{
|
{
|
||||||
m_CourseContentsFrame.FadeOn( 0, "foldy", 0.3f );
|
m_CourseContentsFrame.Command( "ZoomY,0;BounceEnd,0.3;Zoom,1" );
|
||||||
COMMAND( m_CourseContentsFrame, "On" );
|
COMMAND( m_CourseContentsFrame, "On" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -454,7 +454,7 @@ void ScreenSelectMusic::TweenCoursePartsOffScreen( bool Final )
|
|||||||
if( Final )
|
if( Final )
|
||||||
{
|
{
|
||||||
m_CourseContentsFrame.SetZoomY( 1 );
|
m_CourseContentsFrame.SetZoomY( 1 );
|
||||||
m_CourseContentsFrame.FadeOff( 0, "foldy", 0.3f );
|
m_CourseContentsFrame.Command( "BounceBegin,0.3;ZoomY,0" );
|
||||||
OFF_COMMAND( m_CourseContentsFrame );
|
OFF_COMMAND( m_CourseContentsFrame );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -435,11 +435,14 @@ static RageColor scale( float x, float l1, float h1, const RageColor &a, const R
|
|||||||
SCALE( x, l1, h1, a.a, b.a ) );
|
SCALE( x, l1, h1, a.a, b.a ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Sprite::EarlyAbortDraw()
|
||||||
|
{
|
||||||
|
// return m_pTexture == NULL && !m_bDrawIfTextureNull;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void Sprite::DrawPrimitives()
|
void Sprite::DrawPrimitives()
|
||||||
{
|
{
|
||||||
if( m_pTexture == NULL && !m_bDrawIfTextureNull )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( m_pTempState->fade.top > 0 ||
|
if( m_pTempState->fade.top > 0 ||
|
||||||
m_pTempState->fade.bottom > 0 ||
|
m_pTempState->fade.bottom > 0 ||
|
||||||
m_pTempState->fade.left > 0 ||
|
m_pTempState->fade.left > 0 ||
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
Sprite();
|
Sprite();
|
||||||
virtual ~Sprite();
|
virtual ~Sprite();
|
||||||
|
|
||||||
|
virtual bool EarlyAbortDraw();
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
void UpdateAnimationState(); // take m_fSecondsIntoState, and move to a new state
|
void UpdateAnimationState(); // take m_fSecondsIntoState, and move to a new state
|
||||||
|
|||||||
Reference in New Issue
Block a user