TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WMORoot Class Reference

#include <wmo.h>

Public Member Functions

 WMORoot (std::string &filename)
 
bool open ()
 
bool ConvertToVMAPRootWmo (FILE *output)
 

Public Attributes

unsigned int col
 
uint32 nTextures
 
uint32 nGroups
 
uint32 nP
 
uint32 nLights
 
uint32 nModels
 
uint32 nDoodads
 
uint32 nDoodadSets
 
uint32 RootWMOID
 
uint32 liquidType
 
float bbcorn1 [3]
 
float bbcorn2 [3]
 

Private Attributes

std::string filename
 

Constructor & Destructor Documentation

WMORoot::WMORoot ( std::string &  filename)
35  : filename(filename), col(0), nTextures(0), nGroups(0), nP(0), nLights(0),
37 {
38  memset(bbcorn1, 0, sizeof(bbcorn1));
39  memset(bbcorn2, 0, sizeof(bbcorn2));
40 }
uint32 nLights
Definition: wmo.h:51
float bbcorn1[3]
Definition: wmo.h:52
uint32 nGroups
Definition: wmo.h:51
float bbcorn2[3]
Definition: wmo.h:53
uint32 nTextures
Definition: wmo.h:51
unsigned int col
Definition: wmo.h:50
uint32 RootWMOID
Definition: wmo.h:51
uint32 nDoodadSets
Definition: wmo.h:51
uint32 nModels
Definition: wmo.h:51
std::string filename
Definition: wmo.h:48
uint32 liquidType
Definition: wmo.h:51
uint32 nDoodads
Definition: wmo.h:51
uint32 nP
Definition: wmo.h:51

Member Function Documentation

bool WMORoot::ConvertToVMAPRootWmo ( FILE *  output)
130 {
131  //printf("Convert RootWmo...\n");
132 
133  fwrite(szRawVMAPMagic, 1, 8, pOutfile);
134  unsigned int nVectors = 0;
135  fwrite(&nVectors,sizeof(nVectors), 1, pOutfile); // will be filled later
136  fwrite(&nGroups, 4, 1, pOutfile);
137  fwrite(&RootWMOID, 4, 1, pOutfile);
138  return true;
139 }
const char * szRawVMAPMagic
Definition: vmapexport.cpp:82
uint32 nGroups
Definition: wmo.h:51
uint32 RootWMOID
Definition: wmo.h:51

+ Here is the caller graph for this function:

bool WMORoot::open ( )
45 {
46  MPQFile f(CascStorage, filename.c_str());
47  if(f.isEof ())
48  {
49  printf("No such file.\n");
50  return false;
51  }
52 
53  uint32 size;
54  char fourcc[5];
55 
56  while (!f.isEof())
57  {
58  f.read(fourcc,4);
59  f.read(&size, 4);
60 
61  flipcc(fourcc);
62  fourcc[4] = 0;
63 
64  size_t nextpos = f.getPos() + size;
65 
66  if (!strcmp(fourcc,"MOHD")) // header
67  {
68  f.read(&nTextures, 4);
69  f.read(&nGroups, 4);
70  f.read(&nP, 4);
71  f.read(&nLights, 4);
72  f.read(&nModels, 4);
73  f.read(&nDoodads, 4);
74  f.read(&nDoodadSets, 4);
75  f.read(&col, 4);
76  f.read(&RootWMOID, 4);
77  f.read(bbcorn1, 12);
78  f.read(bbcorn2, 12);
79  f.read(&liquidType, 4);
80  break;
81  }
82  /*
83  else if (!strcmp(fourcc,"MOTX"))
84  {
85  }
86  else if (!strcmp(fourcc,"MOMT"))
87  {
88  }
89  else if (!strcmp(fourcc,"MOGN"))
90  {
91  }
92  else if (!strcmp(fourcc,"MOGI"))
93  {
94  }
95  else if (!strcmp(fourcc,"MOLT"))
96  {
97  }
98  else if (!strcmp(fourcc,"MODN"))
99  {
100  }
101  else if (!strcmp(fourcc,"MODS"))
102  {
103  }
104  else if (!strcmp(fourcc,"MODD"))
105  {
106  }
107  else if (!strcmp(fourcc,"MOSB"))
108  {
109  }
110  else if (!strcmp(fourcc,"MOPV"))
111  {
112  }
113  else if (!strcmp(fourcc,"MOPT"))
114  {
115  }
116  else if (!strcmp(fourcc,"MOPR"))
117  {
118  }
119  else if (!strcmp(fourcc,"MFOG"))
120  {
121  }
122  */
123  f.seek((int)nextpos);
124  }
125  f.close ();
126  return true;
127 }
HANDLE CascStorage
Definition: System.cpp:69
void flipcc(char *fcc)
Definition: mpqfile.h:57
uint32 nLights
Definition: wmo.h:51
float bbcorn1[3]
Definition: wmo.h:52
Definition: mpqfile.h:32
uint32 nGroups
Definition: wmo.h:51
float bbcorn2[3]
Definition: wmo.h:53
uint32 nTextures
Definition: wmo.h:51
unsigned int col
Definition: wmo.h:50
uint32 RootWMOID
Definition: wmo.h:51
uint32 nDoodadSets
Definition: wmo.h:51
uint32 nModels
Definition: wmo.h:51
uint32_t uint32
Definition: Define.h:150
std::string filename
Definition: wmo.h:48
uint32 liquidType
Definition: wmo.h:51
uint32 nDoodads
Definition: wmo.h:51
uint32 nP
Definition: wmo.h:51
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

float WMORoot::bbcorn1[3]
float WMORoot::bbcorn2[3]
unsigned int WMORoot::col
std::string WMORoot::filename
private
uint32 WMORoot::liquidType
uint32 WMORoot::nDoodads
uint32 WMORoot::nDoodadSets
uint32 WMORoot::nGroups
uint32 WMORoot::nLights
uint32 WMORoot::nModels
uint32 WMORoot::nP
uint32 WMORoot::nTextures
uint32 WMORoot::RootWMOID

The documentation for this class was generated from the following files: