mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-09 08:21:10 +00:00
# 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user