mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #4224 from marijnvdwerf/clean/data-5
[Clean] Use already integrated data
This commit is contained in:
commit
389d75534d
|
@ -3783,12 +3783,8 @@ static bool ride_is_valid_num_circuits(rct_ride *ride, int numCircuits)
|
|||
|
||||
static bool ride_is_valid_operation_option(rct_ride *ride, uint8 value)
|
||||
{
|
||||
uint8 minValue = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8) + 4, uint8);
|
||||
uint8 maxValue = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8) + 5, uint8);
|
||||
if (ride->mode == RIDE_MODE_MAZE) {
|
||||
// Allow 64 people in mazes under non-cheat settings. The old maximum of 16 was too little for even moderately big mazes.
|
||||
maxValue = 64;
|
||||
}
|
||||
uint8 minValue = RideProperties[ride->type].min_value;
|
||||
uint8 maxValue = RideProperties[ride->type].max_value;
|
||||
if (gCheatsFastLiftHill) {
|
||||
minValue = 0;
|
||||
maxValue = 255;
|
||||
|
@ -4345,7 +4341,7 @@ static void ride_set_boat_hire_return_point(rct_ride *ride, rct_xy_element *star
|
|||
};
|
||||
|
||||
trackType = returnTrackElement->properties.track.type;
|
||||
int elementReturnDirection = RCT2_GLOBAL(0x009968BB + (trackType * 10), uint8);
|
||||
int elementReturnDirection = TrackCoordinates[trackType].rotation_begin;
|
||||
ride->boat_hire_return_direction = (returnTrackElement->type + elementReturnDirection) & 3;
|
||||
ride->boat_hire_return_position = (returnX >> 5) | ((returnY >> 5) << 8);
|
||||
}
|
||||
|
@ -5485,7 +5481,7 @@ void game_command_set_ride_status(int *eax, int *ebx, int *ecx, int *edx, int *e
|
|||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
}
|
||||
RCT2_GLOBAL(0x00F43484, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32);
|
||||
RCT2_GLOBAL(0x00F43484, uint32) = RideProperties[ride->type].flags;
|
||||
|
||||
if (*ebx & GAME_COMMAND_FLAG_APPLY) {
|
||||
if (ride->overall_view != (uint16)-1) {
|
||||
|
@ -6073,12 +6069,8 @@ foundRideEntry:
|
|||
}
|
||||
ride->music = RideData4[ride->type].default_music;
|
||||
|
||||
ride->operation_option = (
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 5 + (ride->type * 8), uint8)
|
||||
) / 4;
|
||||
const rct_ride_properties rideProperties = RideProperties[ride->type];
|
||||
ride->operation_option = (rideProperties.min_value * 3 + rideProperties.max_value) / 4;
|
||||
|
||||
ride->lift_hill_speed = RideLiftData[ride->type].minimum_speed;
|
||||
|
||||
|
@ -6701,7 +6693,7 @@ void game_command_set_ride_price(int *eax, int *ebx, int *ecx, int *edx, int *es
|
|||
|
||||
bool ride_type_has_flag(int rideType, int flag)
|
||||
{
|
||||
return (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (rideType * 8), uint32) & flag) != 0;
|
||||
return (RideProperties[rideType].flags & flag) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -102,6 +102,18 @@ const rct_xy16 MiniMapOffsets[] = {
|
|||
{ 0 - 8, 256 }
|
||||
};
|
||||
|
||||
/** rct2: 0x00981BCC */
|
||||
static const uint16 RideKeyColours[] = {
|
||||
0x3D3D, // COLOUR_KEY_RIDE
|
||||
0x2A2A, // COLOUR_KEY_FOOD
|
||||
0x1414, // COLOUR_KEY_DRINK
|
||||
0xD1D1, // COLOUR_KEY_SOUVENIR
|
||||
0x8888, // COLOUR_KEY_KIOSK
|
||||
0x6666, // COLOUR_KEY_FIRST_AID
|
||||
0x3737, // COLOUR_KEY_CASH_MACHINE
|
||||
0xA1A1, // COLOUR_KEY_TOILETS
|
||||
};
|
||||
|
||||
static void window_map_close(rct_window *w);
|
||||
static void window_map_resize(rct_window *w);
|
||||
static void window_map_mouseup(rct_window *w, int widgetIndex);
|
||||
|
@ -828,7 +840,7 @@ static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
};
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
gfx_fill_rect(dpi, x, y + 2, x + 6, y + 8, RCT2_GLOBAL(0x00981BCC + (i * 2), uint8));
|
||||
gfx_fill_rect(dpi, x, y + 2, x + 6, y + 8, RideKeyColours[i]);
|
||||
gfx_draw_string_left(dpi, mapLabels[i], w, 0, x + 10, y);
|
||||
y += 10;
|
||||
if (i == 3) {
|
||||
|
@ -1545,17 +1557,6 @@ static const uint8 RideColourKey[] = {
|
|||
COLOUR_KEY_RIDE, //
|
||||
};
|
||||
|
||||
static const uint16 RideKeyColours[] = {
|
||||
0x3D3D, // COLOUR_KEY_RIDE
|
||||
0x2A2A, // COLOUR_KEY_FOOD
|
||||
0x1414, // COLOUR_KEY_DRINK
|
||||
0x0D1D, // COLOUR_KEY_SOUVENIR
|
||||
0x8888, // COLOUR_KEY_KIOSK
|
||||
0x6666, // COLOUR_KEY_FIRST_AID
|
||||
0x3737, // COLOUR_KEY_CASH_MACHINE
|
||||
0xA1A1, // COLOUR_KEY_TOILETS
|
||||
};
|
||||
|
||||
static uint16 map_window_get_pixel_colour_peep(int x, int y)
|
||||
{
|
||||
rct_map_element *mapElement;
|
||||
|
|
|
@ -3168,10 +3168,6 @@ static void window_ride_mode_tweak_decrease(rct_window *w)
|
|||
|
||||
uint8 maxValue = RideProperties[ride->type].max_value;
|
||||
uint8 minValue = gCheatsFastLiftHill ? 0 : RideProperties[ride->type].min_value;
|
||||
if (ride->mode == RIDE_MODE_MAZE) {
|
||||
// Allow 64 people in mazes under non-cheat settings. The old maximum of 16 was too little for even moderately big mazes.
|
||||
maxValue = 64;
|
||||
}
|
||||
if (gCheatsFastLiftHill) {
|
||||
maxValue = 255;
|
||||
}
|
||||
|
|
|
@ -2731,8 +2731,8 @@ money32 sub_6CA162(int rideIndex, int trackType, int trackDirection, int edxRS16
|
|||
RCT2_GLOBAL(0x00F440C5, uint16) = x;
|
||||
RCT2_GLOBAL(0x00F440C7, uint16) = y;
|
||||
z += ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
|
||||
RCT2_GLOBAL(0x009972BD + (trackType * 10), uint16) :
|
||||
RCT2_GLOBAL(0x009968BD + (trackType * 10), uint16);
|
||||
FlatTrackCoordinates[trackType].z_begin:
|
||||
TrackCoordinates[trackType].z_begin;
|
||||
|
||||
RCT2_GLOBAL(0x00F440C9, uint16) = z;
|
||||
RCT2_GLOBAL(0x00F440CB, uint8) = trackDirection;
|
||||
|
|
|
@ -3175,11 +3175,11 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
|
|||
}
|
||||
|
||||
if (TrackDefinitions[trackType].bank_start == 0) {
|
||||
if (!(RCT2_ADDRESS(0x009968BB, uint8)[trackType * 10] & 4)) {
|
||||
if (!(TrackCoordinates[trackType].rotation_begin & 4)) {
|
||||
direction = (trackElement->type & 3) ^ 2;
|
||||
if (direction == edge) {
|
||||
trackBlock = &TrackBlocks[trackType][sequence];
|
||||
z = RCT2_GLOBAL(0x009968BD + (trackType * 10), uint8);
|
||||
z = TrackCoordinates[trackType].z_begin;
|
||||
z = trackElement->base_height + ((z - trackBlock->z) * 8);
|
||||
if (z == z0) {
|
||||
return true;
|
||||
|
@ -3198,7 +3198,7 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
|
|||
return false;
|
||||
}
|
||||
|
||||
direction = RCT2_ADDRESS(0x009968BC, uint8)[trackType * 10];
|
||||
direction = TrackCoordinates[trackType].rotation_end;
|
||||
if (direction & 4) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3209,7 +3209,7 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
|
|||
}
|
||||
|
||||
trackBlock = &TrackBlocks[trackType][sequence];
|
||||
z = RCT2_GLOBAL(0x009968BF + (trackType * 10), uint8);
|
||||
z = TrackCoordinates[trackType].z_end;
|
||||
z = trackElement->base_height + ((z - trackBlock->z) * 8);
|
||||
if (z != z0) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue