TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
VMAP::WorldModel_Raw Struct Reference

#include <TileAssembler.h>

Public Member Functions

bool Read (const char *path)
 

Public Attributes

uint32 RootWMOID
 
std::vector< GroupModel_RawgroupsArray
 

Member Function Documentation

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

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

518  {
519  FILE* rf = fopen(path, "rb");
520  if (!rf)
521  {
522  printf("ERROR: Can't open raw model file: %s\n", path);
523  return false;
524  }
525 
526  char ident[9];
527  ident[8] = '\0';
528  int readOperation = 0;
529 
530  READ_OR_RETURN(&ident, 8);
532 
533  // we have to read one int. This is needed during the export and we have to skip it here
534  uint32 tempNVectors;
535  READ_OR_RETURN(&tempNVectors, sizeof(tempNVectors));
536 
537  uint32 groups;
538  READ_OR_RETURN(&groups, sizeof(uint32));
539  READ_OR_RETURN(&RootWMOID, sizeof(uint32));
540 
541  groupsArray.resize(groups);
542  bool succeed = true;
543  for (uint32 g = 0; g < groups && succeed; ++g)
544  succeed = groupsArray[g].Read(rf);
545 
546  if (succeed)
547  fclose(rf);
548  return succeed;
549  }
uint32 RootWMOID
Definition: TileAssembler.h:87
std::vector< GroupModel_Raw > groupsArray
Definition: TileAssembler.h:88
#define CMP_OR_RETURN(V, S)
Definition: TileAssembler.cpp:424
bool Read(const char *path)
Definition: TileAssembler.cpp:517
#define READ_OR_RETURN(V, S)
Definition: TileAssembler.cpp:420
uint32_t uint32
Definition: Define.h:150
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083
const char RAW_VMAP_MAGIC[]
Definition: VMapDefinitions.h:29

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<GroupModel_Raw> VMAP::WorldModel_Raw::groupsArray
uint32 VMAP::WorldModel_Raw::RootWMOID

The documentation for this struct was generated from the following files: