1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Clean up shop drawing

This commit is contained in:
Marijn van der Werf
2016-05-17 20:02:30 +02:00
parent ac53e8d24d
commit acab4d351e
4 changed files with 10 additions and 80 deletions

View File

@@ -22,57 +22,4 @@
#include "../../world/map.h"
#include "../track_paint.h"
/**
* rct2: 0x00761378, 0x007614DB, 0x0076163F, 0x007617A5
*/
static void ride_50_52_53_54_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) {
bool supportsDrawn = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL);
RCT2_GLOBAL(0x0141E9D0, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9C4, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9CC, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9B8, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9BC, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9B4, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9C0, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9C8, uint16) = 0xFFFF;
RCT2_GLOBAL(0x0141E9D4, uint16) = 0xFFFF;
rct_ride *ride = get_ride(rideIndex);
rct_ride_entry *rideEntry = get_ride_entry(ride->subtype);
uint32 image_id = RCT2_GLOBAL(0x00F44198, uint32);
if (image_id & 0x80000000) {
image_id &= 0x60FFFFFF;
}
image_id += rideEntry->vehicles[0].base_image_id;
image_id += direction;
if (supportsDrawn) {
uint32 ebx = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32);
sub_98197C(ebx, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
sub_98199C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
} else {
sub_98197C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
}
height += 48;
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height;
RCT2_GLOBAL(0x00141E9DA, uint8) = 0x20;
}
}
/**
* rct2: 0x00761160
*/
TRACK_PAINT_FUNCTION get_track_paint_function_50_52_53_54(int trackType, int direction) {
switch (trackType) {
case 118:
case 121:
return ride_50_52_53_54_paint_setup;
}
return NULL;
}

View File

@@ -33,16 +33,6 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
{
bool hasSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL);
RCT2_GLOBAL(0x0141E9D0, sint16) = -1;
RCT2_GLOBAL(0x0141E9C4, sint16) = -1;
RCT2_GLOBAL(0x0141E9CC, sint16) = -1;
RCT2_GLOBAL(0x0141E9B8, sint16) = -1;
RCT2_GLOBAL(0x0141E9BC, sint16) = -1;
RCT2_GLOBAL(0x0141E9B4, sint16) = -1;
RCT2_GLOBAL(0x0141E9C0, sint16) = -1;
RCT2_GLOBAL(0x0141E9C8, sint16) = -1;
RCT2_GLOBAL(0x0141E9D4, sint16) = -1;
rct_ride *ride = get_ride(rideIndex);
rct_ride_entry *rideEntry = get_ride_entry(ride->subtype);
rct_ride_entry_vehicle *firstVehicleEntry = &rideEntry->vehicles[0];
@@ -54,23 +44,17 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
imageId += firstVehicleEntry->base_image_id;
imageId += direction;
sint16 height16 = (sint16)height;
int rotation = get_current_rotation();
if (hasSupports) {
uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32);
foundationImageId |= 3395;
sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation);
uint32 foundationImageId = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32);
sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation);
sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
} else {
sub_98197C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation);
sub_98197C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation());
}
height16 += 48;
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height16) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height16;
RCT2_GLOBAL(0x00141E9DA, uint8) = 32;
}
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 48, 0x20);
}
/* 0x00761160 */

View File

@@ -5642,11 +5642,11 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
0, // RIDE_TYPE_MAGIC_CARPET
0, // RIDE_TYPE_SUBMARINE_RIDE
0, // RIDE_TYPE_RIVER_RAFTS
get_track_paint_function_50_52_53_54, // RIDE_TYPE_50
get_track_paint_function_shop, // RIDE_TYPE_50
0, // RIDE_TYPE_ENTERPRISE
0, // RIDE_TYPE_52
0, // RIDE_TYPE_53
0, // RIDE_TYPE_54
get_track_paint_function_shop, // RIDE_TYPE_52
get_track_paint_function_shop, // RIDE_TYPE_53
get_track_paint_function_shop, // RIDE_TYPE_54
0, // RIDE_TYPE_55
0, // RIDE_TYPE_INVERTED_IMPULSE_COASTER
0, // RIDE_TYPE_MINI_ROLLER_COASTER

View File

@@ -79,6 +79,5 @@ TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int directi
TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_50_52_53_54(int trackType, int direction);
#endif