1
0
forked from 0ad/0ad

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:
notpete 2004-05-29 20:58:11 +00:00
parent f4d09178a9
commit 6535db7fd4
3 changed files with 11 additions and 20 deletions

View File

@ -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;
/*

View File

@ -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 );
}
@ -79,17 +75,13 @@ void CEntity::updateActorTransforms()
m._31 = m_ahead.x; m._32 = 0.0f; m._33 = -m_ahead.y; m._34 = m_position.Z;
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
/* 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_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 )

View File

@ -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 );