mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
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:
parent
05f2bedf88
commit
ba99d505dd
18 changed files with 120 additions and 114 deletions
|
|
@ -227,8 +227,8 @@ void TalentScreen::renderTalentTree(game::GameHandler& gameHandler, uint32_t tab
|
|||
// Find grid dimensions — use int to avoid uint8_t wrap-around infinite loops
|
||||
int maxRow = 0, maxCol = 0;
|
||||
for (const auto* talent : talents) {
|
||||
maxRow = std::max(maxRow, (int)talent->row);
|
||||
maxCol = std::max(maxCol, (int)talent->column);
|
||||
maxRow = std::max(maxRow, static_cast<int>(talent->row));
|
||||
maxCol = std::max(maxCol, static_cast<int>(talent->column));
|
||||
}
|
||||
// Sanity-cap to prevent runaway loops from corrupt/unexpected DBC data
|
||||
maxRow = std::min(maxRow, 15);
|
||||
|
|
@ -239,8 +239,8 @@ void TalentScreen::renderTalentTree(game::GameHandler& gameHandler, uint32_t tab
|
|||
const float iconSize = 40.0f;
|
||||
const float spacing = 8.0f;
|
||||
const float cellSize = iconSize + spacing;
|
||||
const float gridWidth = (float)(maxCol + 1) * cellSize + spacing;
|
||||
const float gridHeight = (float)(maxRow + 1) * cellSize + spacing;
|
||||
const float gridWidth = static_cast<float>(maxCol + 1) * cellSize + spacing;
|
||||
const float gridHeight = static_cast<float>(maxRow + 1) * cellSize + spacing;
|
||||
|
||||
// Points in this tree
|
||||
uint32_t pointsInTree = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue