178{
179
180
181
182
183
184
185
186
187
188
189
190 typedef char* ptr;
192 {
193 return nullptr;
194 }
195
196
199
200 if (i >= 0)
201 {
203
205 {
207 if (ind > maxi)
208 {
209 maxi = ind;
210 }
211 }
212
213 ++maxi;
214 records = maxi;
215 indexTable = new ptr[maxi];
216 memset(indexTable, 0, maxi * sizeof(ptr));
217 }
218 else
219 {
222 }
223
224 char* dataTable =
new char[
recordCount * recordsize];
225
227
229 {
230 if (i >= 0)
231 {
233 }
234 else
235 {
236 indexTable[y] = &dataTable[offset];
237 }
238
240 {
241 switch (format[x])
242 {
245 offset += sizeof(float);
246 break;
251 break;
254 offset +=
sizeof(
uint8);
255 break;
257 *((char**)(&dataTable[offset])) = nullptr;
258 offset += sizeof(char*);
259 break;
261 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.");
262 break;
266 break;
267 default:
268 ASSERT(
false &&
"Unknown field format character in DBCfmt.h");
269 break;
270 }
271 }
272 }
273
274 return dataTable;
275}
@ 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
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
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=nullptr)
Definition: DBCFileLoader.cpp:129
Record getRecord(std::size_t id)
Definition: DBCFileLoader.cpp:123
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