Changed: #1440 Additional tests

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent 5fd3d7f275
commit ca9a7ab913

@ -204,9 +204,6 @@ void CAppData::build(uint16 version)
// Set up the entries
for (TMap::iterator it = m_Entries.begin(), end = m_Entries.end(); it != end; ++it)
m_Chunks.push_back(TStorageObjectWithId(NLMAXFILE_APP_DATA_ENTRY_CHUNK_ID, it->second));
// Build all the child chunks
CStorageContainer::build(version);
}
void CAppData::disown()

@ -238,7 +238,7 @@ void CClassDirectory3::disown()
const CClassEntry *CClassDirectory3::get(uint16 index) const
{
nlassert(!m_ChunksOwnsPointers);
nlassert(index < m_Entries.size());
if (index >= m_Entries.size()) { nlerror("Index 0x%x is above the number of entries %i", (uint32)index, (uint32)m_Entries.size()); return NULL; }
return m_Entries[index];
}

@ -161,6 +161,12 @@ void CSceneClassContainer::disown()
IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container)
{
// nldebug("Scene class id %x (%i)", (uint32)id, (uint32)id);
switch (id)
{
// Known unknown special identifiers...
case 0x2032:
return CStorageContainer::createChunkById(id, container);
}
const CClassEntry *classEntry = m_ClassDirectory3->get(id);
CSceneClass *sceneClass = m_SceneClassRegistry->create(classEntry->classId());
if (sceneClass)
@ -173,7 +179,6 @@ IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container)
const CDllEntry *dllEntry = m_DllDirectory->get(classEntry->dllIndex());
return static_cast<IStorageObject *>(new CSceneClassUnknown(dllEntry, classEntry));
}
throw EStorage("Bad scene class id");
}
////////////////////////////////////////////////////////////////////////

@ -157,6 +157,14 @@ int main(int argc, char **argv)
PIPELINE::MAX::PARSE_INTERNAL
| PIPELINE::MAX::PARSE_BUILTIN)); // parse the structure to readable data
scene.clean(); // cleanup unused file structure
// TEST ->
scene.build(PIPELINE::MAX::VersionUnknown);
scene.disown();
scene.parse(PIPELINE::MAX::VersionUnknown, (PIPELINE::MAX::TParseLevel)(
PIPELINE::MAX::PARSE_INTERNAL
| PIPELINE::MAX::PARSE_BUILTIN)); // parse the structure to readable data
scene.clean(); // cleanup unused file structure
// <- TEST
scene.toString(std::cout);
std::cout << "\n";
//classDirectory3.build(PIPELINE::MAX::VersionUnknown);

Loading…
Cancel
Save