Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
HylianFreddy committed Dec 30, 2023
1 parent 637bada commit 4ba7383
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions code/src/colors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "colors.h"
#include "common.h"

// This function is taken from OoTR: https://github.com/OoTRandomizer/OoT-Randomizer/blob/1827fbb8089d3fe3e816a297a5f3ce2c99a6e0c5/ASM/c/rainbow.c
// This function is taken from OoTR:
// https://github.com/OoTRandomizer/OoT-Randomizer/blob/1827fbb8089d3fe3e816a297a5f3ce2c99a6e0c5/ASM/c/rainbow.c
Color_RGBA8 Colors_GetRainbowColor(u32 curFrame, u32 stepFrames) {
static Color_RGBA8 cycleColors[] = {
{ 0xE0, 0x10, 0x10, 0x00 }, // red
Expand Down Expand Up @@ -35,7 +36,7 @@ Color_RGBA8 Colors_GetRainbowColor(u32 curFrame, u32 stepFrames) {

void Colors_ChangeRainbowColorRGBA8(Color_RGBA8* color, u32 stepFrames, u8 stepOffset) {
Color_RGBA8 newColor = Colors_GetRainbowColor(rGameplayFrames + stepOffset * stepFrames, stepFrames);
color->r = newColor.r;
color->g = newColor.g;
color->b = newColor.b;
color->r = newColor.r;
color->g = newColor.g;
color->b = newColor.b;
}
8 changes: 4 additions & 4 deletions code/src/fairy.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ void Fairy_ApplyColorToTargetCMAB(void* cmab, Color_RGBA8 color8) {
void Fairy_UpdateRainbowNaviColors(EnElf* navi) {
if (Fairy_IsNaviInnerRainbowForActorType(lastTargetActorType)) {
Color_RGBA8 newColor = Colors_GetRainbowColor(rGameplayFrames, NAVI_CYCLE_FRAMES_INNER);
staticRainbowColor = newColor;
staticRainbowColor = newColor;
// Navi color components go up to 255.0f instead of 1.0f
navi->innerColor.r = newColor.r / 1.0f;
navi->innerColor.g = newColor.g / 1.0f;
navi->innerColor.b = newColor.b / 1.0f;
}
if (Fairy_IsNaviOuterRainbowForActorType(lastTargetActorType)) {
Color_RGBA8 newColor = Colors_GetRainbowColor(rGameplayFrames, NAVI_CYCLE_FRAMES_OUTER);
navi->outerColor.r = newColor.r / 1.0f;
navi->outerColor.g = newColor.g / 1.0f;
navi->outerColor.b = newColor.b / 1.0f;
navi->outerColor.r = newColor.r / 1.0f;
navi->outerColor.g = newColor.g / 1.0f;
navi->outerColor.b = newColor.b / 1.0f;
}

// Handle target pointer color
Expand Down

0 comments on commit 4ba7383

Please sign in to comment.