10
10
11
11
#include < gc/gx.h>
12
12
#include < ttyd/battle_unit.h>
13
+ #include < ttyd/fontmgr.h>
13
14
#include < ttyd/battle_disp.h>
14
15
#include < ttyd/system.h>
15
16
#include < ttyd/mario.h>
@@ -76,9 +77,12 @@ void displayArtAttackHitboxes()
76
77
return ;
77
78
}
78
79
79
- // Set the color of the lines of the hitbox
80
- uint32_t HitboxLineColor = 0x59000000 ;
81
- gc::gx::GXSetChanMatColor (gc::gx::GX_COLOR0A0, reinterpret_cast <uint8_t *>(&HitboxLineColor));
80
+ // 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
83
+
84
+ // Set up a variable to handle adjusting the hue for the lines of the hitboxes
85
+ uint8_t HueAdjustment = 0 ;
82
86
83
87
// Get the address of the write gather pipe, and handle the value at the address as a float
84
88
volatile float *WriteGatherPipe = reinterpret_cast <float *>(0xCC008000 );
@@ -121,6 +125,16 @@ void displayArtAttackHitboxes()
121
125
continue ;
122
126
}
123
127
128
+ // Adjust the hue for the lines of the current hitbox
129
+ HSV[0 ] += HueAdjustment;
130
+ HueAdjustment += 30 ;
131
+
132
+ // Get the RGB equivalent of the HSV value; Alpha is discarded
133
+ uint32_t HitboxLineColor = ttyd::fontmgr::HSV2RGB (HSV);
134
+
135
+ // Set the color of the lines of the current hitbox
136
+ gc::gx::GXSetChanMatColor (gc::gx::GX_COLOR0A0, reinterpret_cast <uint8_t *>(&HitboxLineColor));
137
+
124
138
uint32_t BattleUnitPtrUint = reinterpret_cast <uint32_t >(BattleUnitPtr);
125
139
126
140
// Check if the current actor is hanging from the ceiling
@@ -139,11 +153,11 @@ void displayArtAttackHitboxes()
139
153
}
140
154
141
155
// Get the variables used to calculate the position of the hitbox
142
- float ActorHitboxWidth = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xE4 );
143
- float ActorHitboxHeight = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xE8 );
144
- float ActorHitboxPosOffsetX = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xD8 );
145
- float ActorHitboxPosOffsetY = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xDC );
146
- float ActorSizeScale = *reinterpret_cast <float *>(BattleUnitPtrUint + 0x114 );
156
+ float ActorHitboxWidth = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xE4 );
157
+ float ActorHitboxHeight = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xE8 );
158
+ float ActorHitboxPosOffsetX = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xD8 );
159
+ float ActorHitboxPosOffsetY = *reinterpret_cast <float *>(BattleUnitPtrUint + 0xDC );
160
+ float ActorSizeScale = *reinterpret_cast <float *>(BattleUnitPtrUint + 0x114 );
147
161
148
162
// Get the position of the current actor
149
163
float ActorPos[3 ];
0 commit comments