Skip to content

Commit

Permalink
snake_case_is_awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcryostat committed Apr 25, 2024
1 parent 4623721 commit e8c23ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using namespace geode::prelude;

class $modify(PlayerObject) {
void flashPlayer(float p0, float p1, cocos2d::ccColor3B mainColor, cocos2d::ccColor3B secondColor) {}
void flashPlayer(float p0, float p1, cocos2d::ccColor3B mainColor, cocos2d::ccColor3B secondColor) {}
};

class $modify(PlayLayer) {
Expand All @@ -26,9 +26,9 @@ class $modify(PlayLayer) {
RainbowTrail::g += speed / 10;
}

_ccColor3B rainbowColor = RainbowTrail::getRainbow(0, saturation);
_ccColor3B rainbowColor2 = RainbowTrail::getRainbow(180, saturation);
_ccColor3B rainbowColor3 = RainbowTrail::getRainbow(90, saturation);
_ccColor3B rainbowColor = RainbowTrail::get_rainbow(0, saturation);
_ccColor3B rainbowColor2 = RainbowTrail::get_rainbow(180, saturation);
_ccColor3B rainbowColor3 = RainbowTrail::get_rainbow(90, saturation);
bool enable = Mod::get()->getSettingValue<bool>("enable");
bool noRegularTrail = Mod::get()->getSettingValue<bool>("no-reg-trail");

Expand All @@ -50,4 +50,4 @@ class $modify(PlayLayer) {
}
}
}
};
};
8 changes: 4 additions & 4 deletions src/rainbow_trail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <cmath>

void RainbowTrail::HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) {
void RainbowTrail::hsv_to_rgb(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));
Expand Down Expand Up @@ -54,19 +54,19 @@ void RainbowTrail::HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, f

float RainbowTrail::g = 0;

cocos2d::_ccColor3B RainbowTrail::getRainbow(float offset, float saturation) {
cocos2d::_ccColor3B RainbowTrail::get_rainbow(float offset, float saturation) {
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);
hsv_to_rgb(R, G, B, hue, sat, vc);

cocos2d::_ccColor3B out;
out.r = R * 255;
out.g = G * 255;
out.b = B * 255;
return out;
}
}
4 changes: 2 additions & 2 deletions src/rainbow_trail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class RainbowTrail {
public:
static void HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV);
static cocos2d::_ccColor3B getRainbow(float offset, float saturation);
static void hsv_to_rgb(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV);
static cocos2d::_ccColor3B get_rainbow(float offset, float saturation);
static float g;
};

0 comments on commit e8c23ad

Please sign in to comment.