My Project
XFileDataObject.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
5  class XFileParser;
6  class XFileExporter;
7  struct AnimationBlock;
8 
11  {
12  public:
13  friend class XFileCharModelExporter;
14 
15  typedef std::vector< ref_ptr<XFileDataObject> > XFileDataObject_list_type;
16 
17  std::string m_sTemplateName;
18  std::string m_sName;
19  std::vector<char> m_buffer;
20  XFileDataObject_list_type m_children;
21  public:
23  ~XFileDataObject();
24  void Init(XFileParser& parser, const std::string& objectname);
25 
26  void AddChild(ref_ptr<XFileDataObject> child);
27  int GetChildCount();
28  ref_ptr<XFileDataObject> GetChild(int i);
29  const std::string& GetType();
30  const std::string& GetName();
31  bool IsReference();
33  bool Lock(DWORD* dwSize, const char** pBuffer);
34  void Unlock();
35  protected:
36  inline char* GetBuffer() { return (char*)(&m_buffer[0]); };
37  void ResizeBuffer(uint32 nSize);
38 
40  bool ReadParaXBody(XFileParser& parser);
41  bool ReadParaXHeader(XFileParser& parser);
42  bool ReadXDWORDArray(XFileParser& parser);
43 
44  bool ReadXGlobalSequences(XFileParser& parser);
45  bool ReadParaXRawBuffer(XFileParser& parser);
46  bool ReadXVertices(XFileParser& parser);
47  bool ReadXTextures(XFileParser& parser);
48  bool ReadXAttachments(XFileParser& parser);
49  bool ReadXColors(XFileParser& parser);
50  bool ReadXTransparency(XFileParser& parser);
51  bool ReadXViews(XFileParser& parser);
52  bool ReadXIndices0(XFileParser& parser);
53  bool ReadXGeosets(XFileParser& parser);
54  bool ReadXRenderPass(XFileParser& parser);
55  bool ReadXBones(XFileParser& parser);
56  bool ReadXTexAnims(XFileParser& parser);
57  bool ReadXParticleEmitters(XFileParser& parser);
58  bool ReadXRibbonEmitters(XFileParser& parser);
59  bool ReadXCameras(XFileParser& parser);
60  bool ReadXLights(XFileParser& parser);
61  bool ReadXAnimations(XFileParser& parser);
62 
63  bool ReadUnknownDataObject(XFileParser& parser);
64  void ReadAnimationBlock(AnimationBlock& unk, XFileParser& parser);
65  public:
66  void Write(ofstream& strm, XFileExporter& exporter);
67  protected:
68  inline size_t GetSize() { return m_buffer.size(); };
69 
70  void WriteChildren(ofstream& strm,XFileExporter& exporter);
71  void WriteInfo(ofstream& strm,XFileExporter& exporter);
72 
73  void WriteParaXHeader(ofstream& strm,XFileExporter& exporter);
74  void WriteParaXBody(ofstream& strm,XFileExporter& exporter);
75  void WriteXDWORDArray(ofstream& strm,XFileExporter& exporter);
76  void WriteXVertices(ofstream& strm,XFileExporter& exporter);
77  void WriteXTextures(ofstream& strm,XFileExporter& exporter);
78  void WriteXAttachments(ofstream& strm,XFileExporter& exporter);
79  void WriteXTransparency(ofstream& strm,XFileExporter& exporter);
80  void WriteXViews(ofstream& strm,XFileExporter& exporter);
81  void WriteXIndices0(ofstream& strm,XFileExporter& exporter);
82  void WriteXGeosets(ofstream& strm,XFileExporter& exporter);
83  void WriteXRenderPass(ofstream& strm,XFileExporter& exporter);
84  void WriteXBones(ofstream& strm,XFileExporter& exporter);
85  void WriteXTexAnims(ofstream& strm,XFileExporter& exporter);
86  void WriteXParticleEmitters(ofstream& strm,XFileExporter& exporter);
87  void WriteXRibbonEmitters(ofstream& strm,XFileExporter& exporter);
88  void WriteXColors(ofstream& strm,XFileExporter& exporter);
89  void WriteXCameras(ofstream& strm,XFileExporter& exporter);
90  void WriteXLights(ofstream& strm,XFileExporter& exporter);
91  void WriteXAnimations(ofstream& strm,XFileExporter& exporter);
92  void WriteAnimationBlock(ofstream& strm,XFileExporter& exporter, AnimationBlock& unk);
93  };
95 }
different physics engine has different winding order.
Definition: EventBinding.h:32
bool Lock(DWORD *dwSize, const char **pBuffer)
get buffer for reading
Definition: XFileDataObject.cpp:228
The XFileParser reads a XFile either in text or binary form and builds a temporary data structure out...
Definition: XFileParser.h:19
Definition: PERef.h:11
data object in binary format
Definition: XFileDataObject.h:10
Definition: XFileExporter.h:18
Definition: XFileCharModelExporter.h:116
Definition: modelheaders.h:186
bool ReadParaXBody(XFileParser &parser)
read all sub data
Definition: XFileDataObject.cpp:158