diff --git a/code/nel/tools/pipeline/max/class_directory_3.cpp b/code/nel/tools/pipeline/max/class_directory_3.cpp index a58b1793f..2cae1278a 100644 --- a/code/nel/tools/pipeline/max/class_directory_3.cpp +++ b/code/nel/tools/pipeline/max/class_directory_3.cpp @@ -46,7 +46,7 @@ namespace MAX { //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -CClassDirectory3::CClassDirectory3() +CClassDirectory3::CClassDirectory3(CDllDirectory *dllDirectory) : m_DllDirectory(dllDirectory) { } diff --git a/code/nel/tools/pipeline/max/class_directory_3.h b/code/nel/tools/pipeline/max/class_directory_3.h index 78e9b7a17..d3f8dbd76 100644 --- a/code/nel/tools/pipeline/max/class_directory_3.h +++ b/code/nel/tools/pipeline/max/class_directory_3.h @@ -43,6 +43,8 @@ namespace PIPELINE { namespace MAX { +class CDllDirectory; + class CClassEntry; /** @@ -54,7 +56,7 @@ class CClassEntry; class CClassDirectory3 : public CStorageContainer { public: - CClassDirectory3(); + CClassDirectory3(CDllDirectory *dllDirectory); virtual ~CClassDirectory3(); // inherited @@ -81,6 +83,8 @@ private: std::vector m_Entries; std::map m_ClassIdToIndex; + CDllDirectory *m_DllDirectory; + }; /* class CClassDirectory3 */ /** diff --git a/code/nel/tools/pipeline/max/dll_directory.cpp b/code/nel/tools/pipeline/max/dll_directory.cpp index 86980a51e..01a565e30 100644 --- a/code/nel/tools/pipeline/max/dll_directory.cpp +++ b/code/nel/tools/pipeline/max/dll_directory.cpp @@ -235,6 +235,8 @@ void CDllDirectory::disown() // Parallel to CClassDirectory3 const CDllEntry *CDllDirectory::get(uint16 index) const { + nlassert(!ChunksOwnsPointers); + nlassert(index < m_Entries.size()); return m_Entries[index]; } @@ -261,12 +263,11 @@ uint16 CDllDirectory::getOrCreateIndex(const IDllPluginDesc *dllPluginDesc) return it->second; // Create new entry - /*CClassEntry *classEntry = new CClassEntry(sceneClassDesc); + CDllEntry *dllEntry = new CDllEntry(dllPluginDesc); uint16 index = m_Entries.size(); - m_ClassIdToIndex[classEntry->classId()] = index; - m_Entries.push_back(classEntry); - return index;*/ - return 0xFFFF; + m_InternalNameToIndex[NLMISC::toLower(dllEntry->dllFilename())] = index; + m_Entries.push_back(dllEntry); + return index; } IStorageObject *CDllDirectory::createChunkById(uint16 id, bool container) @@ -302,6 +303,14 @@ CDllEntry::CDllEntry() : m_DllDescription(NULL), m_DllFilename(NULL) } +CDllEntry::CDllEntry(const IDllPluginDesc *dllPluginDesc) : m_DllDescription(new CStorageValue()), m_DllFilename(new CStorageValue()) +{ + Chunks.push_back(TStorageObjectWithId(0x2039, m_DllDescription)); + Chunks.push_back(TStorageObjectWithId(0x2037, m_DllFilename)); + m_DllDescription->Value = dllPluginDesc->displayName(); + m_DllFilename->Value = dllPluginDesc->internalName(); +} + CDllEntry::~CDllEntry() { diff --git a/code/nel/tools/pipeline/max/dll_directory.h b/code/nel/tools/pipeline/max/dll_directory.h index 55fdef77d..0de5312c2 100644 --- a/code/nel/tools/pipeline/max/dll_directory.h +++ b/code/nel/tools/pipeline/max/dll_directory.h @@ -91,6 +91,7 @@ class CDllEntry : public CStorageContainer { public: CDllEntry(); + CDllEntry(const IDllPluginDesc *dllPluginDesc); virtual ~CDllEntry(); // inherited diff --git a/code/nel/tools/pipeline/max_dump/main.cpp b/code/nel/tools/pipeline/max_dump/main.cpp index b9684b1d4..47adf5f5d 100644 --- a/code/nel/tools/pipeline/max_dump/main.cpp +++ b/code/nel/tools/pipeline/max_dump/main.cpp @@ -100,7 +100,7 @@ int main(int argc, char **argv) std::cout << "\n"; - PIPELINE::MAX::CClassDirectory3 classDirectory3; + PIPELINE::MAX::CClassDirectory3 classDirectory3(&dllDirectory); input = gsf_infile_child_by_name(infile, "ClassDirectory3"); { PIPELINE::MAX::CStorageStream instream(input);