TrinityCore
Loading...
Searching...
No Matches
wmo.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "vmapexport.h"
19#include "adtfile.h"
20#include "Errors.h"
21#include "mpq_libmpq.h"
22#include "StringFormat.h"
23#include "vec3d.h"
24#include "VMapDefinitions.h"
25#include "wmo.h"
26#include <fstream>
27#include <map>
28#include <cstdio>
29#include <cstdlib>
30
31WMORoot::WMORoot(std::string const& filename)
32 : filename(filename), color(0), nTextures(0), nGroups(0), nPortals(0), nLights(0),
33 nDoodadNames(0), nDoodadDefs(0), nDoodadSets(0), RootWMOID(0), flags(0)
34{
35 memset(bbcorn1, 0, sizeof(bbcorn1));
36 memset(bbcorn2, 0, sizeof(bbcorn2));
37}
38
40{
41 MPQFile f(filename.c_str());
42 if(f.isEof ())
43 {
44 printf("No such file.\n");
45 return false;
46 }
47
48 uint32 size;
49 char fourcc[5];
50
51 while (!f.isEof())
52 {
53 f.read(fourcc,4);
54 f.read(&size, 4);
55
56 flipcc(fourcc);
57 fourcc[4] = 0;
58
59 size_t nextpos = f.getPos() + size;
60
61 if (!strcmp(fourcc,"MOHD")) // header
62 {
63 f.read(&nTextures, 4);
64 f.read(&nGroups, 4);
65 f.read(&nPortals, 4);
66 f.read(&nLights, 4);
67 f.read(&nDoodadNames, 4);
68 f.read(&nDoodadDefs, 4);
69 f.read(&nDoodadSets, 4);
70 f.read(&color, 4);
71 f.read(&RootWMOID, 4);
72 f.read(bbcorn1, 12);
73 f.read(bbcorn2, 12);
74 f.read(&flags, 4);
75 }
76 else if (!strcmp(fourcc, "MODS"))
77 {
78 DoodadData.Sets.resize(size / sizeof(WMO::MODS));
79 f.read(DoodadData.Sets.data(), size);
80 }
81 else if (!strcmp(fourcc,"MODN"))
82 {
83 char* ptr = f.getPointer();
84 char* end = ptr + size;
85 DoodadData.Paths = std::make_unique<char[]>(size);
86 memcpy(DoodadData.Paths.get(), ptr, size);
87 while (ptr < end)
88 {
89 std::string path = ptr;
90
91 char* s = GetPlainName(ptr);
92 FixNameCase(s, strlen(s));
93 FixNameSpaces(s, strlen(s));
94
95 uint32 doodadNameIndex = ptr - f.getPointer();
96 ptr += path.length() + 1;
97
98 if (ExtractSingleModel(path))
99 ValidDoodadNames.insert(doodadNameIndex);
100 }
101 }
102 else if (!strcmp(fourcc,"MODD"))
103 {
104 DoodadData.Spawns.resize(size / sizeof(WMO::MODD));
105 f.read(DoodadData.Spawns.data(), size);
106 }
107 else if (!strcmp(fourcc, "MOGN"))
108 {
109 GroupNames.resize(size);
110 f.read(GroupNames.data(), size);
111 }
112 /*
113 else if (!strcmp(fourcc,"MOTX"))
114 {
115 }
116 else if (!strcmp(fourcc,"MOMT"))
117 {
118 }
119 else if (!strcmp(fourcc,"MOGI"))
120 {
121 }
122 else if (!strcmp(fourcc,"MOLT"))
123 {
124 }
125 else if (!strcmp(fourcc,"MOSB"))
126 {
127 }
128 else if (!strcmp(fourcc,"MOPV"))
129 {
130 }
131 else if (!strcmp(fourcc,"MOPT"))
132 {
133 }
134 else if (!strcmp(fourcc,"MOPR"))
135 {
136 }
137 else if (!strcmp(fourcc,"MFOG"))
138 {
139 }
140 */
141 f.seek((int)nextpos);
142 }
143 f.close ();
144 return true;
145}
146
148{
149 //printf("Convert RootWmo...\n");
150
151 fwrite(VMAP::RAW_VMAP_MAGIC, 1, 8, pOutfile);
152 unsigned int nVectors = 0;
153 fwrite(&nVectors,sizeof(nVectors), 1, pOutfile); // will be filled later
154 fwrite(&nGroups, 4, 1, pOutfile);
155 fwrite(&RootWMOID, 4, 1, pOutfile);
156 return true;
157}
158
159WMOGroup::WMOGroup(const std::string &filename) :
160 filename(filename), MOPY(0), MOVI(0), MoviEx(0), MOVT(0), MOBA(0), MobaEx(0),
161 hlq(0), LiquEx(0), LiquBytes(0), groupName(0), descGroupName(0), mogpFlags(0),
162 moprIdx(0), moprNItems(0), nBatchA(0), nBatchB(0), nBatchC(0), fogIdx(0),
163 groupLiquid(0), groupWMOID(0), mopy_size(0), moba_size(0), LiquEx_size(0),
164 nVertices(0), nTriangles(0), liquflags(0)
165{
166 memset(bbcorn1, 0, sizeof(bbcorn1));
167 memset(bbcorn2, 0, sizeof(bbcorn2));
168}
169
171{
172 MPQFile f(filename.c_str());
173 if(f.isEof ())
174 {
175 printf("No such file.\n");
176 return false;
177 }
178 uint32 size;
179 char fourcc[5];
180 while (!f.isEof())
181 {
182 f.read(fourcc,4);
183 f.read(&size, 4);
184 flipcc(fourcc);
185 if (!strcmp(fourcc,"MOGP"))//Fix sizeoff = Data size.
186 {
187 size = 68;
188 }
189 fourcc[4] = 0;
190 size_t nextpos = f.getPos() + size;
191 if (!strcmp(fourcc,"MOGP"))//header
192 {
193 f.read(&groupName, 4);
194 f.read(&descGroupName, 4);
195 f.read(&mogpFlags, 4);
196 f.read(bbcorn1, 12);
197 f.read(bbcorn2, 12);
198 f.read(&moprIdx, 2);
199 f.read(&moprNItems, 2);
200 f.read(&nBatchA, 2);
201 f.read(&nBatchB, 2);
202 f.read(&nBatchC, 4);
203 f.read(&fogIdx, 4);
204 f.read(&groupLiquid, 4);
205 f.read(&groupWMOID,4);
206
207 // according to WoW.Dev Wiki:
208 if (rootWMO->flags & 4)
210 else if (groupLiquid == 15)
211 groupLiquid = 0;
212 else
214
215 if (groupLiquid)
216 liquflags |= 2;
217 }
218 else if (!strcmp(fourcc,"MOPY"))
219 {
220 MOPY = new char[size];
221 mopy_size = size;
222 nTriangles = (int)size / 2;
223 f.read(MOPY, size);
224 }
225 else if (!strcmp(fourcc,"MOVI"))
226 {
227 MOVI = new uint16[size/2];
228 f.read(MOVI, size);
229 }
230 else if (!strcmp(fourcc,"MOVT"))
231 {
232 MOVT = new float[size/4];
233 f.read(MOVT, size);
234 nVertices = (int)size / 12;
235 }
236 else if (!strcmp(fourcc,"MONR"))
237 {
238 }
239 else if (!strcmp(fourcc,"MOTV"))
240 {
241 }
242 else if (!strcmp(fourcc,"MOBA"))
243 {
244 MOBA = new uint16[size/2];
245 moba_size = size/2;
246 f.read(MOBA, size);
247 }
248 else if (!strcmp(fourcc,"MODR"))
249 {
250 DoodadReferences.resize(size / sizeof(uint16));
251 f.read(DoodadReferences.data(), size);
252 }
253 else if (!strcmp(fourcc,"MLIQ"))
254 {
255 liquflags |= 1;
256 hlq = new WMOLiquidHeader();
257 f.read(hlq, sizeof(WMOLiquidHeader));
261 int nLiquBytes = hlq->xtiles * hlq->ytiles;
262 LiquBytes = new char[nLiquBytes];
263 f.read(LiquBytes, nLiquBytes);
264
265 // Determine legacy liquid type
266 if (!groupLiquid)
267 {
268 for (int i = 0; i < hlq->xtiles * hlq->ytiles; ++i)
269 {
270 if ((LiquBytes[i] & 0xF) != 15)
271 {
272 groupLiquid = GetLiquidTypeId((LiquBytes[i] & 0xF) + 1);
273 break;
274 }
275 }
276 }
277
278 /* std::ofstream llog("Buildings/liquid.log", ios_base::out | ios_base::app);
279 llog << filename;
280 llog << "\nbbox: " << bbcorn1[0] << ", " << bbcorn1[1] << ", " << bbcorn1[2] << " | " << bbcorn2[0] << ", " << bbcorn2[1] << ", " << bbcorn2[2];
281 llog << "\nlpos: " << hlq->pos_x << ", " << hlq->pos_y << ", " << hlq->pos_z;
282 llog << "\nx-/yvert: " << hlq->xverts << "/" << hlq->yverts << " size: " << size << " expected size: " << 30 + hlq->xverts*hlq->yverts*8 + hlq->xtiles*hlq->ytiles << std::endl;
283 llog.close(); */
284 }
285 f.seek((int)nextpos);
286 }
287 f.close();
288 return true;
289}
290
292{
293 fwrite(&mogpFlags,sizeof(uint32),1,output);
294 fwrite(&groupWMOID,sizeof(uint32),1,output);
295 // group bound
296 fwrite(bbcorn1, sizeof(float), 3, output);
297 fwrite(bbcorn2, sizeof(float), 3, output);
298 fwrite(&liquflags,sizeof(uint32),1,output);
299 int nColTriangles = 0;
301 {
302 char GRP[] = "GRP ";
303 fwrite(GRP,1,4,output);
304
305 int k = 0;
306 int moba_batch = moba_size/12;
307 MobaEx = new int[moba_batch*4];
308 for(int i=8; i<moba_size; i+=12)
309 {
310 MobaEx[k++] = MOBA[i];
311 }
312 int moba_size_grp = moba_batch*4+4;
313 fwrite(&moba_size_grp,4,1,output);
314 fwrite(&moba_batch,4,1,output);
315 fwrite(MobaEx,4,k,output);
316 delete [] MobaEx;
317
318 uint32 nIdexes = nTriangles * 3;
319
320 if(fwrite("INDX",4, 1, output) != 1)
321 {
322 printf("Error while writing file nbraches ID");
323 exit(0);
324 }
325 int wsize = sizeof(uint32) + sizeof(unsigned short) * nIdexes;
326 if(fwrite(&wsize, sizeof(int), 1, output) != 1)
327 {
328 printf("Error while writing file wsize");
329 // no need to exit?
330 }
331 if(fwrite(&nIdexes, sizeof(uint32), 1, output) != 1)
332 {
333 printf("Error while writing file nIndexes");
334 exit(0);
335 }
336 if(nIdexes >0)
337 {
338 if(fwrite(MOVI, sizeof(unsigned short), nIdexes, output) != nIdexes)
339 {
340 printf("Error while writing file indexarray");
341 exit(0);
342 }
343 }
344
345 if(fwrite("VERT",4, 1, output) != 1)
346 {
347 printf("Error while writing file nbraches ID");
348 exit(0);
349 }
350 wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
351 if(fwrite(&wsize, sizeof(int), 1, output) != 1)
352 {
353 printf("Error while writing file wsize");
354 // no need to exit?
355 }
356 if(fwrite(&nVertices, sizeof(int), 1, output) != 1)
357 {
358 printf("Error while writing file nVertices");
359 exit(0);
360 }
361 if(nVertices >0)
362 {
363 if(fwrite(MOVT, sizeof(float)*3, nVertices, output) != nVertices)
364 {
365 printf("Error while writing file vectors");
366 exit(0);
367 }
368 }
369
370 nColTriangles = nTriangles;
371 }
372 else
373 {
374 char GRP[] = "GRP ";
375 fwrite(GRP,1,4,output);
376 int k = 0;
377 int moba_batch = moba_size/12;
378 MobaEx = new int[moba_batch*4];
379 for(int i=8; i<moba_size; i+=12)
380 {
381 MobaEx[k++] = MOBA[i];
382 }
383
384 int moba_size_grp = moba_batch*4+4;
385 fwrite(&moba_size_grp,4,1,output);
386 fwrite(&moba_batch,4,1,output);
387 fwrite(MobaEx,4,k,output);
388 delete [] MobaEx;
389
390 //-------INDX------------------------------------
391 //-------MOPY--------
392 MoviEx = new uint16[nTriangles*3]; // "worst case" size...
393 int *IndexRenum = new int[nVertices];
394 memset(IndexRenum, 0xFF, nVertices*sizeof(int));
395 for (int i=0; i<nTriangles; ++i)
396 {
397 // Skip no collision triangles
398 bool isRenderFace = (MOPY[2 * i] & WMO_MATERIAL_RENDER) && !(MOPY[2 * i] & WMO_MATERIAL_DETAIL);
399 bool isCollision = MOPY[2 * i] & WMO_MATERIAL_COLLISION || isRenderFace;
400 if (!isCollision)
401 continue;
402
403 // Use this triangle
404 for (int j=0; j<3; ++j)
405 {
406 IndexRenum[MOVI[3*i + j]] = 1;
407 MoviEx[3*nColTriangles + j] = MOVI[3*i + j];
408 }
409 ++nColTriangles;
410 }
411
412 // assign new vertex index numbers
413 int nColVertices = 0;
414 for (uint32 i=0; i<nVertices; ++i)
415 {
416 if (IndexRenum[i] == 1)
417 {
418 IndexRenum[i] = nColVertices;
419 ++nColVertices;
420 }
421 }
422
423 // translate triangle indices to new numbers
424 for (int i=0; i<3*nColTriangles; ++i)
425 {
426 ASSERT(MoviEx[i] < nVertices);
427 MoviEx[i] = IndexRenum[MoviEx[i]];
428 }
429
430 // write triangle indices
431 int INDX[] = {0x58444E49, nColTriangles*6+4, nColTriangles*3};
432 fwrite(INDX,4,3,output);
433 fwrite(MoviEx,2,nColTriangles*3,output);
434
435 // write vertices
436 int VERT[] = {0x54524556, nColVertices*3*static_cast<int>(sizeof(float))+4, nColVertices};// "VERT"
437 int check = 3*nColVertices;
438 fwrite(VERT,4,3,output);
439 for (uint32 i=0; i<nVertices; ++i)
440 if(IndexRenum[i] >= 0)
441 check -= fwrite(MOVT+3*i, sizeof(float), 3, output);
442
443 ASSERT(check==0);
444
445 delete [] MoviEx;
446 delete [] IndexRenum;
447 }
448
449 //------LIQU------------------------
450 if (liquflags & 3)
451 {
452 int LIQU_totalSize = sizeof(uint32);
453 if (liquflags & 1)
454 {
455 LIQU_totalSize += sizeof(WMOLiquidHeader);
456 LIQU_totalSize += LiquEx_size / sizeof(WMOLiquidVert) * sizeof(float);
457 LIQU_totalSize += hlq->xtiles * hlq->ytiles;
458 }
459 int LIQU_h[] = { 0x5551494C, LIQU_totalSize };// "LIQU"
460 fwrite(LIQU_h, 4, 2, output);
461
462 /* std::ofstream llog("Buildings/liquid.log", ios_base::out | ios_base::app);
463 llog << filename;
464 llog << ":\nliquidEntry: " << liquidEntry << " type: " << hlq->type << " (root:" << rootWMO->liquidType << " group:" << liquidType << ")\n";
465 llog.close(); */
466
467 fwrite(&groupLiquid, sizeof(uint32), 1, output);
468 if (liquflags & 1)
469 {
470 fwrite(hlq, sizeof(WMOLiquidHeader), 1, output);
471 // only need height values, the other values are unknown anyway
472 for (uint32 i = 0; i < LiquEx_size / sizeof(WMOLiquidVert); ++i)
473 fwrite(&LiquEx[i].height, sizeof(float), 1, output);
474 // todo: compress to bit field
475 fwrite(LiquBytes, 1, hlq->xtiles * hlq->ytiles, output);
476 }
477 }
478
479 return nColTriangles;
480}
481
483{
484 if (liquidTypeId < 21 && liquidTypeId)
485 {
486 switch (((static_cast<uint8>(liquidTypeId) - 1) & 3))
487 {
488 case 0: return ((mogpFlags & 0x80000) != 0) + 13;
489 case 1: return 14;
490 case 2: return 19;
491 case 3: return 20;
492 default: break;
493 }
494 }
495 return liquidTypeId;
496}
497
498bool WMOGroup::ShouldSkip(WMORoot const* root) const
499{
500 // skip unreachable
501 if (mogpFlags & 0x80)
502 return true;
503
504 // skip antiportals
505 if (mogpFlags & 0x4000000)
506 return true;
507
508 if (groupName < int32(root->GroupNames.size()) && !strcmp(&root->GroupNames[groupName], "antiportal"))
509 return true;
510
511 return false;
512}
513
515{
516 delete [] MOPY;
517 delete [] MOVI;
518 delete [] MOVT;
519 delete [] MOBA;
520 delete hlq;
521 delete [] LiquEx;
522 delete [] LiquBytes;
523}
524
525void MapObject::Extract(ADT::MODF const& mapObjDef, char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile)
526{
527 // destructible wmo, do not dump. we can handle the vmap for these
528 // in dynamic tree (gameobject vmaps)
529 if ((mapObjDef.Flags & 0x1) != 0)
530 return;
531
532 //-----------add_in _dir_file----------------
533
534 std::string tempname = Trinity::StringFormat("{}/{}", szWorkDirWmo, WmoInstName);
535 FILE* input = fopen(tempname.c_str(), "r+b");
536
537 if (!input)
538 {
539 printf("WMOInstance::WMOInstance: couldn't open %s\n", tempname.c_str());
540 return;
541 }
542
543 fseek(input, 8, SEEK_SET); // get the correct no of vertices
544 int nVertices;
545 int count = fread(&nVertices, sizeof(int), 1, input);
546 fclose(input);
547
548 if (count != 1 || nVertices == 0)
549 return;
550
551 Vec3D position = mapObjDef.Position;
552
553 float x, z;
554 x = position.x;
555 z = position.z;
556 if (x == 0 && z == 0)
557 {
558 position.x = 533.33333f * 32;
559 position.z = 533.33333f * 32;
560 }
561 position = fixCoords(position);
562 AaBox3D bounds;
563 bounds.min = fixCoords(mapObjDef.Bounds.min);
564 bounds.max = fixCoords(mapObjDef.Bounds.max);
565
566 float scale = 1.0f;
567 uint32 uniqueId = GenerateUniqueObjectId(mapObjDef.UniqueId, 0);
569 if (tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN;
570 //write mapID, tileX, tileY, Flags, NameSet, UniqueId, Pos, Rot, Scale, Bound_lo, Bound_hi, name
571 fwrite(&mapID, sizeof(uint32), 1, pDirfile);
572 fwrite(&tileX, sizeof(uint32), 1, pDirfile);
573 fwrite(&tileY, sizeof(uint32), 1, pDirfile);
574 fwrite(&flags, sizeof(uint32), 1, pDirfile);
575 fwrite(&mapObjDef.NameSet, sizeof(uint16), 1, pDirfile);
576 fwrite(&uniqueId, sizeof(uint32), 1, pDirfile);
577 fwrite(&position, sizeof(Vec3D), 1, pDirfile);
578 fwrite(&mapObjDef.Rotation, sizeof(Vec3D), 1, pDirfile);
579 fwrite(&scale, sizeof(float), 1, pDirfile);
580 fwrite(&bounds, sizeof(AaBox3D), 1, pDirfile);
581 uint32 nlen = strlen(WmoInstName);
582 fwrite(&nlen, sizeof(uint32), 1, pDirfile);
583 fwrite(WmoInstName, sizeof(char), nlen, pDirfile);
584
585}
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
uint16 flags
#define ASSERT
Definition Errors.h:68
char const * GetPlainName(char const *FileName)
Definition adtfile.cpp:25
void FixNameCase(char *name, size_t len)
Definition adtfile.cpp:43
void FixNameSpaces(char *name, size_t len)
Definition adtfile.cpp:60
Vec3D max
Definition vec3d.h:138
Vec3D min
Definition vec3d.h:137
size_t read(void *dest, size_t bytes)
char * getPointer()
Definition mpq_libmpq.h:90
bool isEof()
Definition mpq_libmpq.h:91
void close()
size_t getPos()
Definition mpq_libmpq.h:88
void seek(int offset)
Definition vec3d.h:25
float x
Definition vec3d.h:27
float z
Definition vec3d.h:27
uint32 nBatchC
Definition wmo.h:141
float * MOVT
Definition wmo.h:127
int moba_size
Definition wmo.h:143
WMOGroup(std::string const &filename)
Definition wmo.cpp:159
uint16 * MOVI
Definition wmo.h:125
uint16 nBatchA
Definition wmo.h:139
uint32 fogIdx
Definition wmo.h:141
uint32 groupLiquid
Definition wmo.h:141
uint16 moprIdx
Definition wmo.h:137
std::string filename
Definition wmo.h:120
int groupName
Definition wmo.h:133
int descGroupName
Definition wmo.h:133
int LiquEx_size
Definition wmo.h:144
uint32 groupWMOID
Definition wmo.h:141
uint16 nBatchB
Definition wmo.h:140
float bbcorn2[3]
Definition wmo.h:136
std::vector< uint16 > DoodadReferences
Definition wmo.h:149
int mogpFlags
Definition wmo.h:134
unsigned int nVertices
Definition wmo.h:145
WMOLiquidVert * LiquEx
Definition wmo.h:131
uint16 * MOBA
Definition wmo.h:128
uint32 liquflags
Definition wmo.h:147
char * MOPY
Definition wmo.h:124
bool open(WMORoot *rootWMO)
Definition wmo.cpp:170
int nTriangles
Definition wmo.h:146
uint32 GetLiquidTypeId(uint32 liquidTypeId)
Definition wmo.cpp:482
char * LiquBytes
Definition wmo.h:132
int mopy_size
Definition wmo.h:143
~WMOGroup()
Definition wmo.cpp:514
int * MobaEx
Definition wmo.h:129
WMOLiquidHeader * hlq
Definition wmo.h:130
int ConvertToVMAPGroupWmo(FILE *output, bool preciseVectorData)
Definition wmo.cpp:291
uint16 * MoviEx
Definition wmo.h:126
bool ShouldSkip(WMORoot const *root) const
Definition wmo.cpp:498
uint16 moprNItems
Definition wmo.h:138
float bbcorn1[3]
Definition wmo.h:135
Definition wmo.h:78
float bbcorn1[3]
Definition wmo.h:84
std::vector< char > GroupNames
Definition wmo.h:87
uint32 nDoodadSets
Definition wmo.h:83
uint32 nDoodadDefs
Definition wmo.h:83
WMODoodadData DoodadData
Definition wmo.h:88
uint32 nLights
Definition wmo.h:83
uint32 nPortals
Definition wmo.h:83
bool open()
Definition wmo.cpp:39
float bbcorn2[3]
Definition wmo.h:85
uint32 nGroups
Definition wmo.h:83
std::unordered_set< uint32 > ValidDoodadNames
Definition wmo.h:89
std::string filename
Definition wmo.h:80
bool ConvertToVMAPRootWmo(FILE *output)
Definition wmo.cpp:147
uint32 nDoodadNames
Definition wmo.h:83
unsigned int color
Definition wmo.h:82
uint32 nTextures
Definition wmo.h:83
uint32 flags
Definition wmo.h:83
WMORoot(std::string const &filename)
Definition wmo.cpp:31
uint32 RootWMOID
Definition wmo.h:83
bool ExtractSingleModel(std::string &fname)
void flipcc(char *fcc)
Definition mpq_libmpq.h:97
void Extract(ADT::MODF const &mapObjDef, char const *WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default TC string format function.
const char RAW_VMAP_MAGIC[]
uint16 Flags
Definition adtfile.h:45
AaBox3D Bounds
Definition adtfile.h:44
Vec3D Rotation
Definition adtfile.h:43
uint16 NameSet
Definition adtfile.h:47
uint32 UniqueId
Definition adtfile.h:41
Vec3D Position
Definition adtfile.h:42
std::vector< WMO::MODS > Sets
Definition wmo.h:71
std::vector< WMO::MODD > Spawns
Definition wmo.h:73
std::unique_ptr< char[]> Paths
Definition wmo.h:72
bool preciseVectorData
uint32 GenerateUniqueObjectId(uint32 clientId, uint16 clientDoodadId)
char const * szWorkDirWmo
@ MOD_WORLDSPAWN
Definition vmapexport.h:28
@ MOD_HAS_BOUND
Definition vmapexport.h:29
@ WMO_MATERIAL_DETAIL
Definition wmo.h:33
@ WMO_MATERIAL_COLLISION
Definition wmo.h:34
@ WMO_MATERIAL_RENDER
Definition wmo.h:36
static Vec3D fixCoords(Vec3D const &v)
Definition wmo.h:67