home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 5257 / source.7z / x_pssg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2012-02-29  |  10.8 KB  |  544 lines

  1. #ifndef __XENTAX_PSSG_H
  2. #define __XENTAX_PSSG_H
  3.  
  4. #define PSSG_BEGIN namespace PSSG {
  5. #define PSSG_END };
  6.  
  7. PSSG_BEGIN
  8.  bool extract(void);
  9.  bool extract(const char* pathname);
  10. PSSG_END
  11.  
  12. PSSG_BEGIN
  13.  
  14. // TREENODE
  15. // BASE CLASS FOR ALL NODES
  16. struct TREENODE {
  17.  public :
  18.   uint32 chunktype;
  19.   uint32 chunksize;
  20.   uint32 propbytes;
  21.  public :
  22.   uint32 parent;
  23.   std::deque<uint32> children;
  24. };
  25.  
  26. // ANIMATION
  27. // CHILD CHUNKS: YES
  28. struct ANIMATION : public TREENODE {
  29.  uint32 channelCount;
  30.  uint32 constantChannelCount;
  31.  real32 constantChannelStartTime;
  32.  real32 constantChannelEndTime;
  33.  std::string id;
  34. };
  35.  
  36. // ANIMATIONCHANNEL
  37. // CHILD CHUNKS: NO
  38. struct ANIMATIONCHANNEL : public TREENODE {
  39.  std::string timeBlock;
  40.  std::string valueBlock;
  41.  std::string id;
  42. };
  43.  
  44. // ANIMATIONCHANNELDATABLOCK
  45. // CHILD CHUNKS: YES
  46. struct ANIMATIONCHANNELDATABLOCK : public TREENODE {
  47.  uint32 keyCount;
  48.  std::string keyType;
  49.  std::string id;
  50. };
  51.  
  52. // ANIMATIONREF
  53. // CHILD CHUNKS: NO
  54. struct ANIMATIONREF : public TREENODE {
  55.  std::string animation;
  56. };
  57.  
  58. // ANIMATIONSET
  59. // CHILD CHUNKS: YES
  60. struct ANIMATIONSET : public TREENODE {
  61.  uint32 animationCount;
  62.  std::string id;
  63. };
  64.  
  65. // BOUNDINGBOX
  66. // CHILD CHUNKS: NO
  67. struct BOUNDINGBOX : public TREENODE {
  68.  real32 bbmin[3];
  69.  real32 bbmax[3];
  70. };
  71.  
  72. // CAMERANODE
  73. // CHILD CHUNKS: NO
  74. struct CAMERANODE : public TREENODE {
  75.  uint32 isPerspective;
  76.  real32 nearPlane;
  77.  real32 farPlane;
  78.  real32 aspect;
  79.  real32 FOV;
  80.  uint32 stopTraversal;
  81.  std::string nickname;
  82.  std::string id;
  83. };
  84.  
  85. // CGSTREAM
  86. // CHILD CHUNKS: NO
  87. struct CGSTREAM : public TREENODE {
  88.  std::string cgStreamName;
  89.  std::string cgStreamDataType;
  90.  std::string cgStreamRenderType;
  91. };
  92.  
  93. // CHANNELREF
  94. // CHILD CHUNKS: NO
  95. struct CHANNELREF : public TREENODE {
  96.  std::string channel;
  97.  std::string targetName;
  98. };
  99.  
  100. // DATABLOCK
  101. // CHILD CHUNKS: YES
  102. struct DATABLOCK : public TREENODE {
  103.  uint32 streamCount;
  104.  uint32 size;
  105.  uint32 elementCount;
  106.  uint32 allocationStrategy;
  107.  std::string id;
  108. };
  109.  
  110. // DATABLOCKDATA
  111. // CHILD CHUNKS: NO
  112. struct DATABLOCKDATA : public TREENODE {
  113.  boost::shared_array<char> data;
  114. };
  115.  
  116. // DATABLOCKSTREAM
  117. // CHILD CHUNKS: NO
  118. struct DATABLOCKSTREAM : public TREENODE {
  119.  std::string renderType;
  120.  std::string dataType;
  121.  uint32 offset;
  122.  uint32 stride;
  123. };
  124.  
  125. // INDEXSOURCEDATA
  126. // CHILD CHUNKS: NO
  127. struct INDEXSOURCEDATA : public TREENODE {
  128.  boost::shared_array<char> data;
  129. };
  130.  
  131. // INVERSEBINDMATRIX
  132. // CHILD CHUNKS: NO
  133. struct INVERSEBINDMATRIX : public TREENODE {
  134.  real32 matrix[16];
  135. };
  136.  
  137. // DATABLOCKSTREAM
  138. // CHILD CHUNKS: UNKNOWN
  139. struct JOINTNODE : public TREENODE {
  140.  uint32 stopTraversal;
  141.  std::string nickname;
  142.  std::string id;
  143. };
  144.  
  145. // KEYS
  146. // CHILD CHUNKS: NO
  147. struct KEYS : public TREENODE {
  148.  boost::shared_array<real32> data;
  149. };
  150.  
  151. // LIBRARY
  152. // CHILD CHUNKS: YES
  153. struct LIBRARY : public TREENODE {
  154.  std::string type;
  155. };
  156.  
  157. // MODIFIERNETWORK
  158. // CHILD CHUNKS: YES
  159. struct MODIFIERNETWORK : public TREENODE {
  160.  uint32 modifierCount;
  161.  std::string streamingStrategy;
  162.  std::string id;
  163. };
  164.  
  165. // MODIFIERNETWORKCONNECTION
  166. // CHILD CHUNKS: NO
  167. struct MODIFIERNETWORKCONNECTION : public TREENODE {
  168.  uint32 modifier;
  169.  uint32 stream;
  170. };
  171.  
  172. // MODIFIERNETWORKENTRY
  173. // CHILD CHUNKS: YES
  174. struct MODIFIERNETWORKENTRY : public TREENODE {
  175.  std::string name;
  176. };
  177.  
  178. // MODIFIERNETWORKINSTANCE
  179. // CHILD CHUNKS: YES
  180. struct MODIFIERNETWORKINSTANCE : public TREENODE {
  181.  uint32 dynamicStreamCount;
  182.  uint32 modifierInputCount;
  183.  uint32 modifierCount;
  184.  uint32 packetModifierCount;
  185.  uint32 sourceCount;
  186.  uint32 streamCount;
  187.  uint32 parameterCount;
  188.  uint32 allocationStrategy;
  189.  std::string network;
  190.  std::string indices;
  191.  std::string shader;
  192.  std::string id;
  193. };
  194.  
  195. // MODIFIERNETWORKINSTANCECOMPILE
  196. // CHILD CHUNKS: YES
  197. struct MODIFIERNETWORKINSTANCECOMPILE : public TREENODE {
  198.  uint32 uniqueInputCount;
  199.  uint32 maxElementCount;
  200.  uint32 memorySizeForProcess;
  201. };
  202.  
  203. // MODIFIERNETWORKINSTANCEDYNAMICSTREAM
  204. // CHILD CHUNKS: NO
  205. struct MODIFIERNETWORKINSTANCEDYNAMICSTREAM : public TREENODE {
  206.  uint32 id;
  207. };
  208.  
  209. // MODIFIERNETWORKINSTANCEDYNAMICSTREAMTYPE
  210. // CHILD CHUNKS: NO
  211. struct MODIFIERNETWORKINSTANCEDYNAMICSTREAMTYPE : public TREENODE {
  212.  std::string type;
  213. };
  214.  
  215. // MODIFIERNETWORKINSTANCEMODIFIERINPUT
  216. // CHILD CHUNKS: NO
  217. struct MODIFIERNETWORKINSTANCEMODIFIERINPUT : public TREENODE {
  218.  uint32 source;
  219.  uint32 stream;
  220. };
  221.  
  222. // MODIFIERNETWORKINSTANCEUNIQUEINPUT
  223. // CHILD CHUNKS: NO
  224. struct MODIFIERNETWORKINSTANCEUNIQUEINPUT : public TREENODE {
  225.  uint32 uniqueInputSource;
  226.  uint32 uniqueInputStream;
  227.  uint32 uniqueInputElementSize;
  228. };
  229.  
  230. // MODIFIERNETWORKINSTANCEUNIQUEMODIFIERINPUT
  231. // CHILD CHUNKS: NO
  232. struct MODIFIERNETWORKINSTANCEUNIQUEMODIFIERINPUT : public TREENODE {
  233.  boost::shared_array<unsigned char> data;
  234. };
  235.  
  236. // MORPHMODIFIERWEIGHTS
  237. // CHILD CHUNKS: NO
  238. struct MORPHMODIFIERWEIGHTS : public TREENODE {
  239.  uint32 weightCount;
  240.  std::string id;
  241. };
  242.  
  243. // NODE
  244. // CHILD CHUNKS: YES
  245. struct NODE : public TREENODE {
  246.  uint32 stopTraversal;
  247.  std::string nickname;
  248.  std::string id;
  249. };
  250.  
  251. // PSSGDATABASE
  252. // CHILD CHUNKS: YES
  253. struct PSSGDATABASE : public TREENODE {
  254.  std::string creator;
  255.  std::string creationMachine;
  256.  std::string creationDate;
  257.  real32 scale[3];
  258.  real32 up[3];
  259. };
  260.  
  261. // RENDERDATASOURCE
  262. // CHILD CHUNKS: YES
  263. struct RENDERDATASOURCE : public TREENODE {
  264.  uint32 streamCount;
  265.  std::string primitive;
  266.  std::string id;
  267. };
  268.  
  269. // RENDERINDEXSOURCE
  270. // CHILD CHUNKS: YES
  271. struct RENDERINDEXSOURCE : public TREENODE {
  272.  std::string primitive;
  273.  std::string format;
  274.  uint32 count;
  275.  uint32 maximumIndex;
  276.  uint32 allocationStrategy;
  277.  std::string id;
  278.  uint32 size;
  279. };
  280.  
  281. // RENDERINSTANCESOURCE
  282. // CHILD CHUNKS: NO
  283. struct RENDERINSTANCESOURCE : public TREENODE {
  284.  std::string source;
  285. };
  286.  
  287. // RENDERINSTANCESTREAM
  288. // CHILD CHUNKS: NO
  289. struct RENDERINSTANCESTREAM : public TREENODE {
  290.  uint32 sourceID;
  291.  uint32 streamID;
  292. };
  293.  
  294. // RENDERNODE
  295. // CHILD CHUNKS: YES
  296. struct RENDERNODE : public TREENODE {
  297.  uint32 stopTraversal;
  298.  std::string nickname;
  299.  std::string id;
  300. };
  301.  
  302. // RENDERSTREAM
  303. // CHILD CHUNKS: NO
  304. struct RENDERSTREAM : public TREENODE {
  305.  std::string dataBlock;
  306.  uint32 subStream;
  307.  std::string id;
  308. };
  309.  
  310. // RENDERSTREAMINSTANCE
  311. // CHILD CHUNKS: YES
  312. struct RENDERSTREAMINSTANCE : public TREENODE {
  313.  uint32 sourceCount;
  314.  uint32 streamCount;
  315.  uint32 allocationStrategy;
  316.  std::string indices;
  317.  std::string shader;
  318.  std::string id;
  319. };
  320.  
  321. // RISTREAM
  322. // CHILD CHUNKS: NO
  323. struct RISTREAM : public TREENODE {
  324.  uint32 stream; // changed
  325.  uint32 id;
  326. };
  327.  
  328. // ROOTNODE
  329. // CHILD CHUNKS: YES
  330. struct ROOTNODE : public TREENODE {
  331.  uint32 stopTraversal;
  332.  std::string nickname;
  333.  std::string id;
  334. };
  335.  
  336. struct SEGMENTSET : public TREENODE {
  337.  uint32 segmentCount;
  338.  std::string id;
  339. };
  340.  
  341. // SHADERGROUP
  342. // CHILD CHUNKS: YES
  343. struct SHADERGROUP : public TREENODE {
  344.  uint32 parameterCount;
  345.  uint32 parameterSavedCount;
  346.  uint32 parameterStreamCount;
  347.  uint32 instancesRequireSorting;
  348.  uint32 defaultRenderSortPriority;
  349.  uint32 passCount;
  350.  std::string id;
  351. };
  352.  
  353. // SHADERGROUPPASS
  354. // CHILD CHUNKS: NO
  355. struct SHADERGROUPPASS : public TREENODE {
  356.  std::string vertexProgram;
  357.  std::string fragmentProgram;
  358.  std::string blendSourceColor;
  359.  std::string blendDestColor;
  360.  std::string blendSourceAlpha;
  361.  std::string blendDestAlpha;
  362.  std::string blendEquationColor;
  363.  std::string blendEquationAlpha;
  364.  std::string alphaTestFunc;
  365.  std::string cullFaceType;
  366.  std::string depthTestFunc;
  367.  uint32 renderTargetMask;
  368.  uint32 clearMask;
  369.  uint32 passConfigMask;
  370.  uint32 depthTestEnable;
  371.  uint32 depthMaskEnable;
  372.  uint32 blendEnable;
  373.  uint32 alphaTestEnable;
  374.  uint32 alphaTestRef;
  375.  uint32 pointTexCoordMask;
  376.  real32 pointSize;
  377. };
  378.  
  379. // SHADERINPUT
  380. // CHILD CHUNKS: NO
  381. struct SHADERINPUT : public TREENODE {
  382.  uint32 parameterID;
  383.  std::string type;
  384.  std::string format;
  385.  std::string texture;
  386.  boost::shared_array<unsigned char> data;
  387. };
  388.  
  389. // SHADERINPUTDEFINITION
  390. // CHILD CHUNKS: NO
  391. struct SHADERINPUTDEFINITION : public TREENODE {
  392.  std::string name;
  393.  std::string type;
  394.  std::string format;
  395. };
  396.  
  397. // SHADERINSTANCE
  398. // CHILD CHUNKS: NO
  399. struct SHADERINSTANCE : public TREENODE {
  400.  std::string shaderGroup;
  401.  uint32 parameterCount;
  402.  uint32 parameterSavedCount;
  403.  uint32 renderSortPriority;
  404.  std::string id;
  405. };
  406.  
  407. // SHADERPROGRAM
  408. // CHILD CHUNKS: YES
  409. struct SHADERPROGRAM : public TREENODE {
  410.  uint32 codeCount;
  411.  std::string id;
  412. };
  413.  
  414. // SHADERPROGRAMCODE
  415. // CHILD CHUNKS: YES
  416. struct SHADERPROGRAMCODE : public TREENODE {
  417.  uint32 codeSize;
  418.  std::string codeType;
  419.  std::string codeEntry;
  420.  uint32 profileType;
  421.  uint32 profile;
  422.  uint32 parameterCount;
  423.  uint32 streamCount;
  424. };
  425.  
  426. // SHADERPROGRAMCODEBLOCK
  427. // CHILD CHUNKS: NO
  428. struct SHADERPROGRAMCODEBLOCK : public TREENODE {
  429.  boost::shared_array<unsigned char> data;
  430. };
  431.  
  432. // SHADERSTREAMDEFINITION
  433. // CHILD CHUNKS: NO
  434. struct SHADERSTREAMDEFINITION : public TREENODE {
  435.  std::string renderTypeName;
  436.  std::string name;
  437. };
  438.  
  439. // SKELETON
  440. // CHILD CHUNKS: YES
  441. struct SKELETON : public TREENODE {
  442.  uint32 matrixCount;
  443.  std::string id;
  444.   boost::shared_array<INVERSEBINDMATRIX> ibm;
  445. };
  446.  
  447. // SKINJOINT
  448. // CHILD CHUNKS: NO
  449. struct SKINJOINT : public TREENODE {
  450.  std::string joint;
  451. };
  452.  
  453. // SKINNODE
  454. // CHILD CHUNKS: YES
  455. struct SKINNODE : public TREENODE {
  456.  uint32 stopTraversal;
  457.  std::string nickname;
  458.  std::string id;
  459.  uint32 jointCount;
  460.  std::string skeleton;
  461. };
  462.  
  463. // TEXTURE
  464. // CHILD CHUNKS: YES
  465. struct TEXTURE : public TREENODE {
  466.  uint32 width;
  467.  uint32 height;
  468.  std::string texelFormat;
  469.  uint32 transient;
  470.  uint32 wrapS;
  471.  uint32 wrapT;
  472.  uint32 wrapR;
  473.  uint32 minFilter;
  474.  uint32 magFilter;
  475.  uint32 automipmap;
  476.  uint32 numberMipMapLevels;
  477.  uint32 gammaRemapR;
  478.  uint32 gammaRemapG;
  479.  uint32 gammaRemapB;
  480.  uint32 gammaRemapA;
  481.  uint32 lodBias;
  482.  uint32 resolveMSAA;
  483.  uint32 imageBlockCount;
  484.  uint32 allocationStrategy;
  485.  std::string filename;
  486. };
  487.  
  488. // TEXTUREIMAGEBLOCK
  489. // CHILD CHUNKS: YES
  490. struct TEXTUREIMAGEBLOCK : public TREENODE {
  491.  std::string name;
  492.  uint32 size;
  493. };
  494.  
  495. // TEXTUREIMAGEBLOCKDATA
  496. // CHILD CHUNKS: NO
  497. struct TEXTUREIMAGEBLOCKDATA : public TREENODE {
  498.  boost::shared_array<unsigned char> data;
  499. };
  500.  
  501. // TRANSFORM
  502. // CHILD CHUNKS: NO
  503. struct TRANSFORM : public TREENODE {
  504.  real32 matrix[16];
  505. };
  506.  
  507. // TYPEINFO
  508. // CHILD CHUNKS: NO
  509. struct TYPEINFO : public TREENODE {
  510.  std::string typeName;
  511.  uint32 typeCount;
  512. };
  513.  
  514. // USERATTRIBUTE
  515. // CHILD CHUNKS: NO
  516. struct USERATTRIBUTE : public TREENODE {
  517.  std::string type;
  518.  std::string semantic;
  519.  std::string svalue;
  520. };
  521.  
  522. // USERATTRIBUTELIST
  523. // CHILD CHUNKS: YES
  524. struct USERATTRIBUTELIST : public TREENODE {
  525.  uint32 count;
  526.  std::string id;
  527. };
  528.  
  529. // USERDATA
  530. // CHILD CHUNKS: NO
  531. struct USERDATA : public TREENODE {
  532.  std::string object;
  533. };
  534.  
  535. // XXX
  536. // CHILD CHUNKS: NO
  537. struct XXX : public TREENODE {
  538.  std::string id;
  539. };
  540.  
  541. PSSG_END
  542.  
  543. #endif
  544.