- WowClientDB.h: WowClientDB_Base, IDatabase<T>, WowClientDB_Common<T> (Load), WowClientDB<T> and WowClientDB_RLE<T> (Spell, ItemDisplayInfo, Light*Band) with OFFSET lists for every 12340 instance; WowClientDB.cpp: base dtor, RLE row codec. - Records are classes (0.5.3 decorations) with out-of-line ctor/dtor/GetFilename/Read in DB/Rec/*.cpp, static s_numColumns/s_rowSize/s_generatedID; ID field m_id. - DBClient.cpp: 239 table globals, StaticDBLoadAll, ClientDBInitialize (6 callees declared, tracked); Startup_Strings in Client.cpp, VideoHardware in Hardware.cpp. - IDB synced (410 names, snapshot Wow.exe.pre_clientdb_20260926.idb). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
100 lines
1.8 KiB
C++
100 lines
1.8 KiB
C++
#include "WoW/Source/DB/WowClientDB.h"
|
|
|
|
// INLINED
|
|
WowClientDB_Base::WowClientDB_Base() {
|
|
this->m_loaded = 0;
|
|
this->m_numRecords = 0;
|
|
this->m_maxID = -1;
|
|
this->m_minID = 0xFFFFFFF;
|
|
this->m_strings = nullptr;
|
|
}
|
|
|
|
// VERIFY: b5021150 manual
|
|
// OFFSET: 0x008C6780
|
|
WowClientDB_Base::~WowClientDB_Base() {
|
|
}
|
|
|
|
// VERIFY: 60c92aa6 auto
|
|
// OFFSET: 0x004CFBB0
|
|
uint8_t* DecompressRow(const uint8_t* src, uint32_t size, uint8_t* dst) {
|
|
uint8_t* end = &dst[size];
|
|
*dst = *src;
|
|
uint8_t* out = dst + 1;
|
|
|
|
for (const uint8_t* p = src + 1; out < end; p++) {
|
|
*out++ = *p;
|
|
|
|
if (*p == p[-1]) {
|
|
int32_t run = p[1];
|
|
|
|
while (run) {
|
|
run--;
|
|
*out++ = *p;
|
|
}
|
|
|
|
p += 2;
|
|
|
|
if (out < end) {
|
|
*out++ = *p;
|
|
}
|
|
}
|
|
}
|
|
|
|
return out;
|
|
}
|
|
|
|
// VERIFY: bbb5632f manual
|
|
// OFFSET: 0x0095D980
|
|
uint32_t CompressRow(const uint8_t* src, uint32_t size, uint8_t* dst) {
|
|
uint8_t* out = dst;
|
|
const uint8_t* end = &src[size];
|
|
|
|
if (dst) {
|
|
*dst = *src;
|
|
out = dst + 1;
|
|
}
|
|
|
|
uint32_t count = 1;
|
|
|
|
for (const uint8_t* p = src + 1; p < end; p++) {
|
|
if (out) {
|
|
*out++ = *p;
|
|
}
|
|
|
|
uint8_t value = *p;
|
|
count++;
|
|
|
|
if (*p == p[-1]) {
|
|
p++;
|
|
|
|
uint32_t run;
|
|
|
|
for (run = 0; p < end; run++) {
|
|
if (*p != value || run >= 0xFF) {
|
|
break;
|
|
}
|
|
|
|
p++;
|
|
}
|
|
|
|
if (out) {
|
|
*out++ = static_cast<uint8_t>(run);
|
|
}
|
|
|
|
count++;
|
|
|
|
if (p == end) {
|
|
return count;
|
|
}
|
|
|
|
if (out) {
|
|
*out++ = *p;
|
|
}
|
|
|
|
count++;
|
|
}
|
|
}
|
|
|
|
return count;
|
|
}
|