Skip to content

Commit c87989b

Browse files
committed
Fix the parameter for HSV2RGB
1 parent 84b6a4c commit c87989b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ttyd-tools/rel/include/ttyd/fontmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ uint16_t FontGetMessageWidth(const char *message);
3838
uint16_t hankakuSearch(uint8_t code);
3939
uint16_t kanjiSearch(uint16_t code);
4040
uint8_t kanjiGetWidth(uint16_t code);
41-
uint32_t HSV2RGB(uint8_t hsv[3]);
41+
uint32_t HSV2RGB(uint8_t hsva[4]);
4242

4343
void JUTFontSetup(uint32_t index);
4444
uint16_t JUTFont_CodeToGlyph(uint16_t code);

ttyd-tools/rel/source/codes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void displayArtAttackHitboxes()
7878
}
7979

8080
// Set the initial color to use for the lines of the hitboxes
81-
uint8_t HSV[4]; // Extra slot at the end
82-
*reinterpret_cast<uint32_t *>(&HSV) = 0x00FFCCFF; // RGBA value is 0xCC0000FF
81+
uint8_t HSVA[4];
82+
*reinterpret_cast<uint32_t *>(&HSVA) = 0x00FFCCFF; // RGBA value is 0xCC0000FF
8383

8484
// Get the address of the write gather pipe, and handle the value at the address as a float
8585
volatile float *WriteGatherPipe = reinterpret_cast<float *>(0xCC008000);
@@ -122,8 +122,8 @@ void displayArtAttackHitboxes()
122122
continue;
123123
}
124124

125-
// Get the RGB equivalent of the HSV value; Alpha is discarded
126-
uint32_t HitboxLineColor = ttyd::fontmgr::HSV2RGB(HSV);
125+
// Get the RGBA equivalent of the HSVA value
126+
uint32_t HitboxLineColor = ttyd::fontmgr::HSV2RGB(HSVA);
127127

128128
// Set the color of the lines of the current hitbox
129129
gc::gx::GXSetChanMatColor(gc::gx::GX_COLOR0A0, reinterpret_cast<uint8_t *>(&HitboxLineColor));
@@ -240,7 +240,7 @@ void displayArtAttackHitboxes()
240240
}
241241

242242
// Adjust the hue for the lines of the next hitbox
243-
HSV[0] += 45;
243+
HSVA[0] += 45;
244244
}
245245
}
246246
}

0 commit comments

Comments
 (0)