mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Cleanup
This commit is contained in:
@@ -2324,13 +2324,15 @@ static void sub_6CBCE2(
|
|||||||
map_set_tile_elements(tileX + 0, tileY - 1, &_tempSideTrackTileElement);
|
map_set_tile_elements(tileX + 0, tileY - 1, &_tempSideTrackTileElement);
|
||||||
|
|
||||||
// Set the temporary track element
|
// Set the temporary track element
|
||||||
_tempTrackTileElement.type = trackDirection | TILE_ELEMENT_TYPE_TRACK | ((edx & 0x10000) ? 0x80 : 0);
|
_tempTrackTileElement.type = trackDirection | TILE_ELEMENT_TYPE_TRACK;
|
||||||
|
track_element_set_lift_hill(&_tempTrackTileElement, (edx & 0x10000) ? true : false);
|
||||||
_tempTrackTileElement.flags = (bl & 0x0F) | TILE_ELEMENT_FLAG_LAST_TILE;
|
_tempTrackTileElement.flags = (bl & 0x0F) | TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
_tempTrackTileElement.base_height = baseZ;
|
_tempTrackTileElement.base_height = baseZ;
|
||||||
_tempTrackTileElement.clearance_height = clearanceZ;
|
_tempTrackTileElement.clearance_height = clearanceZ;
|
||||||
track_element_set_type(&_tempTrackTileElement, trackType);
|
track_element_set_type(&_tempTrackTileElement, trackType);
|
||||||
tile_element_set_track_sequence(&_tempTrackTileElement, trackBlock->index);
|
tile_element_set_track_sequence(&_tempTrackTileElement, trackBlock->index);
|
||||||
track_element_set_colour_scheme(&_tempTrackTileElement, 0);
|
// TODO: Find out why this is set to 0.
|
||||||
|
_tempTrackTileElement.properties.track.colour = 0;
|
||||||
track_element_set_ride_index(&_tempTrackTileElement, rideIndex);
|
track_element_set_ride_index(&_tempTrackTileElement, rideIndex);
|
||||||
if (edx & 0x20000)
|
if (edx & 0x20000)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1493,6 +1493,7 @@ static money32 track_place(sint32 rideIndex,
|
|||||||
tile_element_set_track_sequence(tileElement, trackBlock->index);
|
tile_element_set_track_sequence(tileElement, trackBlock->index);
|
||||||
track_element_set_ride_index(tileElement, rideIndex);
|
track_element_set_ride_index(tileElement, rideIndex);
|
||||||
track_element_set_type(tileElement, type);
|
track_element_set_type(tileElement, type);
|
||||||
|
// TODO: Find out why this is set to 0.
|
||||||
tileElement->properties.track.colour = 0;
|
tileElement->properties.track.colour = 0;
|
||||||
if (flags & GAME_COMMAND_FLAG_GHOST)
|
if (flags & GAME_COMMAND_FLAG_GHOST)
|
||||||
{
|
{
|
||||||
@@ -2447,6 +2448,18 @@ bool track_element_is_lift_hill(rct_tile_element * trackElement)
|
|||||||
return trackElement->type & TRACK_ELEMENT_FLAG_CHAIN_LIFT;
|
return trackElement->type & TRACK_ELEMENT_FLAG_CHAIN_LIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void track_element_set_lift_hill(rct_tile_element * trackElement, bool on)
|
||||||
|
{
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
trackElement->type |= TRACK_ELEMENT_FLAG_CHAIN_LIFT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trackElement->type &= ~TRACK_ELEMENT_FLAG_CHAIN_LIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a track element is recognised as the beginning of a block.
|
* Checks if a track element is recognised as the beginning of a block.
|
||||||
* A beginning of a block can be the end of a station, the end of a lift hill,
|
* A beginning of a block can be the end of a station, the end of a lift hill,
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ bool track_element_is_block_start(rct_tile_element * trackElement);
|
|||||||
bool track_element_is_covered(sint32 trackElementType);
|
bool track_element_is_covered(sint32 trackElementType);
|
||||||
bool track_element_is_station(rct_tile_element * trackElement);
|
bool track_element_is_station(rct_tile_element * trackElement);
|
||||||
bool track_element_is_lift_hill(rct_tile_element * trackElement);
|
bool track_element_is_lift_hill(rct_tile_element * trackElement);
|
||||||
|
void track_element_set_lift_hill(rct_tile_element * trackElement, bool on);
|
||||||
bool track_element_is_cable_lift(rct_tile_element * trackElement);
|
bool track_element_is_cable_lift(rct_tile_element * trackElement);
|
||||||
void track_element_set_cable_lift(rct_tile_element * trackElement);
|
void track_element_set_cable_lift(rct_tile_element * trackElement);
|
||||||
void track_element_clear_cable_lift(rct_tile_element * trackElement);
|
void track_element_clear_cable_lift(rct_tile_element * trackElement);
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ static void paint_virginia_reel_track_flat(paint_session * session, uint8 rideIn
|
|||||||
sint32 height, rct_tile_element * tileElement)
|
sint32 height, rct_tile_element * tileElement)
|
||||||
{
|
{
|
||||||
const uint32 * sprites = virginia_reel_track_pieces_flat;
|
const uint32 * sprites = virginia_reel_track_pieces_flat;
|
||||||
if (tileElement->type & 0x80)
|
if (track_element_is_lift_hill(tileElement))
|
||||||
{
|
{
|
||||||
sprites = virginia_reel_track_pieces_flat_lift_hill;
|
sprites = virginia_reel_track_pieces_flat_lift_hill;
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ static void paint_virginia_reel_track_25_deg_up(paint_session * session, uint8 r
|
|||||||
sint32 height, rct_tile_element * tileElement)
|
sint32 height, rct_tile_element * tileElement)
|
||||||
{
|
{
|
||||||
const uint32 * sprites = virginia_reel_track_pieces_25_deg_up;
|
const uint32 * sprites = virginia_reel_track_pieces_25_deg_up;
|
||||||
if (tileElement->type & 0x80)
|
if (track_element_is_lift_hill(tileElement))
|
||||||
{
|
{
|
||||||
sprites = virginia_reel_track_pieces_25_deg_up_lift_hill;
|
sprites = virginia_reel_track_pieces_25_deg_up_lift_hill;
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ static void paint_virginia_reel_track_flat_to_25_deg_up(paint_session * session,
|
|||||||
uint8 direction, sint32 height, rct_tile_element * tileElement)
|
uint8 direction, sint32 height, rct_tile_element * tileElement)
|
||||||
{
|
{
|
||||||
const uint32 * sprites = virginia_reel_track_pieces_flat_to_25_deg_up;
|
const uint32 * sprites = virginia_reel_track_pieces_flat_to_25_deg_up;
|
||||||
if (tileElement->type & 0x80)
|
if (track_element_is_lift_hill(tileElement))
|
||||||
{
|
{
|
||||||
sprites = virginia_reel_track_pieces_flat_to_25_deg_up_lift_hill;
|
sprites = virginia_reel_track_pieces_flat_to_25_deg_up_lift_hill;
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ static void paint_virginia_reel_track_25_deg_up_to_flat(paint_session * session,
|
|||||||
uint8 direction, sint32 height, rct_tile_element * tileElement)
|
uint8 direction, sint32 height, rct_tile_element * tileElement)
|
||||||
{
|
{
|
||||||
const uint32 * sprites = virginia_reel_track_pieces_25_deg_up_to_flat;
|
const uint32 * sprites = virginia_reel_track_pieces_25_deg_up_to_flat;
|
||||||
if (tileElement->type & 0x80)
|
if (track_element_is_lift_hill(tileElement))
|
||||||
{
|
{
|
||||||
sprites = virginia_reel_track_pieces_25_deg_up_to_flat_lift_hill;
|
sprites = virginia_reel_track_pieces_25_deg_up_to_flat_lift_hill;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ static uint8 TestTrackElementPaintCalls(uint8 rideType, uint8 trackType, uint8 t
|
|||||||
|
|
||||||
rct_tile_element tileElement = {0};
|
rct_tile_element tileElement = {0};
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = height / 16;
|
tileElement.base_height = height / 16;
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ static uint8 TestTrackElementSegmentSupportHeight(uint8 rideType, uint8 trackTyp
|
|||||||
|
|
||||||
rct_tile_element tileElement = {0};
|
rct_tile_element tileElement = {0};
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = height / 16;
|
tileElement.base_height = height / 16;
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ static uint8 TestTrackElementGeneralSupportHeight(uint8 rideType, uint8 trackTyp
|
|||||||
|
|
||||||
rct_tile_element tileElement = {0};
|
rct_tile_element tileElement = {0};
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = height / 16;
|
tileElement.base_height = height / 16;
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
@@ -587,7 +587,7 @@ static uint8 TestTrackElementSideTunnels(uint8 rideType, uint8 trackType, uint8
|
|||||||
|
|
||||||
rct_tile_element tileElement = {0};
|
rct_tile_element tileElement = {0};
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = height / 16;
|
tileElement.base_height = height / 16;
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ static uint8 TestTrackElementVerticalTunnels(uint8 rideType, uint8 trackType, ui
|
|||||||
|
|
||||||
rct_tile_element tileElement = {0};
|
rct_tile_element tileElement = {0};
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = height / 16;
|
tileElement.base_height = height / 16;
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
|
|||||||
@@ -407,11 +407,11 @@ private:
|
|||||||
for (int direction = 0; direction < 4; direction++) {
|
for (int direction = 0; direction < 4; direction++) {
|
||||||
rct_tile_element tileElement = { 0 };
|
rct_tile_element tileElement = { 0 };
|
||||||
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
tileElement.flags |= TILE_ELEMENT_FLAG_LAST_TILE;
|
||||||
track_element_set_type(tileElement, trackType);
|
track_element_set_type(&tileElement, trackType);
|
||||||
tileElement.base_height = 3;
|
tileElement.base_height = 3;
|
||||||
if (_invertedTrack)
|
if (_invertedTrack)
|
||||||
{
|
{
|
||||||
track_element_set_inverted(tileElement, true);
|
track_element_set_inverted(&tileElement, true);
|
||||||
}
|
}
|
||||||
g_currently_drawn_item = &tileElement;
|
g_currently_drawn_item = &tileElement;
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ private:
|
|||||||
if (_rideType == RIDE_TYPE_GIGA_COASTER)
|
if (_rideType == RIDE_TYPE_GIGA_COASTER)
|
||||||
{
|
{
|
||||||
tileElement.type = 0;
|
tileElement.type = 0;
|
||||||
track_element_set_cable_lift(tileElement);
|
track_element_set_cable_lift(&tileElement);
|
||||||
PaintIntercept::ClearCalls();
|
PaintIntercept::ClearCalls();
|
||||||
CallOriginal(trackType, direction, trackSequence, height, &tileElement);
|
CallOriginal(trackType, direction, trackSequence, height, &tileElement);
|
||||||
numCalls = PaintIntercept::GetCalls(callBuffer);
|
numCalls = PaintIntercept::GetCalls(callBuffer);
|
||||||
@@ -463,7 +463,7 @@ private:
|
|||||||
RCT2_GLOBAL(0x009DE56A, sint16) = 64 + 32;
|
RCT2_GLOBAL(0x009DE56A, sint16) = 64 + 32;
|
||||||
RCT2_GLOBAL(0x009DE56E, sint16) = 64;
|
RCT2_GLOBAL(0x009DE56E, sint16) = 64;
|
||||||
tileElement.type = 0;
|
tileElement.type = 0;
|
||||||
track_element_clear_cable_lift(tileElement);
|
track_element_clear_cable_lift(&tileElement);
|
||||||
PaintIntercept::ClearCalls();
|
PaintIntercept::ClearCalls();
|
||||||
CallOriginal(trackType, direction, trackSequence, height, &tileElement);
|
CallOriginal(trackType, direction, trackSequence, height, &tileElement);
|
||||||
numCalls = PaintIntercept::GetCalls(callBuffer);
|
numCalls = PaintIntercept::GetCalls(callBuffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user