From ca9a7ab913f552cd669855ae71aa752b8cd6c70c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 21 Aug 2012 18:20:36 +0200 Subject: [PATCH] Changed: #1440 Additional tests --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/max/builtin/app_data.cpp | 3 --- code/nel/tools/pipeline/max/class_directory_3.cpp | 2 +- code/nel/tools/pipeline/max/scene.cpp | 7 ++++++- code/nel/tools/pipeline/max_dump/main.cpp | 8 ++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/pipeline/max/builtin/app_data.cpp b/code/nel/tools/pipeline/max/builtin/app_data.cpp index 74ef6192d..f30b3fd8e 100644 --- a/code/nel/tools/pipeline/max/builtin/app_data.cpp +++ b/code/nel/tools/pipeline/max/builtin/app_data.cpp @@ -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() diff --git a/code/nel/tools/pipeline/max/class_directory_3.cpp b/code/nel/tools/pipeline/max/class_directory_3.cpp index 2bf567671..495ff835b 100644 --- a/code/nel/tools/pipeline/max/class_directory_3.cpp +++ b/code/nel/tools/pipeline/max/class_directory_3.cpp @@ -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]; } diff --git a/code/nel/tools/pipeline/max/scene.cpp b/code/nel/tools/pipeline/max/scene.cpp index a0b8277b2..de125ad43 100644 --- a/code/nel/tools/pipeline/max/scene.cpp +++ b/code/nel/tools/pipeline/max/scene.cpp @@ -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(new CSceneClassUnknown(dllEntry, classEntry)); } - throw EStorage("Bad scene class id"); } //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max_dump/main.cpp b/code/nel/tools/pipeline/max_dump/main.cpp index a368c395a..63aeb353e 100644 --- a/code/nel/tools/pipeline/max_dump/main.cpp +++ b/code/nel/tools/pipeline/max_dump/main.cpp @@ -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);