86{
88 return false;
89
91 std::string dirname = std::string(
szWorkDirWmo) +
"/dir_bin";
92 FILE* dirfile;
93 dirfile = fopen(dirname.c_str(), "ab");
94 if (!dirfile)
95 {
96 printf("Can't open dirfile!'%s'\n", dirname.c_str());
97 return false;
98 }
99
101 {
102 char fourcc[5];
106 fourcc[4] = 0;
107
109
110 if (!strcmp(fourcc, "MCIN"))
111 {
112 }
113 else if (!strcmp(fourcc, "MTEX"))
114 {
115 }
116 else if (!strcmp(fourcc, "MMDX"))
117 {
118 if (size)
119 {
120 char* buf = new char[size];
122 char* p = buf;
123 while (p < buf + size)
124 {
128
130
131 string path(p);
133
134 p = p + strlen(p) + 1;
135 }
136 delete[] buf;
137 }
138 }
139 else if (!strcmp(fourcc, "MWMO"))
140 {
141 if (size)
142 {
143 char* buf = new char[size];
145 char* p = buf;
146 while (p < buf + size)
147 {
148 std::string path(p);
149
154
156
157 p += strlen(p) + 1;
158 }
159 delete[] buf;
160 }
161 }
162
163 else if (!strcmp(fourcc, "MDDF"))
164 {
165 if (size)
166 {
168 for (
uint32 i = 0; i < doodadCount; ++i)
169 {
173 }
174 }
175 }
176 else if (!strcmp(fourcc, "MODF"))
177 {
178 if (size)
179 {
181 for (
uint32 i = 0; i < mapObjectCount; ++i)
182 {
187 }
188 }
189 }
190
192 }
194 fclose(dirfile);
195 return true;
196}
std::uint32_t uint32
Definition: Define.h:108
const char * GetPlainName(const char *FileName)
Definition: adtfile.cpp:27
void fixnamen(char *name, size_t len)
Definition: adtfile.cpp:45
void fixname2(char *name, size_t len)
Definition: adtfile.cpp:63
bool ExtractSingleModel(std::string &fname)
Definition: gameobject_extract.cpp:25
std::unordered_map< std::string, WMODoodadData > WmoDoodads
Definition: vmapexport.cpp:64
char const * szWorkDirWmo
Definition: vmapexport.cpp:68
bool ExtractSingleWmo(std::string &fname)
Definition: vmapexport.cpp:98
void Extract(ADT::MDDF const &doodadDef, char const *ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: model.cpp:138
void ExtractSet(WMODoodadData const &doodadData, ADT::MODF const &wmo, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: model.cpp:181
void Extract(ADT::MODF const &mapObjDef, char const *WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: wmo.cpp:510
size_t read(void *dest, size_t bytes)
Definition: mpq_libmpq.cpp:96
bool isEof()
Definition: mpq_libmpq04.h:93
size_t getPos()
Definition: mpq_libmpq04.h:90
void seek(int offset)
Definition: mpq_libmpq.cpp:114
uint32 Id
Definition: adtfile.h:30
uint32 Id
Definition: adtfile.h:40
std::vector< std::string > ModelInstanceNames
Definition: adtfile.h:62
std::vector< std::string > WmoInstanceNames
Definition: adtfile.h:61
void flipcc(char *fcc)
Definition: mpq_libmpq04.h:99