mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-08 20:19:53 -04:00
Use more TRUNCF_BINANG for f32 -> s16 casts (#1503)
* TRUNCF_BINANG * brackets * extra cast
This commit is contained in:
+2
-2
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user