refactor: remaining C-style casts, color constants, and header guard cleanup

Replace ~37 remaining C-style casts with static_cast across 16 files.
Extract named color constants (kColorRed/Green/Yellow/Gray) and dialog
window flags (kDialogFlags) in game_screen.cpp, replacing 72 inline
literals. Normalize keybinding_manager.hpp to #pragma once.
This commit is contained in:
Kelsi 2026-03-25 11:57:22 -07:00
parent 05f2bedf88
commit ba99d505dd
18 changed files with 120 additions and 114 deletions

View file

@ -119,7 +119,7 @@ void AssetManager::shutdown() {
if (fileCacheHits + fileCacheMisses > 0) {
float hitRate = static_cast<float>(fileCacheHits) / (fileCacheHits + fileCacheMisses) * 100.0f;
LOG_INFO("File cache stats: ", fileCacheHits, " hits, ", fileCacheMisses, " misses (",
(int)hitRate, "% hit rate), ", fileCacheTotalBytes / 1024 / 1024, " MB cached");
static_cast<int>(hitRate), "% hit rate), ", fileCacheTotalBytes / 1024 / 1024, " MB cached");
}
clearCache();

View file

@ -126,8 +126,8 @@ BLPImage BLPLoader::loadBLP2(const uint8_t* data, size_t size) {
LOG_DEBUG("Loading BLP2: ", image.width, "x", image.height, " ",
getCompressionName(image.compression),
" (comp=", (int)header.compression, " alphaDepth=", (int)header.alphaDepth,
" alphaEnc=", (int)header.alphaEncoding, " mipOfs=", header.mipOffsets[0],
" (comp=", static_cast<int>(header.compression), " alphaDepth=", static_cast<int>(header.alphaDepth),
" alphaEnc=", static_cast<int>(header.alphaEncoding), " mipOfs=", header.mipOffsets[0],
" mipSize=", header.mipSizes[0], ")");
// Get first mipmap (full resolution)

View file

@ -578,7 +578,7 @@ bool WMOLoader::loadGroup(const std::vector<uint8_t>& groupData,
if (batchLogCount < 15) {
core::Logger::getInstance().debug(" Batch[", i, "]: start=", batch.startIndex,
" count=", batch.indexCount, " verts=[", batch.startVertex, "-",
batch.lastVertex, "] mat=", (int)batch.materialId, " flags=", (int)batch.flags);
batch.lastVertex, "] mat=", static_cast<int>(batch.materialId), " flags=", static_cast<int>(batch.flags));
batchLogCount++;
}
}