Fixes for values being shifted (#3362)

This commit is contained in:
janisozaur
2016-04-21 00:57:54 +02:00
committed by Ted John
parent 60ac228c51
commit 7eb3a90cea
3 changed files with 5 additions and 5 deletions

View File

@@ -3370,7 +3370,7 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint
view_y2 < rotatedCoords.y) { view_y2 < rotatedCoords.y) {
goto label58; goto label58;
} }
int x2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->x + ((rotatedCoords.x - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_x) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); 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; x2 <<= 16;
uint16 screenwidth = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16); uint16 screenwidth = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16);
if (screenwidth < 64) { if (screenwidth < 64) {
@@ -3378,7 +3378,7 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint
} }
int pan_x = ((x2 / screenwidth) - 0x8000) >> 4; int pan_x = ((x2 / screenwidth) - 0x8000) >> 4;
int y2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y + ((rotatedCoords.y - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); 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; y2 <<= 16;
uint16 screenheight = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16); uint16 screenheight = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16);
if (screenheight < 64) { if (screenheight < 64) {

View File

@@ -1660,7 +1660,7 @@ int track_place_ride(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8** trac
int temp_z = z; int temp_z = z;
temp_z -= track_coordinates->z_begin; temp_z -= track_coordinates->z_begin;
uint32 edi = ((track->flags & 0xF) << 17) | uint32 edi = ((track->flags & 0xF) << 17) |
((track->flags & 0xF) << 28) | ((uint32)(track->flags & 0xF) << 28) |
(((track->flags >> 4) & 0x3) << 24) | (((track->flags >> 4) & 0x3) << 24) |
(temp_z & 0xFFFF); (temp_z & 0xFFFF);

View File

@@ -309,7 +309,7 @@ static void window_new_ride_populate_list()
quadIndex = rideType >> 5; quadIndex = rideType >> 5;
bitIndex = rideType & 0x1F; bitIndex = rideType & 0x1F;
if (RCT2_ADDRESS(0x01357404, uint32)[quadIndex] & (1 << bitIndex)) { if (RCT2_ADDRESS(0x01357404, uint32)[quadIndex] & (1u << bitIndex)) {
int dh = 0; int dh = 0;
uint8 *rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType); uint8 *rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType);
@@ -323,7 +323,7 @@ static void window_new_ride_populate_list()
quadIndex = rideEntryIndex >> 5; quadIndex = rideEntryIndex >> 5;
bitIndex = rideEntryIndex & 0x1F; bitIndex = rideEntryIndex & 0x1F;
// Skip if vehicle type is not invented yet // Skip if vehicle type is not invented yet
if (!(RCT2_ADDRESS(0x01357424, uint32)[quadIndex] & (1 << bitIndex))) if (!(RCT2_ADDRESS(0x01357424, uint32)[quadIndex] & (1u << bitIndex)))
continue; continue;
// Ride entries // Ride entries