Added: #1440 Initial link between ClassDirectory3 and DllDirectory

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent 8946674dd0
commit f56e7e2b18

@ -46,7 +46,7 @@ namespace MAX {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
CClassDirectory3::CClassDirectory3() CClassDirectory3::CClassDirectory3(CDllDirectory *dllDirectory) : m_DllDirectory(dllDirectory)
{ {
} }

@ -43,6 +43,8 @@
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
class CDllDirectory;
class CClassEntry; class CClassEntry;
/** /**
@ -54,7 +56,7 @@ class CClassEntry;
class CClassDirectory3 : public CStorageContainer class CClassDirectory3 : public CStorageContainer
{ {
public: public:
CClassDirectory3(); CClassDirectory3(CDllDirectory *dllDirectory);
virtual ~CClassDirectory3(); virtual ~CClassDirectory3();
// inherited // inherited
@ -81,6 +83,8 @@ private:
std::vector<CClassEntry *> m_Entries; std::vector<CClassEntry *> m_Entries;
std::map<NLMISC::CClassId, uint16> m_ClassIdToIndex; std::map<NLMISC::CClassId, uint16> m_ClassIdToIndex;
CDllDirectory *m_DllDirectory;
}; /* class CClassDirectory3 */ }; /* class CClassDirectory3 */
/** /**

@ -235,6 +235,8 @@ void CDllDirectory::disown()
// Parallel to CClassDirectory3 // Parallel to CClassDirectory3
const CDllEntry *CDllDirectory::get(uint16 index) const const CDllEntry *CDllDirectory::get(uint16 index) const
{ {
nlassert(!ChunksOwnsPointers);
nlassert(index < m_Entries.size());
return m_Entries[index]; return m_Entries[index];
} }
@ -261,12 +263,11 @@ uint16 CDllDirectory::getOrCreateIndex(const IDllPluginDesc *dllPluginDesc)
return it->second; return it->second;
// Create new entry // Create new entry
/*CClassEntry *classEntry = new CClassEntry(sceneClassDesc); CDllEntry *dllEntry = new CDllEntry(dllPluginDesc);
uint16 index = m_Entries.size(); uint16 index = m_Entries.size();
m_ClassIdToIndex[classEntry->classId()] = index; m_InternalNameToIndex[NLMISC::toLower(dllEntry->dllFilename())] = index;
m_Entries.push_back(classEntry); m_Entries.push_back(dllEntry);
return index;*/ return index;
return 0xFFFF;
} }
IStorageObject *CDllDirectory::createChunkById(uint16 id, bool container) 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<ucstring>()), m_DllFilename(new CStorageValue<ucstring>())
{
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() CDllEntry::~CDllEntry()
{ {

@ -91,6 +91,7 @@ class CDllEntry : public CStorageContainer
{ {
public: public:
CDllEntry(); CDllEntry();
CDllEntry(const IDllPluginDesc *dllPluginDesc);
virtual ~CDllEntry(); virtual ~CDllEntry();
// inherited // inherited

@ -100,7 +100,7 @@ int main(int argc, char **argv)
std::cout << "\n"; std::cout << "\n";
PIPELINE::MAX::CClassDirectory3 classDirectory3; PIPELINE::MAX::CClassDirectory3 classDirectory3(&dllDirectory);
input = gsf_infile_child_by_name(infile, "ClassDirectory3"); input = gsf_infile_child_by_name(infile, "ClassDirectory3");
{ {
PIPELINE::MAX::CStorageStream instream(input); PIPELINE::MAX::CStorageStream instream(input);

Loading…
Cancel
Save