510{
511
512
513 if ((mapObjDef.Flags & 0x1) != 0)
514 return;
515
516
517
518 char tempname[1036];
520 FILE* input;
521 input = fopen(tempname, "r+b");
522
523 if (!input)
524 {
525 printf("WMOInstance::WMOInstance: couldn't open %s\n", tempname);
526 return;
527 }
528
529 fseek(input, 8, SEEK_SET);
530 int nVertices;
531 int count = fread(&nVertices, sizeof (int), 1, input);
532 fclose(input);
533
534 if (count != 1 || nVertices == 0)
535 return;
536
537 Vec3D position = mapObjDef.Position;
538
539 float x, z;
542 if (x == 0 && z == 0)
543 {
544 position.
x = 533.33333f * 32;
545 position.
z = 533.33333f * 32;
546 }
551
552 float scale = 1.0f;
556
557 fwrite(&mapID,
sizeof(
uint32), 1, pDirfile);
558 fwrite(&tileX,
sizeof(
uint32), 1, pDirfile);
559 fwrite(&tileY,
sizeof(
uint32), 1, pDirfile);
560 fwrite(&flags,
sizeof(
uint32), 1, pDirfile);
561 fwrite(&mapObjDef.NameSet,
sizeof(
uint16), 1, pDirfile);
562 fwrite(&uniqueId,
sizeof(
uint32), 1, pDirfile);
563 fwrite(&position,
sizeof(
Vec3D), 1, pDirfile);
564 fwrite(&mapObjDef.Rotation,
sizeof(
Vec3D), 1, pDirfile);
565 fwrite(&scale, sizeof(float), 1, pDirfile);
566 fwrite(&bounds,
sizeof(
AaBox3D), 1, pDirfile);
567 uint32 nlen = strlen(WmoInstName);
568 fwrite(&nlen,
sizeof(
uint32), 1, pDirfile);
569 fwrite(WmoInstName, sizeof(char), nlen, pDirfile);
570}
std::uint32_t uint32
Definition: Define.h:107
std::uint16_t uint16
Definition: Define.h:108
@ MOD_WORLDSPAWN
Definition: vmapexport.h:34
@ MOD_HAS_BOUND
Definition: vmapexport.h:35
static Vec3D fixCoords(const Vec3D &v)
Definition: wmo.h:68
uint32 GenerateUniqueObjectId(uint32 clientId, uint16 clientDoodadId)
Definition: vmapexport.cpp:72
char const * szWorkDirWmo
Definition: vmapexport.cpp:68
float x
Definition: vec3d.h:27
float z
Definition: vec3d.h:27
Vec3D max
Definition: vec3d.h:144
Vec3D min
Definition: vec3d.h:143