From c31844c54e0985903d3890517a79facaef3644fa Mon Sep 17 00:00:00 2001 From: "dabewodactowluwu@gmail.com" Date: Mon, 1 Apr 2024 16:38:07 -0500 Subject: [PATCH] please say this fixed qolmod incompatibility --- CMakeLists.txt | 1 - mod.json | 11 ++------ src/Utils.hpp | 30 -------------------- src/main.cpp | 77 ++++++++++++++++++++++---------------------------- 4 files changed, 35 insertions(+), 84 deletions(-) delete mode 100644 src/Utils.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ea0f2f6..553cb9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ project(gay-wave-trail VERSION 1.0.0) add_library(${PROJECT_NAME} SHARED src/main.cpp - # Add your cpp files here ) if (NOT DEFINED ENV{GEODE_SDK}) diff --git a/mod.json b/mod.json index 10fdc9d..dfd8864 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "2.0.0-beta.22", + "geode": "2.0.0-beta.23", "gd": { "win": "2.204", "mac": "2.200", @@ -40,12 +40,5 @@ "description": "The larger the number, the better" } }, - "repository": "https://github.com/TheBearodactyl/gay-wave-trail", - "incompatibilities": [ - { - "id": "TheSillyDoggo.Cheats", - "importance": "breaking", - "version": "*" - } - ] + "repository": "https://github.com/TheBearodactyl/gay-wave-trail" } diff --git a/src/Utils.hpp b/src/Utils.hpp deleted file mode 100644 index fcd2f1c..0000000 --- a/src/Utils.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -class Utils { - public: - static std::string getNodeName(cocos2d::CCObject* node) { - #ifdef GEODE_IS_WINDOWS - return typeid(*node).name() + 6; - #else - { - std::string ret; - - int status = 0; - auto demangle = abi::__cxa_demangle(typeid(*node).name(), 0, 0, &status); - if (status == 0) { - ret = demangle; - } - free(demangle); - - return ret; - } - #endif - } - static std::string setPrecision(float value, int streamsize) { - std::ostringstream oss; - oss << std::fixed << std::setprecision(streamsize) << value; - return oss.str(); - } - - -}; diff --git a/src/main.cpp b/src/main.cpp index 866bbd4..7dd3060 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,55 +1,44 @@ #include #include #include +#include +#include +#include using namespace geode::prelude; // thanks to shadowforce78 -void HSVtoRGB(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) -{ +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) - { + if (0 <= fHPrime && fHPrime < 1) { fR = fC; fG = fX; fB = 0; - } - else if (1 <= fHPrime && fHPrime < 2) - { + } else if (1 <= fHPrime && fHPrime < 2) { fR = fX; fG = fC; fB = 0; - } - else if (2 <= fHPrime && fHPrime < 3) - { + } else if (2 <= fHPrime && fHPrime < 3) { fR = 0; fG = fC; fB = fX; - } - else if (3 <= fHPrime && fHPrime < 4) - { + } else if (3 <= fHPrime && fHPrime < 4) { fR = 0; fG = fX; fB = fC; - } - else if (4 <= fHPrime && fHPrime < 5) - { + } else if (4 <= fHPrime && fHPrime < 5) { fR = fX; fG = 0; fB = fC; - } - else if (5 <= fHPrime && fHPrime < 6) - { + } else if (5 <= fHPrime && fHPrime < 6) { fR = fC; fG = 0; fB = fX; - } - else - { + } else { fR = 0; fG = 0; fB = 0; @@ -62,8 +51,8 @@ void HSVtoRGB(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) // thanks to shadowforce78 float g = 0; -cocos2d::_ccColor3B getRainbow(float offset, float saturation) -{ + +cocos2d::_ccColor3B getRainbow(float offset, float saturation) { float R; float G; float B; @@ -71,7 +60,7 @@ cocos2d::_ccColor3B getRainbow(float offset, float saturation) float hue = fmod(g + offset, 360); float sat = saturation / 100.0; float vc = 1; - HSVtoRGB(R, G, B, hue, sat, vc); + HSVtoRGBbutDifferentIGuess(R, G, B, hue, sat, vc); cocos2d::_ccColor3B out; out.r = R * 255; @@ -90,30 +79,30 @@ class $modify(PlayerObject) { class $modify(PlayLayer) { void postUpdate(float p0) { float speed = Mod::get()->getSettingValue("speed"); - float saturation = Mod::get() -> getSettingValue("saturation"); + 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"); - - if (enable == true) { - if (m_player1->m_waveTrail) { - m_player1->m_waveTrail->setColor(rainbowColor); + g = 0; + } else { + g += speed / 10; } - if (m_player2->m_waveTrail) { - m_player2->m_waveTrail->setColor(rainbowColor2); + auto rainbowColor = getRainbow(0, saturation); + auto rainbowColor2 = getRainbow(180, saturation); + auto rainbowColor3 = getRainbow(90, saturation); + + bool enable = Mod::get()->getSettingValue("enable"); + + if (enable == true) { + if (m_player1->m_waveTrail) { + m_player1->m_waveTrail->setColor(rainbowColor); + } + + if (m_player2->m_waveTrail) { + m_player2->m_waveTrail->setColor(rainbowColor2); + } } - } - PlayLayer::postUpdate(p0); - + PlayLayer::postUpdate(p0); } };