AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
VMAP::WorldModel_Raw Struct Reference

#include "TileAssembler.h"

Public Member Functions

bool Read (const char *path)
 

Public Attributes

uint32 RootWMOID
 
std::vector< GroupModel_RawgroupsArray
 

Detailed Description

Member Function Documentation

◆ Read()

bool VMAP::WorldModel_Raw::Read ( const char *  path)

rf will be freed inside Read if the function had any errors.

570 {
571 FILE* rf = fopen(path, "rb");
572 if (!rf)
573 {
574 printf("ERROR: Can't open raw model file: %s\n", path);
575 return false;
576 }
577
578 char ident[9];
579 ident[8] = '\0';
580 int readOperation = 0;
581
582 READ_OR_RETURN(&ident, 8);
584
585 // we have to read one int. This is needed during the export and we have to skip it here
586 uint32 tempNVectors;
587 READ_OR_RETURN(&tempNVectors, sizeof(tempNVectors));
588
589 uint32 groups;
590 READ_OR_RETURN(&groups, sizeof(uint32));
592
593 groupsArray.resize(groups);
594 bool succeed = true;
595 for (uint32 g = 0; g < groups && succeed; ++g)
596 {
597 succeed = groupsArray[g].Read(rf);
598 }
599
600 if (succeed)
601 {
602 fclose(rf);
603 }
604 return succeed;
605 }
std::uint32_t uint32
Definition: Define.h:107
#define READ_OR_RETURN(V, S)
Definition: TileAssembler.cpp:460
#define CMP_OR_RETURN(V, S)
Definition: TileAssembler.cpp:464
const char RAW_VMAP_MAGIC[]
Definition: VMapDefinitions.h:26
uint32 RootWMOID
Definition: TileAssembler.h:86
std::vector< GroupModel_Raw > groupsArray
Definition: TileAssembler.h:87

References CMP_OR_RETURN, groupsArray, VMAP::RAW_VMAP_MAGIC, READ_OR_RETURN, and RootWMOID.

Referenced by VMAP::TileAssembler::calculateTransformedBound(), VMAP::TileAssembler::convertRawFile(), and VMAP::TileAssembler::exportGameobjectModels().

Member Data Documentation

◆ groupsArray

◆ RootWMOID

uint32 VMAP::WorldModel_Raw::RootWMOID