mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +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
|
|
@ -85,7 +85,7 @@ namespace game {
|
|||
|
||||
std::string ExpansionProfile::versionString() const {
|
||||
std::ostringstream ss;
|
||||
ss << (int)majorVersion << "." << (int)minorVersion << "." << (int)patchVersion;
|
||||
ss << static_cast<int>(majorVersion) << "." << static_cast<int>(minorVersion) << "." << static_cast<int>(patchVersion);
|
||||
// Append letter suffix for known builds
|
||||
if (majorVersion == 3 && minorVersion == 3 && patchVersion == 5) ss << "a";
|
||||
else if (majorVersion == 2 && minorVersion == 4 && patchVersion == 3) ss << "";
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ void TransportManager::loadPathFromNodes(uint32_t pathId, const std::vector<glm:
|
|||
// Helper: compute segment duration from distance and speed
|
||||
auto segMsFromDist = [&](float dist) -> uint32_t {
|
||||
if (speed <= 0.0f) return 1000;
|
||||
return (uint32_t)((dist / speed) * 1000.0f);
|
||||
return static_cast<uint32_t>((dist / speed) * 1000.0f);
|
||||
};
|
||||
|
||||
// Single point = stationary (durationMs = 0)
|
||||
|
|
@ -259,7 +259,7 @@ void TransportManager::updateTransportMovement(ActiveTransport& transport, float
|
|||
}
|
||||
|
||||
// Evaluate path time
|
||||
uint32_t nowMs = (uint32_t)(elapsedTime_ * 1000.0f);
|
||||
uint32_t nowMs = static_cast<uint32_t>(elapsedTime_ * 1000.0f);
|
||||
uint32_t pathTimeMs = 0;
|
||||
|
||||
if (transport.hasServerClock) {
|
||||
|
|
@ -403,7 +403,7 @@ glm::vec3 TransportManager::evalTimedCatmullRom(const TransportPath& path, uint3
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
float t = static_cast<float>(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Catmull-Rom spline formula
|
||||
|
|
@ -480,7 +480,7 @@ glm::quat TransportManager::orientationFromTangent(const TransportPath& path, ui
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
float t = static_cast<float>(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Tangent of Catmull-Rom spline (derivative)
|
||||
|
|
|
|||
|
|
@ -949,7 +949,7 @@ bool WardenMemory::searchCodePattern(const uint8_t seed[4], const uint8_t expect
|
|||
|
||||
auto bruteStart = std::chrono::steady_clock::now();
|
||||
LOG_WARNING("WardenMemory: Brute-force searching ", ranges.size(), " section(s), hint=0x",
|
||||
std::hex, hintOffset, std::dec, " patLen=", (int)patternLen);
|
||||
std::hex, hintOffset, std::dec, " patLen=", static_cast<int>(patternLen));
|
||||
|
||||
size_t totalPositions = 0;
|
||||
for (const auto& r : ranges) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue