40{
42 if (f.isEof ())
43 {
44 printf("No such file.\n");
45 return false;
46 }
47
49 char fourcc[5];
50
51 while (!f.isEof())
52 {
53 f.read(fourcc, 4);
54 f.read(&size, 4);
55
57 fourcc[4] = 0;
58
59 std::size_t nextpos = f.getPos() + size;
60
61 if (!strcmp(fourcc, "MOHD"))
62 {
75 }
76 else if (!strcmp(fourcc, "MODS"))
77 {
80 }
81 else if (!strcmp(fourcc,"MODN"))
82 {
83 char* ptr = f.getPointer();
84 char* end = ptr + size;
87 while (ptr < end)
88 {
89 std::string path = ptr;
90
94
95 uint32 doodadNameIndex = ptr - f.getPointer();
96 ptr += path.length() + 1;
97
100 }
101 }
102 else if (!strcmp(fourcc,"MODD"))
103 {
106 }
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139 f.seek((int)nextpos);
140 }
141 f.close ();
142 return true;
143}
char const * GetPlainName(char const *FileName)
Definition: adtfile.cpp:27
void fixnamen(char *name, std::size_t len)
Definition: adtfile.cpp:45
void fixname2(char *name, std::size_t len)
Definition: adtfile.cpp:63
bool ExtractSingleModel(std::string &fname)
Definition: gameobject_extract.cpp:25
std::uint32_t uint32
Definition: Define.h:107
Definition: mpq_libmpq04.h:75
std::vector< WMO::MODS > Sets
Definition: wmo.h:72
std::vector< WMO::MODD > Spawns
Definition: wmo.h:74
std::unique_ptr< char[]> Paths
Definition: wmo.h:73
WMODoodadData DoodadData
Definition: wmo.h:88
std::unordered_set< uint32 > ValidDoodadNames
Definition: wmo.h:89
void flipcc(char *fcc)
Definition: mpq_libmpq04.h:99