On-demand loading of actors (sort of)

This was SVN commit r2017.
This commit is contained in:
Ykkrosh
2005-03-19 11:55:27 +00:00
parent 219509f00f
commit 79da4bf050
14 changed files with 199 additions and 168 deletions
+15
View File
@@ -13,6 +13,7 @@
#include "UnitManager.h"
#include "Unit.h"
#include "CConsole.h"
#include "ObjectManager.h"
extern CConsole* g_Console;
@@ -105,3 +106,17 @@ CUnit* CUnitManager::PickUnit(const CVector3D& origin,const CVector3D& dir) cons
}
return hit;
}
///////////////////////////////////////////////////////////////////////////////
// CreateUnit: create a new unit and add it to the world
CUnit* CUnitManager::CreateUnit(CStr& actorName, CEntity* entity)
{
CObjectEntry* obj = g_ObjMan.FindObject(actorName);
if (! obj)
return NULL;
CUnit* unit = new CUnit(obj, obj->m_Model->Clone(), entity);
AddUnit(unit);
return unit;
}