diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-12-13 15:16:24 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-13 15:16:24 +1100 |
| commit | 5607eec18bae68e4cd38ef6d1fa69d7f1d84bfc8 (patch) | |
| tree | bb13ad49718f8883bc65d7bd0a9db4d791800cf2 /src/code/z_snap.c | |
| parent | ed4da0ecef698ad0112c7cdf575368ac3c61903b (diff) | |
Use more `TRUNCF_BINANG` for f32 -> s16 casts (#1503)
* TRUNCF_BINANG
* brackets
* extra cast
Diffstat (limited to 'src/code/z_snap.c')
| -rw-r--r-- | src/code/z_snap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/code/z_snap.c b/src/code/z_snap.c index 3524fe3ab..cd5a03704 100644 --- a/src/code/z_snap.c +++ b/src/code/z_snap.c @@ -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)) { |
