forked from rosebudai/OpenRCT2-Web
Clean up boosters
This commit is contained in:
1 parent
412332a3a5
commit
8b6ecc76d2
6 files changed
+33
-11
No files matched your search
@@ -1529,7 +1529,7 @@ void ride_construction_set_default_next_piece()
|
||||
bank = FlatRideTrackDefinitions[trackType].bank_end;
|
||||
slope = FlatRideTrackDefinitions[trackType].vangle_end;
|
||||
} else {
|
||||
if (ride->type != RIDE_TYPE_WILD_MOUSE && trackType == TRACK_ELEM_BOOSTER) {
|
||||
if (track_element_is_booster(ride->type, trackType)) {
|
||||
curve = 0x100 | TRACK_ELEM_BOOSTER;
|
||||
} else {
|
||||
curve = gTrackCurveChain[trackType].next;
|
||||
@@ -1584,7 +1584,7 @@ void ride_construction_set_default_next_piece()
|
||||
bank = FlatRideTrackDefinitions[trackType].bank_start;
|
||||
slope = FlatRideTrackDefinitions[trackType].vangle_start;
|
||||
} else {
|
||||
if (ride->type != RIDE_TYPE_WILD_MOUSE && trackType == TRACK_ELEM_BOOSTER) {
|
||||
if (track_element_is_booster(ride->type, trackType)) {
|
||||
curve = 0x100 | TRACK_ELEM_BOOSTER;
|
||||
} else {
|
||||
curve = gTrackCurveChain[trackType].previous;
|
||||
|
||||
@@ -1363,7 +1363,7 @@ static money32 track_place(sint32 rideIndex, sint32 type, sint32 originX, sint32
|
||||
map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, x, y, mapElement->base_height);
|
||||
break;
|
||||
}
|
||||
if (type == TRACK_ELEM_BRAKES || type == TRACK_ELEM_BOOSTER) {
|
||||
if (track_element_has_speed_setting(type)) {
|
||||
mapElement->properties.track.sequence = (properties_1 >> 1) << 4;
|
||||
}
|
||||
else {
|
||||
@@ -2261,3 +2261,24 @@ bool track_element_is_covered(sint32 trackElementType)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool track_element_is_booster(uint8 rideType, uint8 trackType)
|
||||
{
|
||||
// Boosters share their ID with the Spinning Control track.
|
||||
if (rideType != RIDE_TYPE_WILD_MOUSE && trackType == TRACK_ELEM_BOOSTER)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool track_element_has_speed_setting(uint8 trackType)
|
||||
{
|
||||
// This does not check if the element is really a Spinning Control track instead of a booster,
|
||||
// but this does not cause problems.
|
||||
if (trackType == TRACK_ELEM_BRAKES || trackType == TRACK_ELEM_BOOSTER)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -543,5 +543,6 @@ void game_command_place_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx
|
||||
void game_command_remove_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp);
|
||||
void game_command_set_maze_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp);
|
||||
void game_command_set_brakes_speed(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp);
|
||||
|
||||
bool track_element_is_booster(uint8 rideType, uint8 trackType);
|
||||
bool track_element_has_speed_setting(uint8 trackType);
|
||||
#endif
|
||||
@@ -1004,7 +1004,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track
|
||||
}
|
||||
|
||||
uint8 bh;
|
||||
if (track->type == TRACK_ELEM_BRAKES || track->type == TRACK_ELEM_BOOSTER) {
|
||||
if (track_element_has_speed_setting(track->type)) {
|
||||
bh = trackElement.element->properties.track.sequence >> 4;
|
||||
} else {
|
||||
bh = trackElement.element->properties.track.colour >> 4;
|
||||
|
||||
@@ -7515,7 +7515,7 @@ loc_6DAEB9:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (trackType == TRACK_ELEM_BOOSTER && ride->type != RIDE_TYPE_WILD_MOUSE) {
|
||||
else if (track_element_is_booster(ride->type, trackType)) {
|
||||
if (ride->type == RIDE_TYPE_GIGA_COASTER) {
|
||||
regs.eax = (vehicle->brake_speed << 17);
|
||||
} else if (ride-> type == RIDE_TYPE_JUNIOR_ROLLER_COASTER) {
|
||||
@@ -7873,8 +7873,7 @@ loc_6DBA33:;
|
||||
}
|
||||
}
|
||||
|
||||
// Boosters share their ID with the Spinning Control track.
|
||||
if (trackType == TRACK_ELEM_BOOSTER && ride->type != RIDE_TYPE_WILD_MOUSE) {
|
||||
if (track_element_is_booster(ride->type, trackType)) {
|
||||
if (ride->type == RIDE_TYPE_GIGA_COASTER) {
|
||||
regs.eax = (vehicle->brake_speed << 17);
|
||||
} else if (ride-> type == RIDE_TYPE_JUNIOR_ROLLER_COASTER) {
|
||||
|
||||
@@ -2489,7 +2489,7 @@ void window_ride_construction_update_active_elements()
|
||||
sint32 z = _currentTrackBeginZ;
|
||||
if (!sub_6C683D(&x, &y, &z, _currentTrackPieceDirection & 3, _currentTrackPieceType, 0, &mapElement, 0)) {
|
||||
_selectedTrackType = mapElement->properties.track.type;
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_BRAKES || mapElement->properties.track.type == TRACK_ELEM_BOOSTER)
|
||||
if (track_element_has_speed_setting(mapElement->properties.track.type))
|
||||
_currentBrakeSpeed2 = (mapElement->properties.track.sequence >> 4) << 1;
|
||||
_currentSeatRotationAngle = mapElement->properties.track.colour >> 4;
|
||||
}
|
||||
@@ -2714,7 +2714,7 @@ bool sub_6CA2DF(sint32 *_trackType, sint32 *_trackDirection, sint32 *_rideIndex,
|
||||
}
|
||||
|
||||
|
||||
if (trackType == TRACK_ELEM_BRAKES || trackType == TRACK_ELEM_BOOSTER) {
|
||||
if (track_element_has_speed_setting(trackType)) {
|
||||
properties = _currentBrakeSpeed2;
|
||||
} else {
|
||||
properties = _currentSeatRotationAngle << 12;
|
||||
@@ -3293,7 +3293,8 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
||||
window_ride_construction_widgets[WIDX_O_TRACK].type = WWT_EMPTY;
|
||||
|
||||
bool brakesSelected = _selectedTrackType == TRACK_ELEM_BRAKES || _currentTrackCurve == (0x100 | TRACK_ELEM_BRAKES);
|
||||
_boosterTrackSelected = ride->type != RIDE_TYPE_WILD_MOUSE && (_selectedTrackType == TRACK_ELEM_BOOSTER || _currentTrackCurve == (0x100 | TRACK_ELEM_BOOSTER));
|
||||
_boosterTrackSelected = track_element_is_booster(ride->type, _selectedTrackType) ||
|
||||
(ride->type != RIDE_TYPE_WILD_MOUSE && _currentTrackCurve == (0x100 | TRACK_ELEM_BOOSTER));
|
||||
|
||||
if (!brakesSelected && !_boosterTrackSelected) {
|
||||
if (is_track_enabled(TRACK_FLAT_ROLL_BANKING)) {
|
||||
|
||||
Reference in new issue
Block a user