# Hotloading of actor XML files.

Stop ignoring actor XML animation speeds.
Add decentralised registration of hotloaders.
Move player ID storage into CModel, to simplify CUnit.
Remove obsolete unit ID allocation code.
Remove some material junk.

This was SVN commit r7605.
This commit is contained in:
Ykkrosh
2010-06-03 01:29:43 +00:00
parent 5c03456a38
commit 310f3466a8
27 changed files with 271 additions and 309 deletions
+2 -10
View File
@@ -32,7 +32,7 @@
CUnit::CUnit(CObjectEntry* object, CEntity* entity, CObjectManager& objectManager,
const std::set<CStr>& actorSelections)
: m_Object(object), m_Model(object->m_Model->Clone()),
m_ID(invalidUnitId), m_ActorSelections(actorSelections), m_PlayerID(invalidPlayerId),
m_ID(invalidUnitId), m_ActorSelections(actorSelections),
m_ObjectManager(objectManager)
{
m_Animation = new CUnitAnimation(*this);
@@ -174,13 +174,6 @@ void CUnit::UpdateModel(float frameTime)
m_Animation->Update(frameTime*1000.0f);
}
void CUnit::SetPlayerID(size_t id)
{
m_PlayerID = id;
m_Model->SetPlayerID(m_PlayerID);
}
void CUnit::SetEntitySelection(const CStr& selection)
{
CStr selection_lc = selection.LowerCase();
@@ -218,8 +211,7 @@ void CUnit::ReloadObject()
// Copy the old instance-specific settings from the old model to the new instance
newModel->SetTransform(m_Model->GetTransform());
if (m_PlayerID != invalidPlayerId)
newModel->SetPlayerID(m_PlayerID);
newModel->SetPlayerID(m_Model->GetPlayerID());
newModel->CopyAnimationFrom(m_Model);
delete m_Model;