60{
61 printf("Extracting GameObject models...");
62 DBCFile dbc(
"DBFilesClient\\GameObjectDisplayInfo.dbc");
63 if (!dbc.open())
64 {
65 printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format!\n");
66 exit(1);
67 }
68
70 basepath += "/";
71 std::string path;
72
73 std::string modelListPath = basepath + "temp_gameobject_models";
74 FILE*
model_list = fopen(modelListPath.c_str(),
"wb");
76 {
77 printf("Fatal error: Could not open file %s\n", modelListPath.c_str());
78 return;
79 }
80
82
83 for (const auto & it : dbc)
84 {
85 path = it.getString(1);
86
87 if (path.length() < 4)
88 continue;
89
90 fixnamen((
char*)path.c_str(), path.size());
93
95 if (!ch_ext)
96 continue;
97
99
100 bool result = false;
102 if (!strcmp(ch_ext, ".wmo"))
103 {
104 isWmo = 1;
106 }
107 else if (!strcmp(ch_ext, ".mdl"))
108 {
110 continue;
111 }
112 else
113 {
115 }
116
117 if (result)
118 {
119 uint32 displayId = it.getUInt(0);
120 uint32 path_length = strlen(name);
124 fwrite(name,
sizeof(
char), path_length,
model_list);
125 }
126 }
127
129
130 printf("Done!\n");
131}
ModelList model_list
Definition: GameObjectModel.cpp:43
void strToLower(std::string &str)
Definition: Util.cpp:384
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
bool ExtractSingleModel(std::string &fname)
Definition: gameobject_extract.cpp:24
char const * GetPlainName(char const *FileName)
Definition: adtfile.cpp:26
void fixnamen(char *name, std::size_t len)
Definition: adtfile.cpp:44
void fixname2(char *name, std::size_t len)
Definition: adtfile.cpp:62
char * GetExtension(char *FileName)
Definition: adtfile.cpp:72
char const * szWorkDirWmo
Definition: vmapexport.cpp:68
bool ExtractSingleWmo(std::string &fname)
Definition: vmapexport.cpp:98
const char RAW_VMAP_MAGIC[]
Definition: VMapDefinitions.h:26