mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Update rainbow hue with deltatime in SohImGuiImpl.cpp instead
This commit is contained in:
parent
d8661c4259
commit
9dbd89c557
2 changed files with 10 additions and 4 deletions
|
@ -828,6 +828,15 @@ namespace SohImGui {
|
|||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
if ((CVar_GetS32("gTunic_KokiriRainbow", 0) | CVar_GetS32("gTunic_GoronRainbow", 0) |CVar_GetS32("gTunic_ZoraRainbow", 0)) != 0) {
|
||||
const f32 deltaTime = 1.0f / ImGui::GetIO().Framerate;
|
||||
f32 hue = CVar_GetFloat("gTunic_RainbowHue", 0.0f);
|
||||
f32 newHue = hue + CVar_GetS32("gTunic_RainbowSpeed", 1) * 36.0f * deltaTime;
|
||||
if (newHue >= 360)
|
||||
newHue = 0;
|
||||
CVar_SetFloat("gTunic_RainbowHue", newHue);
|
||||
}
|
||||
|
||||
console->Draw();
|
||||
|
||||
for (auto& windowIter : customWindows) {
|
||||
|
|
|
@ -749,10 +749,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
|||
if (tunic == PLAYER_TUNIC_KOKIRI && CVar_GetS32("gTunic_KokiriRainbow", 0) != 0 ||
|
||||
tunic == PLAYER_TUNIC_GORON && CVar_GetS32("gTunic_GoronRainbow", 0) != 0 ||
|
||||
tunic == PLAYER_TUNIC_ZORA && CVar_GetS32("gTunic_ZoraRainbow", 0) != 0) {
|
||||
u16 hue = CVar_GetS32("gTunic_RainbowHue", 0);
|
||||
u16 hueDelta = CVar_GetS32("gTunic_RainbowSpeed", 1) * 36.0f / 20.0f;
|
||||
CVar_SetS32("gTunic_RainbowHue", (hue + hueDelta) % 360);
|
||||
|
||||
f32 hue = CVar_GetFloat("gTunic_RainbowHue", 0);
|
||||
u8 i = hue / 60 + 1;
|
||||
u8 a = (-hue / 60.0f + i) * 255;
|
||||
u8 b = (hue / 60.0f + (1 - i)) * 255;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue