256 int nColTriangles = 0;
264 MobaEx =
new int[moba_batch*4];
269 int moba_size_grp = moba_batch*4+4;
270 fwrite(&moba_size_grp,4,1,
output);
271 fwrite(&moba_batch,4,1,
output);
277 if(fwrite(
"INDX",4, 1,
output) != 1)
279 printf(
"Error while writing file nbraches ID");
282 int wsize =
sizeof(
uint32) +
sizeof(
unsigned short) * nIdexes;
283 if(fwrite(&wsize,
sizeof(
int), 1,
output) != 1)
285 printf(
"Error while writing file wsize");
290 printf(
"Error while writing file nIndexes");
295 if(fwrite(
MOVI,
sizeof(
unsigned short), nIdexes,
output) != nIdexes)
297 printf(
"Error while writing file indexarray");
302 if(fwrite(
"VERT",4, 1,
output) != 1)
304 printf(
"Error while writing file nbraches ID");
307 wsize =
sizeof(int) +
sizeof(
float) * 3 *
nVertices;
308 if(fwrite(&wsize,
sizeof(
int), 1,
output) != 1)
310 printf(
"Error while writing file wsize");
315 printf(
"Error while writing file nVertices");
322 printf(
"Error while writing file vectors");
334 int moba_batch = moba_size/12;
335 MobaEx =
new int[moba_batch*4];
341 int moba_size_grp = moba_batch*4+4;
342 fwrite(&moba_size_grp,4,1,
output);
343 fwrite(&moba_batch,4,1,
output);
351 memset(IndexRenum, 0xFF,
nVertices*
sizeof(
int));
359 for (
int j=0; j<3; ++j)
361 IndexRenum[
MOVI[3*i + j]] = 1;
362 MoviEx[3*nColTriangles + j] = MOVI[3*i + j];
368 int nColVertices = 0;
371 if (IndexRenum[i] == 1)
373 IndexRenum[i] = nColVertices;
379 for (
int i=0; i<3*nColTriangles; ++i)
381 assert(
MoviEx[i] < nVertices);
386 int INDX[] = {0x58444E49, nColTriangles*6+4, nColTriangles*3};
391 int VERT[] = {0x54524556, nColVertices*3*
static_cast<int>(
sizeof(float))+4, nColVertices};
392 int check = 3*nColVertices;
395 if(IndexRenum[i] >= 0)
396 check -= fwrite(
MOVT+3*i,
sizeof(
float), 3,
output);
401 delete [] IndexRenum;
408 fwrite(LIQU_h, 4, 2,
output);
435 if (v2 < v1 && (
LiquBytes[v2] & 0xF) != 15)
440 if (liquidEntry && liquidEntry < 21)
442 switch ((liquidEntry - 1) & 3)
445 liquidEntry = ((
mogpFlags & 0x80000) != 0) + 13;
474 return nColTriangles;
int * MobaEx
Definition: wmo.h:93
#define WMO_MATERIAL_NO_COLLISION
Definition: wmo.h:32
uint32 groupWMOID
Definition: wmo.h:105
uint16 * MOVI
Definition: wmo.h:89
float bbcorn2[3]
Definition: wmo.h:100
char * MOPY
Definition: wmo.h:88
uint32 liquidType
Definition: wmo.h:105
#define WMO_MATERIAL_COLLIDE_HIT
Definition: wmo.h:35
WMOLiquidVert * LiquEx
Definition: wmo.h:95
uint16 * MoviEx
Definition: wmo.h:90
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
char * LiquBytes
Definition: wmo.h:96
int nTriangles
Definition: wmo.h:110
WMOLiquidHeader * hlq
Definition: wmo.h:94
#define WMO_MATERIAL_HINT
Definition: wmo.h:33
int LiquEx_size
Definition: wmo.h:108
uint32 liquidType
Definition: wmo.h:51
float bbcorn1[3]
Definition: wmo.h:99
unsigned int nVertices
Definition: wmo.h:109
uint32 liquflags
Definition: wmo.h:111
float * MOVT
Definition: wmo.h:91
uint32_t uint32
Definition: g3dmath.h:168
int mogpFlags
Definition: wmo.h:98
int moba_size
Definition: wmo.h:107
T check(T value)
Definition: format.h:305
uint16 * MOBA
Definition: wmo.h:92
bool preciseVectorData
Definition: vmapexport.cpp:76
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083