TrinityCore
Loading...
Searching...
No Matches
vmapexport.cpp File Reference
#include "vmapexport.h"
#include "adtfile.h"
#include "Banner.h"
#include "Common.h"
#include "DB2CascFileSource.h"
#include "ExtractorDB2LoadInfo.h"
#include "Locales.h"
#include "MapDefines.h"
#include "MapUtils.h"
#include "Memory.h"
#include "StringConvert.h"
#include "StringFormat.h"
#include "ThreadPool.h"
#include "Util.h"
#include "VMapDefinitions.h"
#include "wdtfile.h"
#include "wmo.h"
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <CascLib.h>
#include <algorithm>
#include <map>
#include <mutex>
#include <unordered_map>
#include <vector>
#include <cstdio>
#include "WheatyExceptionReport.h"
+ Include dependency graph for vmapexport.cpp:

Go to the source code of this file.

Classes

struct  LiquidMaterialEntry
 
struct  LiquidTypeEntry
 
struct  MapEntry
 

Macros

#define CASC_LOCALES_COUNT   17
 

Functions

bool OpenCascStorage (int locale)
 
uint32 GetInstalledLocalesMask ()
 
uint32 GenerateUniqueObjectId (uint32 clientId, uint16 clientDoodadId, bool isWmo)
 
std::pair< ExtractedModelData *, bool > BeginModelExtraction (std::string const &outputName)
 
ExtractedModelData const * ExtractSingleWmo (std::string &fname)
 
bool IsLiquidIgnored (uint32 liquidTypeId)
 
void ParsMapFiles ()
 
void TryLoadDB2 (char const *name, DB2CascFileSource *source, DB2FileLoader *db2, DB2FileLoadInfo const *loadInfo)
 
void ReadMapTable ()
 
void ReadLiquidMaterialTable ()
 
void ReadLiquidTypeTable ()
 
bool processArgv (int argc, char **argv, const char *versionString)
 
static bool RetardCheck ()
 
int main (int argc, char **argv)
 
 INIT_CRASH_HANDLER ()
 

Variables

std::shared_ptr< CASC::StorageCascStorage
 
std::unordered_map< uint32, LiquidMaterialEntryLiquidMaterials
 
std::unordered_map< uint32, LiquidTypeEntryLiquidTypes
 
std::vector< MapEntrymap_ids
 
boost::filesystem::path input_path
 
bool preciseVectorData = false
 
char const * CascProduct = "wow"
 
char const * CascRegion = "eu"
 
bool UseRemoteCasc = false
 
uint32 DbcLocale = 0
 
uint32 Threads = std::thread::hardware_concurrency()
 
char const * szWorkDirWmo = "./Buildings"
 
char const * CascLocaleNames [CASC_LOCALES_COUNT]
 
uint32 WowLocaleToCascLocaleFlags [12]
 
static std::atomic< uint32UniqueObjectIdGenerator = std::numeric_limits<uint32>::max() - 1
 
static std::mutex UniqueObjectIdsMutex
 
static std::map< std::pair< uint32, uint16 >, uint32UniqueObjectIds
 
static std::mutex ExtractedModelsMutex
 
std::unordered_map< std::string, ExtractedModelDataExtractedModels
 

Macro Definition Documentation

◆ CASC_LOCALES_COUNT

#define CASC_LOCALES_COUNT   17

Definition at line 86 of file vmapexport.cpp.

Function Documentation

◆ BeginModelExtraction()

std::pair< ExtractedModelData *, bool > BeginModelExtraction ( std::string const &  outputName)

Definition at line 192 of file vmapexport.cpp.

+ Here is the caller graph for this function:

◆ ExtractSingleWmo()

ExtractedModelData const * ExtractSingleWmo ( std::string &  fname)

Definition at line 199 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateUniqueObjectId()

uint32 GenerateUniqueObjectId ( uint32  clientId,
uint16  clientDoodadId,
bool  isWmo 
)

Definition at line 181 of file vmapexport.cpp.

+ Here is the caller graph for this function:

◆ GetInstalledLocalesMask()

uint32 GetInstalledLocalesMask ( )

Definition at line 147 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ INIT_CRASH_HANDLER()

INIT_CRASH_HANDLER ( )

◆ IsLiquidIgnored()

bool IsLiquidIgnored ( uint32  liquidTypeId)

Definition at line 313 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 644 of file vmapexport.cpp.

+ Here is the call graph for this function:

◆ OpenCascStorage()

bool OpenCascStorage ( int  locale)

Definition at line 116 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParsMapFiles()

void ParsMapFiles ( )

Definition at line 323 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processArgv()

bool processArgv ( int  argc,
char **  argv,
const char *  versionString 
)

Definition at line 519 of file vmapexport.cpp.

+ Here is the caller graph for this function:

◆ ReadLiquidMaterialTable()

void ReadLiquidMaterialTable ( )

Definition at line 471 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadLiquidTypeTable()

void ReadLiquidTypeTable ( )

Definition at line 495 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadMapTable()

void ReadMapTable ( )

Definition at line 411 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RetardCheck()

static bool RetardCheck ( )
static

Definition at line 612 of file vmapexport.cpp.

+ Here is the caller graph for this function:

◆ TryLoadDB2()

void TryLoadDB2 ( char const *  name,
DB2CascFileSource source,
DB2FileLoader db2,
DB2FileLoadInfo const *  loadInfo 
)

Definition at line 398 of file vmapexport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ CascLocaleNames

char const* CascLocaleNames[CASC_LOCALES_COUNT]
Initial value:
=
{
"none", "enUS",
"koKR", "unknown",
"frFR", "deDE",
"zhCN", "esES",
"zhTW", "enGB",
"enCN", "enTW",
"esMX", "ruRU",
"ptBR", "itIT",
"ptPT"
}

Definition at line 87 of file vmapexport.cpp.

◆ CascProduct

char const* CascProduct = "wow"

Definition at line 76 of file vmapexport.cpp.

◆ CascRegion

char const* CascRegion = "eu"

Definition at line 77 of file vmapexport.cpp.

◆ CascStorage

std::shared_ptr<CASC::Storage> CascStorage

Definition at line 47 of file vmapexport.cpp.

◆ DbcLocale

uint32 DbcLocale = 0

Definition at line 79 of file vmapexport.cpp.

◆ ExtractedModels

std::unordered_map<std::string, ExtractedModelData> ExtractedModels

Definition at line 190 of file vmapexport.cpp.

◆ ExtractedModelsMutex

std::mutex ExtractedModelsMutex
static

Definition at line 189 of file vmapexport.cpp.

◆ input_path

boost::filesystem::path input_path

Definition at line 74 of file vmapexport.cpp.

◆ LiquidMaterials

std::unordered_map<uint32, LiquidMaterialEntry> LiquidMaterials

Definition at line 71 of file vmapexport.cpp.

◆ LiquidTypes

std::unordered_map<uint32, LiquidTypeEntry> LiquidTypes

Definition at line 72 of file vmapexport.cpp.

◆ map_ids

std::vector<MapEntry> map_ids

Definition at line 73 of file vmapexport.cpp.

◆ preciseVectorData

bool preciseVectorData = false

Definition at line 75 of file vmapexport.cpp.

◆ szWorkDirWmo

char const* szWorkDirWmo = "./Buildings"

Definition at line 84 of file vmapexport.cpp.

◆ Threads

uint32 Threads = std::thread::hardware_concurrency()

Definition at line 80 of file vmapexport.cpp.

◆ UniqueObjectIdGenerator

std::atomic<uint32> UniqueObjectIdGenerator = std::numeric_limits<uint32>::max() - 1
static

Definition at line 177 of file vmapexport.cpp.

◆ UniqueObjectIds

std::map<std::pair<uint32, uint16>, uint32> UniqueObjectIds
static

Definition at line 179 of file vmapexport.cpp.

◆ UniqueObjectIdsMutex

std::mutex UniqueObjectIdsMutex
static

Definition at line 178 of file vmapexport.cpp.

◆ UseRemoteCasc

bool UseRemoteCasc = false

Definition at line 78 of file vmapexport.cpp.

◆ WowLocaleToCascLocaleFlags

uint32 WowLocaleToCascLocaleFlags[12]
Initial value:
=
{
CASC_LOCALE_ENUS | CASC_LOCALE_ENGB,
CASC_LOCALE_KOKR,
CASC_LOCALE_FRFR,
CASC_LOCALE_DEDE,
CASC_LOCALE_ZHCN,
CASC_LOCALE_ZHTW,
CASC_LOCALE_ESES,
CASC_LOCALE_ESMX,
CASC_LOCALE_RURU,
0,
CASC_LOCALE_PTBR | CASC_LOCALE_PTPT,
CASC_LOCALE_ITIT,
}

Definition at line 100 of file vmapexport.cpp.