Set the perspective when drawing in a subclass of ActorFrame, not just for children of subclasses.
This commit is contained in:
@@ -103,11 +103,11 @@ public:
|
|||||||
|
|
||||||
void Draw(); // calls, EarlyAbortDraw, BeginDraw, DrawPrimitives, EndDraw
|
void Draw(); // calls, EarlyAbortDraw, BeginDraw, DrawPrimitives, EndDraw
|
||||||
virtual bool EarlyAbortDraw() const { return false; } // return true to early abort drawing of this Actor
|
virtual bool EarlyAbortDraw() const { return false; } // return true to early abort drawing of this Actor
|
||||||
void BeginDraw(); // pushes transform onto world matrix stack
|
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
||||||
virtual void SetGlobalRenderStates(); // Actor should call this at beginning of their DrawPrimitives()
|
virtual void SetGlobalRenderStates(); // Actor should call this at beginning of their DrawPrimitives()
|
||||||
virtual void SetTextureRenderStates(); // Actor should call this after setting a texture
|
virtual void SetTextureRenderStates(); // Actor should call this after setting a texture
|
||||||
virtual void DrawPrimitives() {}; // Derivatives should override
|
virtual void DrawPrimitives() {}; // Derivatives should override
|
||||||
void EndDraw(); // pops transform from world matrix stack
|
virtual void EndDraw(); // pops transform from world matrix stack
|
||||||
|
|
||||||
// TODO: make Update non virtual and change all classes to override UpdateInternal
|
// TODO: make Update non virtual and change all classes to override UpdateInternal
|
||||||
// instead.
|
// instead.
|
||||||
|
|||||||
@@ -173,11 +173,9 @@ void ActorFrame::MoveToHead( Actor* pActor )
|
|||||||
m_SubActors.insert( m_SubActors.begin(), pActor );
|
m_SubActors.insert( m_SubActors.begin(), pActor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFrame::BeginDraw()
|
||||||
void ActorFrame::DrawPrimitives()
|
|
||||||
{
|
{
|
||||||
ASSERT_M( !m_bClearZBuffer, "ClearZBuffer not supported on ActorFrames" );
|
Actor::BeginDraw();
|
||||||
|
|
||||||
if( m_fFOV != -1 )
|
if( m_fFOV != -1 )
|
||||||
{
|
{
|
||||||
DISPLAY->CameraPushMatrix();
|
DISPLAY->CameraPushMatrix();
|
||||||
@@ -189,14 +187,18 @@ void ActorFrame::DrawPrimitives()
|
|||||||
DISPLAY->SetLighting( m_bLighting );
|
DISPLAY->SetLighting( m_bLighting );
|
||||||
if( m_bLighting )
|
if( m_bLighting )
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
RageColor(1,1,1,1),
|
RageColor(1,1,1,1),
|
||||||
RageColor(1,1,1,1),
|
RageColor(1,1,1,1),
|
||||||
RageColor(1,1,1,1),
|
RageColor(1,1,1,1),
|
||||||
RageVector3(0,0,1) );
|
RageVector3(0,0,1) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ActorFrame::DrawPrimitives()
|
||||||
|
{
|
||||||
|
ASSERT_M( !m_bClearZBuffer, "ClearZBuffer not supported on ActorFrames" );
|
||||||
|
|
||||||
// Don't set Actor-defined render states because we won't be drawing
|
// Don't set Actor-defined render states because we won't be drawing
|
||||||
// any geometry that belongs to this object.
|
// any geometry that belongs to this object.
|
||||||
@@ -215,9 +217,11 @@ void ActorFrame::DrawPrimitives()
|
|||||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||||
m_SubActors[i]->Draw();
|
m_SubActors[i]->Draw();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ActorFrame::EndDraw()
|
||||||
|
{
|
||||||
if( m_bOverrideLighting )
|
if( m_bOverrideLighting )
|
||||||
{
|
{
|
||||||
// TODO: pop state instead of turning lighting off
|
// TODO: pop state instead of turning lighting off
|
||||||
@@ -229,6 +233,7 @@ void ActorFrame::DrawPrimitives()
|
|||||||
{
|
{
|
||||||
DISPLAY->CameraPopMatrix();
|
DISPLAY->CameraPopMatrix();
|
||||||
}
|
}
|
||||||
|
Actor::EndDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorFrame::PlayCommandOnChildren( const RString &sCommandName )
|
void ActorFrame::PlayCommandOnChildren( const RString &sCommandName )
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ public:
|
|||||||
|
|
||||||
virtual void UpdateInternal( float fDeltaTime );
|
virtual void UpdateInternal( float fDeltaTime );
|
||||||
virtual void ProcessMessages( float fDeltaTime );
|
virtual void ProcessMessages( float fDeltaTime );
|
||||||
|
virtual void BeginDraw();
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
virtual void EndDraw();
|
||||||
|
|
||||||
// propagated commands
|
// propagated commands
|
||||||
virtual void SetDiffuse( RageColor c );
|
virtual void SetDiffuse( RageColor c );
|
||||||
|
|||||||
Reference in New Issue
Block a user