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