Warnings Round 2 (mostly Rando) (#5486)

* Handle virtually all warnings in `soh/Enhancements/randomizer`.
Handle order of operations warning in FasterHeavyBlockLift.

* Missed a few.

* Add float-specific versions of some M_PI and M_SQRT defines, and swap them in for the static casts in draw.cpp.

* Swap a static cast for M_PIf in check tracker code.
This commit is contained in:
Malkierian 2025-05-16 21:54:36 -07:00 committed by GitHub
parent 23a5198986
commit e673eaefb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 98 additions and 85 deletions

View file

@ -1892,16 +1892,16 @@ static std::set<std::string> rainbowCVars = {
int hue = 0;
void RainbowTick() {
float freqHue = hue * 2 * M_PI / (360 * CVarGetFloat(CVAR_COSMETIC("RainbowSpeed"), 0.6f));
float freqHue = hue * 2 * M_PIf / (360 * CVarGetFloat(CVAR_COSMETIC("RainbowSpeed"), 0.6f));
for (auto& cvar : rainbowCVars) {
if (CVarGetInteger((cvar + ".Rainbow").c_str(), 0) == 0) {
continue;
}
Color_RGBA8 newColor;
newColor.r = sin(freqHue + 0) * 127 + 128;
newColor.g = sin(freqHue + (2 * M_PI / 3)) * 127 + 128;
newColor.b = sin(freqHue + (4 * M_PI / 3)) * 127 + 128;
newColor.r = static_cast<uint8_t>(sin(freqHue + 0) * 127) + 128;
newColor.g = static_cast<uint8_t>(sin(freqHue + (2 * M_PI / 3)) * 127) + 128;
newColor.b = static_cast<uint8_t>(sin(freqHue + (4 * M_PI / 3)) * 127) + 128;
newColor.a = 255;
CVarSetColor((cvar + ".Value").c_str(), newColor);