Minor changes to use CUnit::GetModel() and CUnit::GetObject() instead of m_Model and m_Object, as these are no longer public.
This was SVN commit r308.
This commit is contained in:
parent
f4d09178a9
commit
6535db7fd4
@ -29,7 +29,6 @@ void CBaseEntityCollection::loadTemplates()
|
||||
|
||||
// He's so annoyingly slow...
|
||||
CBaseEntity* dude = getTemplate( "Prometheus Dude" );
|
||||
dude->m_actorObject->m_WalkAnim->m_FrameTime /= 10.0f;
|
||||
dude->m_speed *= 10.0f;
|
||||
|
||||
/*
|
||||
|
@ -15,10 +15,7 @@ CEntity::CEntity( CBaseEntity* base, CVector3D position, float orientation )
|
||||
// Set our parent unit and build us an actor.
|
||||
|
||||
m_base = base;
|
||||
m_actor = new CUnit;
|
||||
|
||||
m_actor->m_Object = m_base->m_actorObject;
|
||||
m_actor->m_Model = ( m_actor->m_Object->m_Model ) ? m_actor->m_Object->m_Model->Clone() : NULL;
|
||||
m_actor = new CUnit(m_base->m_actorObject,m_base->m_actorObject->m_Model->Clone());
|
||||
|
||||
// Register the actor with the renderer.
|
||||
|
||||
@ -58,7 +55,6 @@ CEntity::~CEntity()
|
||||
{
|
||||
if( m_actor )
|
||||
{
|
||||
if( m_actor->m_Model ) delete( m_actor->m_Model );
|
||||
g_UnitMan.RemoveUnit( m_actor );
|
||||
delete( m_actor );
|
||||
}
|
||||
@ -80,16 +76,12 @@ void CEntity::updateActorTransforms()
|
||||
m._41 = 0.0f; m._42 = 0.0f; m._43 = 0.0f; m._44 = 1.0f;
|
||||
|
||||
/* Equivalent to:
|
||||
|
||||
m.SetYRotation( m_orientation );
|
||||
|
||||
m.Translate( m_position );
|
||||
|
||||
But the matrix multiplication seemed such a waste when we already have a forward vector
|
||||
|
||||
m.SetYRotation( m_orientation );
|
||||
m.Translate( m_position );
|
||||
But the matrix multiplication seemed such a waste when we already have a forward vector
|
||||
*/
|
||||
|
||||
m_actor->m_Model->SetTransform( m );
|
||||
m_actor->GetModel()->SetTransform( m );
|
||||
}
|
||||
|
||||
float CEntity::getExactGroundLevel( float x, float y )
|
||||
@ -161,8 +153,8 @@ void CEntity::update( float timestep )
|
||||
assert( 0 && "Invalid entity order" );
|
||||
}
|
||||
}
|
||||
if( m_actor->m_Model->GetAnimation() != m_actor->m_Object->m_IdleAnim )
|
||||
m_actor->m_Model->SetAnimation( m_actor->m_Object->m_IdleAnim );
|
||||
if( m_actor->GetModel()->GetAnimation() != m_actor->GetObject()->m_IdleAnim )
|
||||
m_actor->GetModel()->SetAnimation( m_actor->GetObject()->m_IdleAnim );
|
||||
}
|
||||
|
||||
void CEntity::dispatch( CMessage* msg )
|
||||
|
@ -115,10 +115,10 @@ bool CEntity::processGoto( CEntityOrder* current, float timestep )
|
||||
{
|
||||
CVector2D path_to = current->m_data[0].location;
|
||||
m_orderQueue.pop_front();
|
||||
if( m_actor->m_Model->GetAnimation() != m_actor->m_Object->m_WalkAnim )
|
||||
if( m_actor->GetModel()->GetAnimation() != m_actor->GetObject()->m_WalkAnim )
|
||||
{
|
||||
m_actor->m_Model->SetAnimation( m_actor->m_Object->m_WalkAnim );
|
||||
m_actor->m_Model->Update( ( rand() * 1000.0f ) / 1000.0f );
|
||||
m_actor->GetModel()->SetAnimation( m_actor->GetObject()->m_WalkAnim );
|
||||
m_actor->GetModel()->Update( ( rand() * 1000.0f ) / 1000.0f );
|
||||
}
|
||||
g_Pathfinder.requestPath( me, path_to );
|
||||
return( true );
|
||||
|
Loading…
Reference in New Issue
Block a user