mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
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:
parent
23a5198986
commit
e673eaefb6
25 changed files with 98 additions and 85 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue