Changed: #1440 Handle the unknown identifiers safely

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent dce3e67b73
commit 444b71ba92

@ -108,7 +108,7 @@ void CReferenceMaker::parse(uint16 version, TParseLevel level)
if (references2034->Value[i] > 0) if (references2034->Value[i] > 0)
{ {
CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(references2034->Value[i])); CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(references2034->Value[i]));
if (!referenceMaker) nlerror("Reference maker is %s not a reference maker", container()->getByStorageIndex(references2034->Value[i])->classDesc()->classId().toString().c_str()); if (!referenceMaker) nlerror("Reference maker %s %s, 0x%x is not a reference maker", ucstring(container()->getByStorageIndex(references2034->Value[i])->classDesc()->displayName()).toUtf8().c_str(), container()->getByStorageIndex(references2034->Value[i])->classDesc()->classId().toString().c_str(), container()->getByStorageIndex(references2034->Value[i])->classDesc()->superClassId());
setReference(i, referenceMaker); setReference(i, referenceMaker);
} }
} }
@ -128,7 +128,7 @@ void CReferenceMaker::parse(uint16 version, TParseLevel level)
sint32 referenceindex = (*it); sint32 referenceindex = (*it);
++it; ++it;
CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(referenceindex)); CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(referenceindex));
if (!referenceMaker) nlerror("Reference maker is %s not a reference maker", container()->getByStorageIndex(referenceindex)->classDesc()->classId().toString().c_str()); if (!referenceMaker) nlerror("Reference maker %s, 0x%x is not a reference maker", container()->getByStorageIndex(referenceindex)->classDesc()->classId().toString().c_str(), container()->getByStorageIndex(referenceindex)->classDesc()->superClassId());
setReference(index, referenceMaker); setReference(index, referenceMaker);
} }
} }

@ -194,8 +194,10 @@ IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container)
{ {
// Known unknown special identifiers... // Known unknown special identifiers...
case 0x2032: case 0x2032:
return m_SceneClassRegistry->createUnknown(m_Scene, 0x0, NLMISC::CClassId(0x29263a68, 0x405f22f5), ucstring("Unknown 0x2032"), ucstring("0x2032_0x2033_dll"), ucstring("Not part of the dll directory!"));
case 0x2033: case 0x2033:
return new CSceneClass(m_Scene); // TODO: Make dummy dllentry and classentry for these... return m_SceneClassRegistry->createUnknown(m_Scene, 0x0, NLMISC::CClassId(0x4ec13906, 0x5578130e), ucstring("Unknown 0x2033"), ucstring("0x2032_0x2033_dll"), ucstring("Not part of the dll directory!"));
// return new CSceneClass(m_Scene); // TODO: Make dummy dllentry and classentry for these...
// return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(dllEntry, classEntry)); // return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(dllEntry, classEntry));
} }
const CClassEntry *classEntry = m_ClassDirectory3->get(id); const CClassEntry *classEntry = m_ClassDirectory3->get(id);

@ -858,3 +858,71 @@ UTILITY_CLASS_ID 0x001020
Size: 6 Size: 6
String: no fx. } } String: no fx. } }
Scene class references
ver3
References 0x2034: PARSED {
0: <ptr=0x000000000201f1b0> (Material Editor, (0x00000c80, 0x00000000))
1: <ptr=0x0000000002110e30> (MtlBaseLib, (0x00003333, 0x00000000))
2: <ptr=0x00000000021110d0> (Default Sound, (0x00000001, 0x00000000))
3: <ptr=0x00000000021118c0> (RootNode, (0x00000002, 0x00000000))
4: <ptr=0x00000000027be740> (RenderEnvironment, (0xee448b23, 0x00000000))
5: <ptr=0x00000000027c1400> (NamedSelSetList, (0x00008d52, 0x00000000))
6: <ptr=0x00000000027c3640> (TVNode, (0x8d73b8aa, 0x90f2ee71))
7: <ptr=0x00000000027c3bc0> (Grid Reference, (0x00000001, 0x00000000))
8: <ptr=0x00000000027c3de0> (RenderEffects, (0x17356912, 0x00000000))
9: <ptr=0x00000000027c4a20> (Shadow Map, (0x00000100, 0x00000000))
10: <ptr=0x00000000027c4cf0> (Layer Manager, (0x0d7374fc, 0x51ff028e)) }
ver9
References 0x2034: PARSED {
0: <ptr=0x0000000000f04bf0> (Material Editor, (0x00000c80, 0x00000000))
1: <ptr=0x0000000000f05430> (MtlBaseLib, (0x00003333, 0x00000000))
2: <ptr=0x0000000000f059d0> (Default Sound, (0x00000001, 0x00000000))
3: <ptr=0x0000000000f05ec0> (RootNode, (0x00000002, 0x00000000))
4: <ptr=0x0000000002b8bfb0> (RenderEnvironment, (0xee448b23, 0x00000000))
5: <ptr=0x0000000002b91a20> (NamedSelSetList, (0x00008d52, 0x00000000))
6: <ptr=0x0000000002ba2380> (TVNode, (0x8d73b8aa, 0x90f2ee71))
7: <ptr=0x0000000002ba38a0> (Grid Reference, (0x00000001, 0x00000000))
8: <ptr=0x0000000002ba3dc0> (RenderEffects, (0x17356912, 0x00000000))
9: <ptr=0x0000000002ba4b60> (Shadow Map, (0x00000100, 0x00000000))
10: <ptr=0x0000000002ba5130> (Layer Manager, (0x0d7374fc, 0x51ff028e))
11: <ptr=0x0000000002ba57d0> (TrackSetList, (0x2cf03595, 0x00000000)) }
ver2008
References 0x2034: PARSED {
0: <ptr=0x0000000001d96380> (Material Editor, (0x00000c80, 0x00000000))
1: <ptr=0x0000000001d96910> (MtlBaseLib, (0x00003333, 0x00000000))
2: <ptr=0x0000000001d96b30> (Default Sound, (0x00000001, 0x00000000))
3: <ptr=0x0000000001d97020> (RootNode, (0x00000002, 0x00000000))
4: <ptr=0x0000000001da0870> (RenderEnvironment, (0xee448b23, 0x00000000))
5: <ptr=0x0000000001da6020> (NamedSelSetList, (0x00008d52, 0x00000000))
6: <ptr=0x0000000001daf540> (TVNode, (0x8d73b8aa, 0x90f2ee71))
7: <ptr=0x0000000001db0610> (Grid Reference, (0x00000001, 0x00000000))
8: <ptr=0x0000000001db0880> (RenderEffects, (0x17356912, 0x00000000))
9: <ptr=0x0000000001db1620> (Shadow Map, (0x00000100, 0x00000000))
10: <ptr=0x0000000001db1940> (Layer Manager, (0x0d7374fc, 0x51ff028e))
11: <ptr=0x0000000001db1d30> (TrackSetList, (0x2cf03595, 0x00000000)) }
ver2010
References 0x2034: PARSED {
0: <ptr=0x0000000000de4060> (Material Editor, (0x00000c80, 0x00000000))
1: <ptr=0x0000000000de45f0> (MtlBaseLib, (0x00003333, 0x00000000))
2: <ptr=0x0000000000de5050> (ProSound, (0x476fa9de, 0x5b918e4a))
3: <ptr=0x0000000000de61b0> (RootNode, (0x00000002, 0x00000000))
4: <ptr=0x0000000000e044e0> (RenderEnvironment, (0xee448b23, 0x00000000))
5: <ptr=0x0000000000e09ee0> (NamedSelSetList, (0x00008d52, 0x00000000))
6: <ptr=0x0000000000e14790> (TVNode, (0x8d73b8aa, 0x90f2ee71))
7: <ptr=0x0000000000e15bb0> (Grid Reference, (0x00000001, 0x00000000))
8: <ptr=0x0000000000e15e20> (RenderEffects, (0x17356912, 0x00000000))
9: <ptr=0x0000000000e16bc0> (Shadow Map, (0x00000100, 0x00000000))
10: <ptr=0x0000000000e16ee0> (Layer Manager, (0x0d7374fc, 0x51ff028e))
11: <ptr=0x0000000000e172d0> (TrackSetList, (0x2cf03595, 0x00000000)) }

@ -31,8 +31,8 @@
#include "../max/builtin/storage/app_data.h" #include "../max/builtin/storage/app_data.h"
#include "../max/builtin/builtin.h" #include "../max/builtin/builtin.h"
//static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max";
static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; //static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max";
//static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max";
//static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max";
static const char *streamname = "Scene"; static const char *streamname = "Scene";

Loading…
Cancel
Save