Refactored actor variation system, and added support for entity-level selections (controlled by the current animation).

Avoided tooltip error message.
Avoided noisy warnings when textures fail to load.

This was SVN commit r3653.
This commit is contained in:
Ykkrosh
2006-03-17 03:59:49 +00:00
parent 6eda8c2209
commit d3f57744d9
27 changed files with 499 additions and 437 deletions
+13 -3
View File
@@ -119,14 +119,24 @@ CUnit* CUnitManager::PickUnit(const CVector3D& origin, const CVector3D& dir) con
///////////////////////////////////////////////////////////////////////////////
// CreateUnit: create a new unit and add it to the world
CUnit* CUnitManager::CreateUnit(const CStr& actorName, CEntity* entity)
CUnit* CUnitManager::CreateUnit(const CStr& actorName, CEntity* entity, const std::set<CStrW>& selections)
{
CObjectEntry* obj = g_ObjMan.FindObject(actorName);
CObjectBase* base = g_ObjMan.FindObjectBase(actorName);
if (! base)
return NULL;
std::set<CStrW> actorSelections = base->CalculateRandomVariation(selections);
std::vector<std::set<CStrW> > selectionsVec;
selectionsVec.push_back(actorSelections);
CObjectEntry* obj = g_ObjMan.FindObjectVariation(base, selectionsVec);
if (! obj)
return NULL;
CUnit* unit = new CUnit(obj, obj->m_Model->Clone(), entity);
CUnit* unit = new CUnit(obj, entity, actorSelections);
AddUnit(unit);
return unit;
}