From 11121121574ddf34197c3e198aa7fff0e4897ebc Mon Sep 17 00:00:00 2001 From: Wirlie Date: Fri, 22 Apr 2016 12:54:12 -0500 Subject: [PATCH] Revert uint assignment from 7eb3a90. For solve the another problem (the reason of that this code has been modified at 7eb3a90), I replaced the left shift operator with a multiply (suggested by zsilencer) to prevent a 'undefined behaviour', Fixes #3367. --- src/ride/ride.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ride/ride.c b/src/ride/ride.c index 32a2ccc96c..e2b6d28852 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3370,16 +3370,16 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint view_y2 < rotatedCoords.y) { goto label58; } - uint32 x2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->x + ((rotatedCoords.x - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_x) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); - x2 <<= 16; + int x2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->x + ((rotatedCoords.x - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_x) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); + x2 *= 0x10000; uint16 screenwidth = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16); if (screenwidth < 64) { screenwidth = 64; } int pan_x = ((x2 / screenwidth) - 0x8000) >> 4; - uint32 y2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y + ((rotatedCoords.y - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); - y2 <<= 16; + int y2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y + ((rotatedCoords.y - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); + y2 *= 0x10000; uint16 screenheight = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16); if (screenheight < 64) { screenheight = 64;