1
0
forked from 0ad/0ad

Added BuildModel call to AddObject to ensure required model/animation data is loaded when object list is constructed, not on first use.

This was SVN commit r244.
This commit is contained in:
notpete 2004-05-20 17:37:20 +00:00
parent 256436af40
commit 054d210303

View File

@ -36,7 +36,10 @@ void CObjectManager::AddObjectType(const char* name)
void CObjectManager::AddObject(CObjectEntry* object,int type)
{
assert((uint)type<m_ObjectTypes.size());
m_ObjectTypes[type].m_Objects.push_back(object);
// build the model now to load the required model/animations from it
if (object->BuildModel()) {
m_ObjectTypes[type].m_Objects.push_back(object);
}
}
void CObjectManager::DeleteObject(CObjectEntry* entry)