177{
178
179
180
181
182
183
184
185
186
187
188
189 typedef char* ptr;
191 {
192 return nullptr;
193 }
194
195
198
199 if (i >= 0)
200 {
202
204 {
206 if (ind > maxi)
207 {
208 maxi = ind;
209 }
210 }
211
212 ++maxi;
213 records = maxi;
214 indexTable = new ptr[maxi];
215 memset(indexTable, 0, maxi * sizeof(ptr));
216 }
217 else
218 {
221 }
222
223 char* dataTable =
new char[
recordCount * recordsize];
224
226
228 {
229 if (i >= 0)
230 {
232 }
233 else
234 {
235 indexTable[y] = &dataTable[offset];
236 }
237
239 {
240 switch (format[x])
241 {
244 offset += sizeof(float);
245 break;
250 break;
253 offset +=
sizeof(
uint8);
254 break;
256 *((char**)(&dataTable[offset])) = nullptr;
257 offset += sizeof(char*);
258 break;
260 ASSERT(
false &&
"Attempted to load DBC files that do not have field types that match what is in the core. Check DBCfmt.h or your DBC files.");
261 break;
265 break;
266 default:
267 ASSERT(
false &&
"Unknown field format character in DBCfmt.h");
268 break;
269 }
270 }
271 }
272
273 return dataTable;
274}
std::int32_t int32
Definition: Define.h:103
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
#define ASSERT
Definition: Errors.h:68
@ FT_IND
Definition: DBCFileLoader.h:34
@ FT_NA
Definition: DBCFileLoader.h:27
@ FT_FLOAT
Definition: DBCFileLoader.h:30
@ FT_STRING
Definition: DBCFileLoader.h:29
@ FT_SORT
Definition: DBCFileLoader.h:33
@ FT_NA_BYTE
Definition: DBCFileLoader.h:28
@ FT_INT
Definition: DBCFileLoader.h:31
@ FT_LOGIC
Definition: DBCFileLoader.h:35
@ FT_BYTE
Definition: DBCFileLoader.h:32
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=nullptr)
Definition: DBCFileLoader.cpp:128
Record getRecord(std::size_t id)
Definition: DBCFileLoader.cpp:122
float getFloat(std::size_t field) const
Definition: DBCFileLoader.h:49
uint32 getUInt(std::size_t field) const
Definition: DBCFileLoader.h:57
uint8 getUInt8(std::size_t field) const
Definition: DBCFileLoader.h:65