diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 4e2ec1f5e1..28e6de3713 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -51,6 +51,7 @@ void Actor::Reset() m_bTextureWrapping = false; m_BlendMode = BLEND_NORMAL; + m_bClearZBuffer = false; m_bUseZBuffer = false; m_bUseBackfaceCull = false; } @@ -195,6 +196,8 @@ void Actor::SetRenderStates() DISPLAY->SetTextureWrapping( m_bTextureWrapping ); DISPLAY->SetBlendMode( m_BlendMode ); DISPLAY->SetZBuffer( m_bUseZBuffer ); + if( m_bClearZBuffer ) + DISPLAY->ClearZBuffer(); DISPLAY->SetBackfaceCull( m_bUseBackfaceCull ); } @@ -775,6 +778,7 @@ void Actor::HandleCommand( const CStringArray &asTokens ) else if( sName=="additiveblend" ) SetBlendMode( bParam(1) ? BLEND_ADD : BLEND_NORMAL ); else if( sName=="blend" ) SetBlendMode( sParam(1) ); else if( sName=="zbuffer" ) SetUseZBuffer( bParam(1) ); + else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) ); else { CString sError = ssprintf( "Actor::HandleCommand: Unrecognized command name '%s'.", sName.c_str() ); diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 9e90176957..802b1fcbfd 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -247,6 +247,7 @@ public: 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 ) { m_bUseZBuffer = b; } virtual void SetUseBackfaceCull( bool b ) { m_bUseBackfaceCull = b; } @@ -332,6 +333,7 @@ protected: // bool m_bTextureWrapping; BlendMode m_BlendMode; + bool m_bClearZBuffer; bool m_bUseZBuffer; bool m_bUseBackfaceCull; }; diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index f1e0c33c76..f871805737 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -58,6 +58,7 @@ void BGAnimationLayer::Init() m_fUpdateRate = 1; m_fFOV = 0; // ortho + m_bLighting = 0; // ortho // m_bCycleColor = false; // m_bCycleAlpha = false; @@ -516,6 +517,7 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) ini.GetValueI( sLayer, "Type", (int&)m_Type ); ini.GetValue ( sLayer, "Command", m_sCommand ); ini.GetValueF( sLayer, "FOV", m_fFOV ); + ini.GetValueB( sLayer, "Lighting", m_bLighting ); ini.GetValueF( sLayer, "StretchTexCoordVelocityX", m_fStretchTexCoordVelocityX ); ini.GetValueF( sLayer, "StretchTexCoordVelocityY", m_fStretchTexCoordVelocityY ); ini.GetValueF( sLayer, "ZoomMin", m_fZoomMin ); @@ -902,9 +904,26 @@ void BGAnimationLayer::Update( float fDeltaTime ) void BGAnimationLayer::Draw() { DISPLAY->LoadMenuPerspective( m_fFOV ); + if( m_bLighting ) + { + DISPLAY->SetLighting( true ); + DISPLAY->SetLightDirectional( + 0, + RageColor(0.6,0.6,0.6,1), + RageColor(0.9,0.9,0.9,1), + RageColor(0,0,0,1), + RageVector3(0, 0, 1) ); + } + for( unsigned i=0; iDraw(); + DISPLAY->LoadMenuPerspective( 0 ); + if( m_bLighting ) + { + DISPLAY->SetLightOff( 0 ); + DISPLAY->SetLighting( false ); + } } void BGAnimationLayer::SetDiffuse( RageColor c ) diff --git a/stepmania/src/BGAnimationLayer.h b/stepmania/src/BGAnimationLayer.h index 2b3879f9ff..865c8bc86b 100644 --- a/stepmania/src/BGAnimationLayer.h +++ b/stepmania/src/BGAnimationLayer.h @@ -98,6 +98,7 @@ protected: CString m_sCommand; float m_fUpdateRate; // get by GainingFocus float m_fFOV; + bool m_bLighting; // stretch stuff float m_fStretchTexCoordVelocityX; diff --git a/stepmania/src/ScreenCaution.cpp b/stepmania/src/ScreenCaution.cpp index 42da14e044..6b90df1649 100644 --- a/stepmania/src/ScreenCaution.cpp +++ b/stepmania/src/ScreenCaution.cpp @@ -50,7 +50,7 @@ ScreenCaution::ScreenCaution() : Screen( "ScreenCaution" ) m_Back.Load( THEME->GetPathToB("Common back") ); this->AddChild( &m_Back ); - this->PostScreenMessage( SM_StartClosing, 3 ); + this->PostScreenMessage( SM_StartClosing, m_Background.GetLengthSeconds()-m_Out.GetLengthSeconds() ); SOUNDMAN->PlayMusic( THEME->GetPathToS("ScreenCaution music") ); }