From 8989efd97b248f0cc16c1e605a63e48192b9ee27 Mon Sep 17 00:00:00 2001 From: "dabewodactowluwu@gmail.com" Date: Wed, 10 Apr 2024 10:59:11 -0500 Subject: [PATCH] owo --- CMakeLists.txt | 2 + src/main.cpp | 172 ++++++++++++++++++++++++++----------------------- 2 files changed, 95 insertions(+), 79 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 553cb9b..f957898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_OSX_ARCHITECTURES "x86_64") set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_CXX_COMPILER_LAUNCHER "sccache") +set(CMAKE_C_COMPILER_LAUNCHER "sccache") project(gay-wave-trail VERSION 1.0.0) diff --git a/src/main.cpp b/src/main.cpp index 2308963..9871e84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,108 +1,122 @@ #include -#include -#include #include #include #include +#include +#include using namespace geode::prelude; // thanks to shadowforce78 -void HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) { - float fC = fV * fS; // Chroma - float fHPrime = fmod(fH / 60.0, 6); - float fX = fC * (1 - fabs(fmod(fHPrime, 2) - 1)); - float fM = fV - fC; +void HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, float &fH, + float &fS, float &fV) { + float fC = fV * fS; // Chroma + float fHPrime = fmod(fH / 60.0, 6); + float fX = fC * (1 - fabs(fmod(fHPrime, 2) - 1)); + float fM = fV - fC; - if (0 <= fHPrime && fHPrime < 1) { - fR = fC; - fG = fX; - fB = 0; - } else if (1 <= fHPrime && fHPrime < 2) { - fR = fX; - fG = fC; - fB = 0; - } else if (2 <= fHPrime && fHPrime < 3) { - fR = 0; - fG = fC; - fB = fX; - } else if (3 <= fHPrime && fHPrime < 4) { - fR = 0; - fG = fX; - fB = fC; - } else if (4 <= fHPrime && fHPrime < 5) { - fR = fX; - fG = 0; - fB = fC; - } else if (5 <= fHPrime && fHPrime < 6) { - fR = fC; - fG = 0; - fB = fX; - } else { - fR = 0; - fG = 0; - fB = 0; - } + if (0 <= fHPrime && fHPrime < 1) { + fR = fC; + fG = fX; + fB = 0; + } else if (1 <= fHPrime && fHPrime < 2) { + fR = fX; + fG = fC; + fB = 0; + } else if (2 <= fHPrime && fHPrime < 3) { + fR = 0; + fG = fC; + fB = fX; + } else if (3 <= fHPrime && fHPrime < 4) { + fR = 0; + fG = fX; + fB = fC; + } else if (4 <= fHPrime && fHPrime < 5) { + fR = fX; + fG = 0; + fB = fC; + } else if (5 <= fHPrime && fHPrime < 6) { + fR = fC; + fG = 0; + fB = fX; + } else { + fR = 0; + fG = 0; + fB = 0; + } - fR += fM; - fG += fM; - fB += fM; + fR += fM; + fG += fM; + fB += fM; } // thanks to shadowforce78 float g = 0; cocos2d::_ccColor3B getRainbow(float offset, float saturation) { - float R; - float G; - float B; + float R; + float G; + float B; - float hue = fmod(g + offset, 360); - float sat = saturation / 100.0; - float vc = 1; - HSVtoRGBbutDifferentIGuess(R, G, B, hue, sat, vc); + float hue = fmod(g + offset, 360); + float sat = saturation / 100.0; + float vc = 1; + HSVtoRGBbutDifferentIGuess(R, G, B, hue, sat, vc); - cocos2d::_ccColor3B out; - out.r = R * 255; - out.g = G * 255; - out.b = B * 255; - return out; + cocos2d::_ccColor3B out; + out.r = R * 255; + out.g = G * 255; + out.b = B * 255; + return out; } // thanks to shadowforce78 -class $modify(PlayerObject) { - void flashPlayer(float p0, float p1, cocos2d::ccColor3B mainColor, cocos2d::ccColor3B secondColor){ - // neutralised kappa - } +class hook73Dummy; +template struct hook73 {}; +namespace { +struct hook73Parent {}; +} // namespace +template <> +struct hook73 + : geode ::Modify, PlayerObject> { + void flashPlayer(float p0, float p1, cocos2d::ccColor3B mainColor, + cocos2d::ccColor3B secondColor) { + // neutralised kappa + } }; -class $modify(PlayLayer) { - void postUpdate(float p0) { - float speed = Mod::get()->getSettingValue("speed"); - float saturation = Mod::get()->getSettingValue("saturation"); - - if (g >= 360) { - g = 0; - } else { - g += speed / 10; - } +class hook79Dummy; +template struct hook79 {}; +namespace { +struct hook79Parent {}; +} // namespace +template <> +struct hook79 : geode ::Modify, PlayLayer> { + PlayLayer::postUpdate(p0); + void postUpdate(float p0) { + float speed = Mod::get()->getSettingValue("speed"); + float saturation = Mod::get()->getSettingValue("saturation"); + + if (g >= 360) { + g = 0; + } else { + g += speed / 10; + } - auto rainbowColor = getRainbow(0, saturation); - auto rainbowColor2 = getRainbow(180, saturation); - auto rainbowColor3 = getRainbow(90, saturation); - - bool enable = Mod::get()->getSettingValue("enable"); + auto rainbowColor = getRainbow(0, saturation); + auto rainbowColor2 = getRainbow(180, saturation); + auto rainbowColor3 = getRainbow(90, saturation); - if (enable == true) { - if (m_player1->m_waveTrail) { - m_player1->m_waveTrail->setColor(rainbowColor); - } + bool enable = Mod::get()->getSettingValue("enable"); - if (m_player2->m_waveTrail) { - m_player2->m_waveTrail->setColor(rainbowColor2); - } - } + if (enable == true) { + if (m_player1->m_waveTrail) { + m_player1->m_waveTrail->setColor(rainbowColor); + } - PlayLayer::postUpdate(p0); + if (m_player2->m_waveTrail) { + m_player2->m_waveTrail->setColor(rainbowColor2); + } } + } };