From 82d0d229ce4b45fea0b36bf4887c2c72f844a34d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 14 Aug 2016 14:12:07 +0200 Subject: [PATCH] Use word_981D6C --- src/peep/peep.c | 41 ++++++++++++++++++++--------------------- src/ride/ride.c | 4 ++-- src/world/footpath.c | 1 + 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/peep/peep.c b/src/peep/peep.c index 86064c1e6b..da4ae51cd8 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -2187,8 +2187,8 @@ static void peep_go_to_ride_entrance(rct_peep* peep, rct_ride* ride){ x += 16; y += 16; - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[direction * 2]; + sint16 x_shift = word_981D6C[direction].x; + sint16 y_shift = word_981D6C[direction].y; uint8 shift_multiplier = 21; rct_ride_entry* ride_type = get_ride_entry(ride->subtype); @@ -2610,8 +2610,8 @@ static void peep_go_to_ride_exit(rct_peep* peep, rct_ride* ride, sint16 x, sint1 x += 16; y += 16; - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[exit_direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[exit_direction * 2]; + sint16 x_shift = word_981D6C[exit_direction].x; + sint16 y_shift = word_981D6C[exit_direction].y; sint16 shift_multiplier = 20; @@ -2712,8 +2712,8 @@ static void peep_update_ride_sub_state_2_rejoin_queue(rct_peep* peep, rct_ride* x *= 32; y *= 32; - x += 16 - RCT2_ADDRESS(0x981D6C, sint16)[direction_entrance * 2] * 20; - y += 16 - RCT2_ADDRESS(0x981D6E, sint16)[direction_entrance * 2] * 20; + x += 16 - word_981D6C[direction_entrance].x * 20; + y += 16 - word_981D6C[direction_entrance].y * 20; peep->destination_x = x; peep->destination_y = y; @@ -2977,9 +2977,8 @@ static void peep_update_ride_sub_state_7(rct_peep* peep){ } - - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[direction * 2]; + sint16 x_shift = word_981D6C[direction].x; + sint16 y_shift = word_981D6C[direction].y; x = vehicle->x + x_shift * shift_multiplier; y = vehicle->y + y_shift * shift_multiplier; @@ -2989,8 +2988,8 @@ static void peep_update_ride_sub_state_7(rct_peep* peep){ return; } - x = vehicle->x + RCT2_ADDRESS(0x00981D6C, sint16)[exit_direction * 2] * 12; - y = vehicle->y + RCT2_ADDRESS(0x00981D6E, sint16)[exit_direction * 2] * 12; + x = vehicle->x + word_981D6C[exit_direction].x * 12; + y = vehicle->y + word_981D6C[exit_direction].y * 12; sint8 load_position = vehicle_entry->peep_loading_positions[peep->current_seat]; @@ -3104,8 +3103,8 @@ static void peep_update_ride_prepare_for_state_9(rct_peep* peep){ x += 16; y += 16; - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[exit_direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[exit_direction * 2]; + sint16 x_shift = word_981D6C[exit_direction].x; + sint16 y_shift = word_981D6C[exit_direction].y; sint16 shift_multiplier = 20; @@ -3322,8 +3321,8 @@ static void peep_update_ride_sub_state_13(rct_peep* peep){ x += 16; y += 16; - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[exit_direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[exit_direction * 2]; + sint16 x_shift = word_981D6C[exit_direction].x; + sint16 y_shift = word_981D6C[exit_direction].y; sint16 shift_multiplier = 20; @@ -3576,8 +3575,8 @@ static void peep_update_ride_sub_state_16(rct_peep* peep){ x += 16; y += 16; - sint16 x_shift = RCT2_ADDRESS(0x00981D6C, sint16)[exit_direction * 2]; - sint16 y_shift = RCT2_ADDRESS(0x00981D6E, sint16)[exit_direction * 2]; + sint16 x_shift = word_981D6C[exit_direction].x; + sint16 y_shift = word_981D6C[exit_direction].y; sint16 shift_multiplier = 20; @@ -5593,8 +5592,8 @@ static void peep_update_heading_to_inspect(rct_peep* peep){ uint8 direction = map_element->type & MAP_ELEMENT_DIRECTION_MASK; peep->var_78 = direction; - int x = peep->next_x + 16 + RCT2_ADDRESS(0x00981D6C, sint16)[direction * 2] * 53; - int y = peep->next_y + 16 + RCT2_ADDRESS(0x00981D6E, sint16)[direction * 2] * 53; + int x = peep->next_x + 16 + word_981D6C[direction].x * 53; + int y = peep->next_y + 16 + word_981D6C[direction].y * 53; peep->destination_x = x; peep->destination_y = y; @@ -5706,8 +5705,8 @@ static void peep_update_answering(rct_peep* peep){ uint8 direction = map_element->type & MAP_ELEMENT_DIRECTION_MASK; peep->var_78 = direction; - int x = peep->next_x + 16 + RCT2_ADDRESS(0x00981D6C, sint16)[direction * 2] * 53; - int y = peep->next_y + 16 + RCT2_ADDRESS(0x00981D6E, sint16)[direction * 2] * 53; + int x = peep->next_x + 16 + word_981D6C[direction].x * 53; + int y = peep->next_y + 16 + word_981D6C[direction].y * 53; peep->destination_x = x; peep->destination_y = y; diff --git a/src/ride/ride.c b/src/ride/ride.c index 6b3a36392c..e3b5a82fe0 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -1117,8 +1117,8 @@ static void ride_remove_peeps(int rideIndex) mapElement = ride_get_station_exit_element(ride, exitX, exitY, exitZ); exitDirection = (mapElement == NULL ? 0 : mapElement->type & MAP_ELEMENT_DIRECTION_MASK); - exitX = (exitX * 32) - (RCT2_ADDRESS(0x00981D6C, sint16)[exitDirection * 2] * 20) + 16; - exitY = (exitY * 32) - (RCT2_ADDRESS(0x00981D6E, sint16)[exitDirection * 2] * 20) + 16; + exitX = (exitX * 32) - (word_981D6C[exitDirection].x * 20) + 16; + exitY = (exitY * 32) - (word_981D6C[exitDirection].y * 20) + 16; exitZ = (exitZ * 8) + 2; // Reverse direction diff --git a/src/world/footpath.c b/src/world/footpath.c index 06653d355a..29b9da9842 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -48,6 +48,7 @@ uint8 gFootpathGroundFlags; static uint8 *_footpathQueueChainNext; static uint8 _footpathQueueChain[64]; +/** rct2: 0x00981D6C, 0x00981D6E */ const rct_xy16 word_981D6C[4] = { { -1, 0 }, { 0, 1 },