AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
adtfile.h File Reference
#include "model.h"
#include "mpq_libmpq04.h"
#include "wmo.h"

Go to the source code of this file.

Classes

struct  ADT::MDDF
 
struct  ADT::MODF
 
class  ADTFile
 

Namespaces

namespace  ADT
 

Functions

const char * GetPlainName (const char *FileName)
 
char * GetPlainName (char *FileName)
 
char * GetExtension (char *FileName)
 
void fixnamen (char *name, size_t len)
 
void fixname2 (char *name, size_t len)
 

Function Documentation

◆ fixname2()

void fixname2 ( char *  name,
size_t  len 
)
64{
65 if (len < 3)
66 return;
67
68 for (size_t i = 0; i < len - 3; i++)
69 if (name[i] == ' ')
70 name[i] = '_';
71}

Referenced by ExtractGameobjectModels(), Doodad::ExtractSet(), ExtractSingleModel(), ExtractSingleWmo(), ADTFile::init(), WDTFile::init(), and WMORoot::open().

◆ fixnamen()

void fixnamen ( char *  name,
size_t  len 
)
46{
47 if (len < 3)
48 return;
49
50 for (size_t i = 0; i < len - 3; i++)
51 {
52 if (i > 0 && name[i] >= 'A' && name[i] <= 'Z' && isalpha(name[i - 1]))
53 name[i] |= 0x20;
54 else if ((i == 0 || !isalpha(name[i - 1])) && name[i] >= 'a' && name[i] <= 'z')
55 name[i] &= ~0x20;
56 }
57
58 //extension in lowercase
59 for (size_t i = len - 3; i < len; i++)
60 name[i] |= 0x20;
61}

Referenced by ExtractGameobjectModels(), Doodad::ExtractSet(), ExtractSingleModel(), ExtractSingleWmo(), ADTFile::init(), WDTFile::init(), and WMORoot::open().

◆ GetExtension()

char * GetExtension ( char *  FileName)
74{
75 if (char* szTemp = strrchr(FileName, '.'))
76 return szTemp;
77 return nullptr;
78}

Referenced by ExtractGameobjectModels().

◆ GetPlainName() [1/2]

char * GetPlainName ( char *  FileName)
37{
38 char* szTemp;
39
40 if ((szTemp = strrchr(FileName, '\\')) != nullptr)
41 FileName = szTemp + 1;
42 return FileName;
43}

◆ GetPlainName() [2/2]

const char * GetPlainName ( const char *  FileName)
28{
29 const char* szTemp;
30
31 if ((szTemp = strrchr(FileName, '\\')) != nullptr)
32 FileName = szTemp + 1;
33 return FileName;
34}

Referenced by ExtractGameobjectModels(), Doodad::ExtractSet(), ExtractSingleModel(), ExtractSingleWmo(), ADTFile::init(), and WMORoot::open().