add ClearZBuffer command for Actors
add Lighting flag for BGAnimationLayer
This commit is contained in:
@@ -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() );
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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; i<m_pActors.size(); i++ )
|
||||
m_pActors[i]->Draw();
|
||||
|
||||
DISPLAY->LoadMenuPerspective( 0 );
|
||||
if( m_bLighting )
|
||||
{
|
||||
DISPLAY->SetLightOff( 0 );
|
||||
DISPLAY->SetLighting( false );
|
||||
}
|
||||
}
|
||||
|
||||
void BGAnimationLayer::SetDiffuse( RageColor c )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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") );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user