Use more TRUNCF_BINANG for f32 -> s16 casts (#1503)

* TRUNCF_BINANG

* brackets

* extra cast
This commit is contained in:
engineer124
2023-12-13 15:16:24 +11:00
committed by GitHub
parent ed4da0ecef
commit 5607eec18b
127 changed files with 387 additions and 373 deletions
+2 -2
View File
@@ -171,8 +171,8 @@ s32 Snap_ValidatePictograph(PlayState* play, Actor* actor, s32 flag, Vec3f* pos,
// Check in capture region
Actor_GetProjectedPos(play, pos, &projectedPos, &distance);
// Convert to projected position to device coordinates, shift to be relative to the capture region's top-left corner
x = (s16)PROJECTED_TO_SCREEN_X(projectedPos, distance) - PICTO_VALID_TOPLEFT_X;
y = (s16)PROJECTED_TO_SCREEN_Y(projectedPos, distance) - PICTO_VALID_TOPLEFT_Y;
x = TRUNCF_BINANG(PROJECTED_TO_SCREEN_X(projectedPos, distance)) - PICTO_VALID_TOPLEFT_X;
y = TRUNCF_BINANG(PROJECTED_TO_SCREEN_Y(projectedPos, distance)) - PICTO_VALID_TOPLEFT_Y;
// checks if the coordinates are within the capture region
if ((x < 0) || (x > PICTO_VALID_WIDTH) || (y < 0) || (y > PICTO_VALID_HEIGHT)) {