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 NLMISC;
#define PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID 0x2140
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
@ -52,6 +54,8 @@ CAnimatable::~CAnimatable()
{
if (!m_ChunksOwnsPointers)
{
delete m_Unknown2140;
m_Unknown2140 = NULL;
delete m_AppData;
m_AppData = NULL;
}
@ -70,6 +74,12 @@ void CAnimatable::parse(uint16 version, uint filter)
CSceneClass::parse(version);
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));
}
}
@ -77,15 +87,16 @@ void CAnimatable::parse(uint16 version, uint filter)
void CAnimatable::clean()
{
CSceneClass::clean();
if (m_AppData)
{
m_AppData->clean();
}
if (m_AppData) m_AppData->clean();
}
void CAnimatable::build(uint16 version, uint filter)
{
CSceneClass::build(version);
if (m_Unknown2140)
{
putChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID, m_Unknown2140);
}
if (m_AppData)
{
if (m_AppData->entries().size() == 0)
@ -103,6 +114,7 @@ void CAnimatable::build(uint16 version, uint filter)
void CAnimatable::disown()
{
m_Unknown2140 = NULL;
m_AppData = NULL;
CSceneClass::disown();
}

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

@ -205,14 +205,30 @@ const CUserDataTypeSuperClassDesc UserDataTypeSuperClassDesc(&ReferenceTargetCla
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900f> CUserTypeSuperClassDesc;
const CUserTypeSuperClassDesc UserTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserTypeSuperClassUnknown");
// 0x40 - shape object
// 0x40 - shape object (text, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000040> CShapeObjectSuperClassDesc;
const CShapeObjectSuperClassDesc ShapeObjectSuperClassDesc(&GeomObjectClassDesc, "ShapeObjectSuperClassUnknown");
// 0x30 - light object
// 0x30 - light object (omni, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000030> CLightObjectSuperClassDesc;
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 */
CBuiltin::CBuiltin()
@ -309,6 +325,10 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry)
registry->add(&UserTypeSuperClassDesc);
registry->add(&ShapeObjectSuperClassDesc);
registry->add(&LightObjectSuperClassDesc);
registry->add(&CameraObjectSuperClassDesc);
registry->add(&WSModifierSuperClassDesc);
registry->add(&WSMObjectSuperClassDesc);
registry->add(&XYZGenSuperClassDesc);
}
} /* namespace BUILTIN */

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

Loading…
Cancel
Save