Added: #1440 Parser for config, 0x20a0

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 546334a261
commit 8a1b32561d

@ -72,10 +72,20 @@ IStorageObject *CConfig::createChunkById(uint16 id, bool container)
{
switch (id)
{
case 0x20a0: // unknown
return new CConfig20a0();
case 0x2180: // CConfigScript
return new CConfigScript();
}
}
else
{
switch (id)
{
case 0x2090: // unknown; known values: 1 (m3), 0 (m9, m2008, m2010)
return new CStorageValue<sint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
@ -88,6 +98,133 @@ void CConfig::serialized(TStorageObjectContainer::iterator soit, bool container)
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfig20a0::CConfig20a0()
{
}
CConfig20a0::~CConfig20a0()
{
}
std::string CConfig20a0::getClassName()
{
return "Config20a0";
}
void CConfig20a0::toString(std::ostream &ostream, const std::string &pad)
{
CStorageContainer::toString(ostream, pad);
}
IStorageObject *CConfig20a0::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0110: // CConfig20a0Entry
return new CConfig20a0Entry();
}
}
else
{
switch (id)
{
case 0x0100: // CConfig20a0Header: Number of entries
return new CStorageValue<sint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
void CConfig20a0::serialized(TStorageObjectContainer::iterator soit, bool container)
{
CStorageContainer::serialized(soit, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfig20a0Entry::CConfig20a0Entry()
{
}
CConfig20a0Entry::~CConfig20a0Entry()
{
}
std::string CConfig20a0Entry::getClassName()
{
return "Config20a0Entry";
}
void CConfig20a0Entry::toString(std::ostream &ostream, const std::string &pad)
{
CStorageContainer::toString(ostream, pad);
}
IStorageObject *CConfig20a0Entry::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0300: // unknown, contains 0x0100 with 4 bytes int value
return CStorageContainer::createChunkById(id, container);
}
}
else
{
switch (id)
{
case 0x0100: // unknown
case 0x0110: // unknown
case 0x0120: // unknown
case 0x0130: // unknown
case 0x0140: // unknown
case 0x0150: // unknown
case 0x0160: // unknown
case 0x0161: // unknown
case 0x0170: // unknown
case 0x0180: // unknown
case 0x0190: // unknown
case 0x0200: // unknown
case 0x0210: // unknown
case 0x0220: // unknown
case 0x0230: // unknown
case 0x0240: // unknown
case 0x0250: // unknown
case 0x0270: // unknown
case 0x0280: // unknown
case 0x0310: // unknown
case 0x0320: // unknown
return new CStorageValue<sint32>();
case 0x0260: // unknown
return new CStorageValue<sint64>();
case 0x0330: // unknown, 16 bytes
return CStorageContainer::createChunkById(id, container);
case 0x0290: // unknown
case 0x0390: // unknown
return new CStorageValue<ucstring>();
}
}
return CStorageContainer::createChunkById(id, container);
}
void CConfig20a0Entry::serialized(TStorageObjectContainer::iterator soit, bool container)
{
CStorageContainer::serialized(soit, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScript::CConfigScript()
{

@ -63,6 +63,50 @@ protected:
}; /* class CConfig */
/**
* \brief CConfig20a0
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
class CConfig20a0 : public CStorageContainer
{
public:
CConfig20a0();
virtual ~CConfig20a0();
// inherited
virtual std::string getClassName();
virtual void toString(std::ostream &ostream, const std::string &pad = "");
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
virtual void serialized(TStorageObjectContainer::iterator soit, bool container);
}; /* class CConfig20a0 */
/**
* \brief CConfig20a0Entry
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig20a0Entry
*/
class CConfig20a0Entry : public CStorageContainer
{
public:
CConfig20a0Entry();
virtual ~CConfig20a0Entry();
// inherited
virtual std::string getClassName();
virtual void toString(std::ostream &ostream, const std::string &pad = "");
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
virtual void serialized(TStorageObjectContainer::iterator soit, bool container);
}; /* class CConfig20a0Entry */
/**
* \brief CConfigScript
* \date 2012-08-18 19:25GMT

@ -125,7 +125,7 @@ void CStorageContainer::toString(std::ostream &ostream, const std::string &pad)
// Blahblah: (Container) {
// Moo: (Foo) "What" }
// only increase pad when multi-lining sub-items
ostream << "(" << getClassName() << ") { ";
ostream << "(" << getClassName() << ") [" << Chunks.size() << "] { ";
std::string padpad = pad + "\t";
for (TStorageObjectContainer::const_iterator it = Chunks.begin(), end = Chunks.end(); it != end; ++it)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -787,4 +787,50 @@ ec 5f c7 64 b9 9e 2b 22
max3
(Config) {
0x20e0: (StorageContainer) {
0x0100: (StorageRaw) {
Size: 12
String: ...=........
Hex: cd cc cc 3d 0a 00 00 00 01 00 00 00 }
0x0200: (StorageRaw) {
Size: 48
String: ...@.. A........................................
Hex: 00 00 a0 40 00 00 20 41 01 00 00 00 03 00 00 00 08 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 }
0x0300: (StorageRaw) {
Size: 0
String:
Hex: } }
0x20a0: (StorageContainer) {
0x0100: (StorageRaw) {
Size: 4
String: ....
max2010
(Config) {
0x20e0: (StorageContainer) {
0x0100: (StorageRaw) {
Size: 12
String: .. A........
Hex: 00 00 20 41 0a 00 00 00 01 00 00 00 }
0x0400: (StorageRaw) {
Size: 8
String: ........
Hex: 07 00 00 00 01 00 00 00 }
0x0200: (StorageRaw) {
Size: 40
String: ...@.. A................................
Hex: 00 00 a0 40 00 00 20 41 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 }
0x0300: (StorageRaw) {
Size: 0
String:
Hex: } }
0x20a0: (StorageContainer) {
0x0100: (StorageRaw) {
Size: 4
String: ....
Hex: 01 00 00 00 }

@ -24,8 +24,8 @@
#include "../max/config.h"
//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/3dsMax/scenes/test2008.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/teapot_test_scene.max";
static const char *streamname = "Config";

Loading…
Cancel
Save