diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 45a3676e83..54e796cd83 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -540,6 +540,8 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) ini.GetValue( sLayer, "Lighting", m_bLighting ); ini.GetValue( sLayer, "TexCoordVelocityX", m_fTexCoordVelocityX ); ini.GetValue( sLayer, "TexCoordVelocityY", m_fTexCoordVelocityY ); + ini.GetValue( sLayer, "DrawCond", m_sDrawCond ); + // compat: ini.GetValue( sLayer, "StretchTexCoordVelocityX", m_fTexCoordVelocityX ); ini.GetValue( sLayer, "StretchTexCoordVelocityY", m_fTexCoordVelocityY ); @@ -935,6 +937,17 @@ void BGAnimationLayer::Update( float fDeltaTime ) } } +bool BGAnimationLayer::EarlyAbortDraw() +{ + if( m_sDrawCond.empty() ) + return false; + + if( !Lua::RunExpression( m_sDrawCond ) ) + return true; + + return false; +} + void BGAnimationLayer::DrawPrimitives() { if( m_fFOV != -1 ) diff --git a/stepmania/src/BGAnimationLayer.h b/stepmania/src/BGAnimationLayer.h index 8134b5f103..7b2bb7b0f4 100644 --- a/stepmania/src/BGAnimationLayer.h +++ b/stepmania/src/BGAnimationLayer.h @@ -32,6 +32,7 @@ public: void Update( float fDeltaTime ); void DrawPrimitives(); + bool EarlyAbortDraw(); float GetMaxTweenTimeLeft() const; void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ); @@ -96,6 +97,8 @@ protected: float m_fFOV; // -1 = no change bool m_bLighting; + CString m_sDrawCond; + // stretch stuff float m_fTexCoordVelocityX; float m_fTexCoordVelocityY;