533{
534
535
536 if ((mapObjDef.Flags & 0x1) != 0)
537 return;
538
539
540
541 char tempname[1036];
543 FILE* input;
544 input = fopen(tempname, "r+b");
545
546 if (!input)
547 {
548 printf("WMOInstance::WMOInstance: couldn't open %s\n", tempname);
549 return;
550 }
551
552 fseek(input, 8, SEEK_SET);
553 int nVertices;
554 int count = fread(&nVertices, sizeof (int), 1, input);
555 fclose(input);
556
557 if (count != 1 || nVertices == 0)
558 return;
559
560 Vec3D position = mapObjDef.Position;
561
562 float x, z;
565 if (x == 0 && z == 0)
566 {
567 position.
x = 533.33333f * 32;
568 position.
z = 533.33333f * 32;
569 }
574
575 float scale = 1.0f;
579
580 fwrite(&mapID,
sizeof(
uint32), 1, pDirfile);
581 fwrite(&tileX,
sizeof(
uint32), 1, pDirfile);
582 fwrite(&tileY,
sizeof(
uint32), 1, pDirfile);
583 fwrite(&flags,
sizeof(
uint32), 1, pDirfile);
584 fwrite(&mapObjDef.NameSet,
sizeof(
uint16), 1, pDirfile);
585 fwrite(&uniqueId,
sizeof(
uint32), 1, pDirfile);
586 fwrite(&position,
sizeof(
Vec3D), 1, pDirfile);
587 fwrite(&mapObjDef.Rotation,
sizeof(
Vec3D), 1, pDirfile);
588 fwrite(&scale, sizeof(float), 1, pDirfile);
589 fwrite(&bounds,
sizeof(
AaBox3D), 1, pDirfile);
590 uint32 nlen = strlen(WmoInstName);
591 fwrite(&nlen,
sizeof(
uint32), 1, pDirfile);
592 fwrite(WmoInstName, sizeof(char), nlen, pDirfile);
593}
std::uint32_t uint32
Definition Define.h:107
std::uint16_t uint16
Definition Define.h:108
Vec3D max
Definition vec3d.h:144
Vec3D min
Definition vec3d.h:143
float x
Definition vec3d.h:27
float z
Definition vec3d.h:27
uint32 GenerateUniqueObjectId(uint32 clientId, uint16 clientDoodadId)
Definition vmapexport.cpp:72
char const * szWorkDirWmo
Definition vmapexport.cpp:68
@ MOD_WORLDSPAWN
Definition vmapexport.h:34
@ MOD_HAS_BOUND
Definition vmapexport.h:35
static Vec3D fixCoords(const Vec3D &v)
Definition wmo.h:68