@@ -158,75 +158,77 @@ void displayArtAttackHitboxes()
158
158
float DrawHitboxAdjustPosX = (ActorHitboxWidth * ActorSizeScale) * 0.5 ;
159
159
float DrawHitboxAdjustPosY = (ActorHitboxHeight * ActorSizeScale) * 0.5 ;
160
160
161
- // Set up 2 sets of points; One for the start of a line and one for the end of a line
162
- float ScreenPoint1[3 ];
163
- float ScreenPoint2[3 ];
161
+ // Set up a set of points, used to get the starts and ends of lines
162
+ float ScreenPoint[3 ];
163
+
164
+ // Set the Z coordinate for all calculated points, as it will not change
165
+ ScreenPoint[2 ] = ActorPos[2 ];
164
166
165
- // Set the Z coordinate for both screen points, as it will not change
166
- ScreenPoint1[ 2 ] = ActorPos[ 2 ];
167
- ScreenPoint2[ 2 ] = ActorPos[ 2 ];
167
+ // Set up 2 sets of points; One for the start of a line and one for the end of a line
168
+ float ScreenPointOut1[ 3 ];
169
+ float ScreenPointOut2[ 3 ];
168
170
169
171
// Draw the 4 lines that show the hitbox
170
172
for (uint32_t i = 0 ; i < 4 ; i++)
171
173
{
172
174
if (i == 0 )
173
175
{
174
176
// Get the top-left corner of the hitbox
175
- ScreenPoint1 [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
176
- ScreenPoint1 [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
177
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint1, ScreenPoint1 );
177
+ ScreenPoint [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
178
+ ScreenPoint [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
179
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut1 );
178
180
179
181
// Get the top-right corner of the hitbox
180
- ScreenPoint2 [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
181
- ScreenPoint2 [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
182
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint2, ScreenPoint2 );
182
+ ScreenPoint [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
183
+ ScreenPoint [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
184
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut2 );
183
185
}
184
186
else if (i == 1 )
185
187
{
186
188
// Get the top-right corner of the hitbox
187
- ScreenPoint1 [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
188
- ScreenPoint1 [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
189
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint1, ScreenPoint1 );
189
+ ScreenPoint [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
190
+ ScreenPoint [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
191
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut1 );
190
192
191
193
// Get the bottom-right corner of the hitbox
192
- ScreenPoint2 [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
193
- ScreenPoint2 [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
194
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint2, ScreenPoint2 );
194
+ ScreenPoint [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
195
+ ScreenPoint [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
196
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut2 );
195
197
}
196
198
else if (i == 2 )
197
199
{
198
200
// Get the bottom-right corner of the hitbox
199
- ScreenPoint1 [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
200
- ScreenPoint1 [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
201
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint1, ScreenPoint1 );
201
+ ScreenPoint [0 ] = DrawHitboxPosXStart + DrawHitboxAdjustPosX;
202
+ ScreenPoint [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
203
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut1 );
202
204
203
205
// Get the bottom-left corner of the hitbox
204
- ScreenPoint2 [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
205
- ScreenPoint2 [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
206
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint2, ScreenPoint2 );
206
+ ScreenPoint [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
207
+ ScreenPoint [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
208
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut2 );
207
209
}
208
210
else // if (i == 3)
209
211
{
210
212
// Get the bottom-left corner of the hitbox
211
- ScreenPoint1 [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
212
- ScreenPoint1 [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
213
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint1, ScreenPoint1 );
213
+ ScreenPoint [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
214
+ ScreenPoint [1 ] = DrawHitboxPosYStart - DrawHitboxAdjustPosY;
215
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut1 );
214
216
215
217
// Get the top-left corner of the hitbox
216
- ScreenPoint2 [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
217
- ScreenPoint2 [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
218
- ttyd::battle_disp::btlGetScreenPoint (ScreenPoint2, ScreenPoint2 );
218
+ ScreenPoint [0 ] = DrawHitboxPosXStart - DrawHitboxAdjustPosX;
219
+ ScreenPoint [1 ] = DrawHitboxPosYStart + DrawHitboxAdjustPosY;
220
+ ttyd::battle_disp::btlGetScreenPoint (ScreenPoint, ScreenPointOut2 );
219
221
}
220
222
221
223
// Draw the line from corner 1 to corner 2
222
224
gc::gx::GXBegin (static_cast <gc::gx::GXPrimitive>(168 ), gc::gx::GX_VTXFMT0, 2 );
223
225
224
- *WriteGatherPipe = ScreenPoint1 [0 ];
225
- *WriteGatherPipe = ScreenPoint1 [1 ];
226
+ *WriteGatherPipe = ScreenPointOut1 [0 ];
227
+ *WriteGatherPipe = ScreenPointOut1 [1 ];
226
228
*WriteGatherPipe = 0 ;
227
229
228
- *WriteGatherPipe = ScreenPoint2 [0 ];
229
- *WriteGatherPipe = ScreenPoint2 [1 ];
230
+ *WriteGatherPipe = ScreenPointOut2 [0 ];
231
+ *WriteGatherPipe = ScreenPointOut2 [1 ];
230
232
*WriteGatherPipe = 0 ;
231
233
}
232
234
}
0 commit comments