39{
41 if (f.isEof ())
42 {
43 printf("No such file.\n");
44 return false;
45 }
46
48 char fourcc[5];
49
50 while (!f.isEof())
51 {
52 f.read(fourcc, 4);
53 f.read(&size, 4);
54
56 fourcc[4] = 0;
57
58 std::size_t nextpos = f.getPos() + size;
59
60 if (!strcmp(fourcc, "MOHD"))
61 {
74 }
75 else if (!strcmp(fourcc, "MODS"))
76 {
79 }
80 else if (!strcmp(fourcc,"MODN"))
81 {
82 char* ptr = f.getPointer();
83 char* end = ptr + size;
86 while (ptr < end)
87 {
88 std::string path = ptr;
89
93
94 uint32 doodadNameIndex = ptr - f.getPointer();
95 ptr += path.length() + 1;
96
99 }
100 }
101 else if (!strcmp(fourcc,"MODD"))
102 {
105 }
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 f.seek((int)nextpos);
139 }
140 f.close ();
141 return true;
142}
std::uint32_t uint32
Definition Define.h:107
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
Definition mpq_libmpq04.h:74
WMODoodadData DoodadData
Definition wmo.h:88
std::unordered_set< uint32 > ValidDoodadNames
Definition wmo.h:89
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