85{
87 return false;
88
90 std::string dirname = std::string(
szWorkDirWmo) +
"/dir_bin";
91 FILE* dirfile;
92 dirfile = fopen(dirname.c_str(), "ab");
93 if (!dirfile)
94 {
95 printf("Can't open dirfile!'%s'\n", dirname.c_str());
96 return false;
97 }
98
100 {
101 char fourcc[5];
105 fourcc[4] = 0;
106
108
109 if (!strcmp(fourcc, "MCIN"))
110 {
111 }
112 else if (!strcmp(fourcc, "MTEX"))
113 {
114 }
115 else if (!strcmp(fourcc, "MMDX"))
116 {
117 if (size)
118 {
119 char* buf = new char[size];
121 char* p = buf;
122 while (p < buf + size)
123 {
127
129
130 string path(p);
132
133 p = p + strlen(p) + 1;
134 }
135 delete[] buf;
136 }
137 }
138 else if (!strcmp(fourcc, "MWMO"))
139 {
140 if (size)
141 {
142 char* buf = new char[size];
144 char* p = buf;
145 while (p < buf + size)
146 {
147 std::string path(p);
148
153
155
156 p += strlen(p) + 1;
157 }
158 delete[] buf;
159 }
160 }
161
162 else if (!strcmp(fourcc, "MDDF"))
163 {
164 if (size)
165 {
167 for (
uint32 i = 0; i < doodadCount; ++i)
168 {
172 }
173 }
174 }
175 else if (!strcmp(fourcc, "MODF"))
176 {
177 if (size)
178 {
180 for (
uint32 i = 0; i < mapObjectCount; ++i)
181 {
186 }
187 }
188 }
189
191 }
193 fclose(dirfile);
194 return true;
195}
std::uint32_t uint32
Definition: Define.h:107
bool ExtractSingleModel(std::string &fname)
Definition: gameobject_extract.cpp:24
const char * GetPlainName(const char *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
std::unordered_map< std::string, WMODoodadData > WmoDoodads
Definition: vmapexport.cpp:64
char const * szWorkDirWmo
Definition: vmapexport.cpp:68
bool ExtractSingleWmo(std::string &fname)
Definition: vmapexport.cpp:98
void Extract(ADT::MDDF const &doodadDef, char const *ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: model.cpp:138
void ExtractSet(WMODoodadData const &doodadData, ADT::MODF const &wmo, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: model.cpp:181
void Extract(ADT::MODF const &mapObjDef, char const *WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition: wmo.cpp:509
bool isEof()
Definition: mpq_libmpq04.h:92
void seek(int offset)
Definition: mpq_libmpq.cpp:114
std::size_t read(void *dest, std::size_t bytes)
Definition: mpq_libmpq.cpp:96
std::size_t getPos()
Definition: mpq_libmpq04.h:89
uint32 Id
Definition: adtfile.h:30
uint32 Id
Definition: adtfile.h:40
std::vector< std::string > ModelInstanceNames
Definition: adtfile.h:62
std::vector< std::string > WmoInstanceNames
Definition: adtfile.h:61
void flipcc(char *fcc)
Definition: mpq_libmpq04.h:98