refactor: replace C-style casts with static_cast and extract toLowerInPlace

Replace ~300 C-style casts ((int), (float), (uint32_t), etc.) with
static_cast across 15 source files. Extract toLowerInPlace() helper in
lua_engine.cpp to replace 72 identical tolower loop patterns.
This commit is contained in:
Kelsi 2026-03-25 11:40:49 -07:00
parent d646a0451d
commit 05f2bedf88
15 changed files with 385 additions and 381 deletions

View file

@ -253,7 +253,7 @@ void BLPLoader::decompressDXT3(const uint8_t* src, uint8_t* dst, int width, int
// First 8 bytes: 4-bit alpha values
uint64_t alphaBlock = 0;
for (int i = 0; i < 8; i++) {
alphaBlock |= (uint64_t)block[i] << (i * 8);
alphaBlock |= static_cast<uint64_t>(block[i]) << (i * 8);
}
// Color block (same as DXT1) starts at byte 8
@ -336,7 +336,7 @@ void BLPLoader::decompressDXT5(const uint8_t* src, uint8_t* dst, int width, int
// Alpha indices (48 bits for 16 pixels, 3 bits each)
uint64_t alphaIndices = 0;
for (int i = 2; i < 8; i++) {
alphaIndices |= (uint64_t)block[i] << ((i - 2) * 8);
alphaIndices |= static_cast<uint64_t>(block[i]) << ((i - 2) * 8);
}
// Color block (same as DXT1) starts at byte 8