Added: #1440 Handle some more unknown chunks

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 30954ec397
commit 77f5547f15

@ -39,6 +39,8 @@
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;
#define PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID 0x2140
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
@ -52,6 +54,8 @@ CAnimatable::~CAnimatable()
{ {
if (!m_ChunksOwnsPointers) if (!m_ChunksOwnsPointers)
{ {
delete m_Unknown2140;
m_Unknown2140 = NULL;
delete m_AppData; delete m_AppData;
m_AppData = NULL; m_AppData = NULL;
} }
@ -70,6 +74,12 @@ void CAnimatable::parse(uint16 version, uint filter)
CSceneClass::parse(version); CSceneClass::parse(version);
if (!m_ChunksOwnsPointers) if (!m_ChunksOwnsPointers)
{ {
m_Unknown2140 = getChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID);
if (m_Unknown2140)
{
// nldebug("Found unknown 0x2140");
// TODO: Put std::cout code here
}
m_AppData = static_cast<STORAGE::CAppData *>(getChunk(PMBS_APP_DATA_CHUNK_ID)); m_AppData = static_cast<STORAGE::CAppData *>(getChunk(PMBS_APP_DATA_CHUNK_ID));
} }
} }
@ -77,15 +87,16 @@ void CAnimatable::parse(uint16 version, uint filter)
void CAnimatable::clean() void CAnimatable::clean()
{ {
CSceneClass::clean(); CSceneClass::clean();
if (m_AppData) if (m_AppData) m_AppData->clean();
{
m_AppData->clean();
}
} }
void CAnimatable::build(uint16 version, uint filter) void CAnimatable::build(uint16 version, uint filter)
{ {
CSceneClass::build(version); CSceneClass::build(version);
if (m_Unknown2140)
{
putChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID, m_Unknown2140);
}
if (m_AppData) if (m_AppData)
{ {
if (m_AppData->entries().size() == 0) if (m_AppData->entries().size() == 0)
@ -103,6 +114,7 @@ void CAnimatable::build(uint16 version, uint filter)
void CAnimatable::disown() void CAnimatable::disown()
{ {
m_Unknown2140 = NULL;
m_AppData = NULL; m_AppData = NULL;
CSceneClass::disown(); CSceneClass::disown();
} }

@ -84,6 +84,7 @@ protected:
virtual IStorageObject *createChunkById(uint16 id, bool container); virtual IStorageObject *createChunkById(uint16 id, bool container);
private: private:
IStorageObject *m_Unknown2140;
STORAGE::CAppData *m_AppData; STORAGE::CAppData *m_AppData;
}; /* class CAnimatable */ }; /* class CAnimatable */

@ -205,14 +205,30 @@ const CUserDataTypeSuperClassDesc UserDataTypeSuperClassDesc(&ReferenceTargetCla
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900f> CUserTypeSuperClassDesc; typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900f> CUserTypeSuperClassDesc;
const CUserTypeSuperClassDesc UserTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserTypeSuperClassUnknown"); const CUserTypeSuperClassDesc UserTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserTypeSuperClassUnknown");
// 0x40 - shape object // 0x40 - shape object (text, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000040> CShapeObjectSuperClassDesc; typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000040> CShapeObjectSuperClassDesc;
const CShapeObjectSuperClassDesc ShapeObjectSuperClassDesc(&GeomObjectClassDesc, "ShapeObjectSuperClassUnknown"); const CShapeObjectSuperClassDesc ShapeObjectSuperClassDesc(&GeomObjectClassDesc, "ShapeObjectSuperClassUnknown");
// 0x30 - light object // 0x30 - light object (omni, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000030> CLightObjectSuperClassDesc; typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000030> CLightObjectSuperClassDesc;
const CLightObjectSuperClassDesc LightObjectSuperClassDesc(&ObjectClassDesc, "LightObjectSuperClassUnknown"); const CLightObjectSuperClassDesc LightObjectSuperClassDesc(&ObjectClassDesc, "LightObjectSuperClassUnknown");
// 0x20 camera - (target, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000020> CCameraObjectSuperClassDesc;
const CCameraObjectSuperClassDesc CameraObjectSuperClassDesc(&ObjectClassDesc, "CameraObjectSuperClassUnknown");
// Creating superclass 0x820 (FFD Binding) (0xd6636ea2, 0x9aa42bf3) that does not exist = WSM, sub of modifier (under baseobj)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000820> CWSModifierSuperClassDesc;
const CWSModifierSuperClassDesc WSModifierSuperClassDesc(&BaseObjectClassDesc, "WSModifierSuperClassUnknown");
// Creating superclass 0x830 (FFD(Cyl)) (0xfa4700be, 0xbbe85051) that does not exist = WSMObject, sub of object
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000830> CWSMObjectSuperClassDesc;
const CWSMObjectSuperClassDesc WSMObjectSuperClassDesc(&ObjectClassDesc, "WSMObjectSuperClassUnknown");
// Creating superclass 0xc30 (Placement) (0x00000100, 0x00000000) that does not exist | xyzgen, sub of mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c30> CXYZGenSuperClassDesc;
const CXYZGenSuperClassDesc XYZGenSuperClassDesc(&ReferenceTargetClassDesc, "XYZGenSuperClassUnknown");
} /* anonymous namespace */ } /* anonymous namespace */
CBuiltin::CBuiltin() CBuiltin::CBuiltin()
@ -309,6 +325,10 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry)
registry->add(&UserTypeSuperClassDesc); registry->add(&UserTypeSuperClassDesc);
registry->add(&ShapeObjectSuperClassDesc); registry->add(&ShapeObjectSuperClassDesc);
registry->add(&LightObjectSuperClassDesc); registry->add(&LightObjectSuperClassDesc);
registry->add(&CameraObjectSuperClassDesc);
registry->add(&WSModifierSuperClassDesc);
registry->add(&WSMObjectSuperClassDesc);
registry->add(&XYZGenSuperClassDesc);
} }
} /* namespace BUILTIN */ } /* namespace BUILTIN */

@ -57,6 +57,9 @@ using namespace PIPELINE::MAX::EPOLY;
CSceneClassRegistry SceneClassRegistry; CSceneClassRegistry SceneClassRegistry;
// Never enable this
bool DebugParser = true;
bool DisplayStream = false; bool DisplayStream = false;
bool WriteModified = false; bool WriteModified = false;
bool WriteDummy = true; bool WriteDummy = true;
@ -65,7 +68,8 @@ const char *DatabaseDirectory = "w:\\database\\";
const char *LinuxDatabaseDirectory = "/srv/work/database/"; const char *LinuxDatabaseDirectory = "/srv/work/database/";
bool RunningLinux = true; bool RunningLinux = true;
const char *SrcDirectoryRecursive = "w:\\database\\interfaces\\"; //const char *SrcDirectoryRecursive = "w:\\database\\interfaces\\";
const char *SrcDirectoryRecursive = "w:\\database\\";
std::set<std::string> MissingFiles; std::set<std::string> MissingFiles;
std::map<std::string, std::string> KnownFileCache; std::map<std::string, std::string> KnownFileCache;
@ -637,13 +641,14 @@ void handleFile(const std::string &path)
PIPELINE::MAX::CScene scene(&SceneClassRegistry, &dllDirectory, &classDirectory3); PIPELINE::MAX::CScene scene(&SceneClassRegistry, &dllDirectory, &classDirectory3);
serializeStorageContainer(&scene, infile, "Scene"); serializeStorageContainer(&scene, infile, "Scene");
/* if (DebugParser)
// Not parsing the scene for this function. {
scene.parse(VersionUnknown); // Not parsing the scene for this function.
scene.clean(); scene.parse(VersionUnknown);
scene.build(VersionUnknown); scene.clean();
scene.disown(); scene.build(VersionUnknown);
*/ scene.disown();
}
/* /*
PIPELINE::MAX::CStorageContainer dllDirectory; PIPELINE::MAX::CStorageContainer dllDirectory;

Loading…
Cancel
Save