2016-08-24 13:19:25 +02:00
|
|
|
/*****************************************************************************
|
2018-06-15 14:07:34 +02:00
|
|
|
* Copyright (c) 2014-2018 OpenRCT2 developers
|
2016-08-24 13:19:25 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-08-24 13:19:25 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-08-24 13:19:25 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-05-15 12:54:58 +02:00
|
|
|
#include "Addresses.h"
|
|
|
|
|
2017-02-20 21:05:59 +01:00
|
|
|
#include <openrct2/config/Config.h>
|
2018-01-06 00:08:58 +01:00
|
|
|
#include <openrct2/interface/Colour.h>
|
2018-01-06 00:45:53 +01:00
|
|
|
#include <openrct2/interface/Viewport.h>
|
2018-05-15 12:54:58 +02:00
|
|
|
#include <openrct2/object/Object.h>
|
2018-06-01 00:16:53 +02:00
|
|
|
#include <openrct2/paint/tile_element/Paint.TileElement.h>
|
2017-12-31 13:21:34 +01:00
|
|
|
#include <openrct2/ride/Ride.h>
|
2017-10-17 13:51:47 +02:00
|
|
|
#include <openrct2/ride/Track.h>
|
2018-05-15 12:54:58 +02:00
|
|
|
#include <openrct2/world/Location.hpp>
|
2018-01-11 10:59:26 +01:00
|
|
|
#include <openrct2/world/Sprite.h>
|
2018-05-01 20:21:21 +02:00
|
|
|
#include <openrct2/world/Surface.h>
|
2016-09-12 17:37:57 +02:00
|
|
|
|
2018-12-05 21:33:45 +01:00
|
|
|
class StationObject;
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
#define gRideEntries RCT2_ADDRESS(0x009ACFA4, rct_ride_entry*)
|
2018-11-01 13:53:50 +01:00
|
|
|
#define gTileElementTilePointers RCT2_ADDRESS(0x013CE9A4, TileElement*)
|
2018-06-22 22:29:03 +02:00
|
|
|
rct_sprite* sprite_list = RCT2_ADDRESS(0x010E63BC, rct_sprite);
|
2017-12-04 19:57:41 +01:00
|
|
|
|
2017-12-03 23:07:24 +01:00
|
|
|
Ride gRideList[MAX_RIDES];
|
2018-06-20 17:28:51 +02:00
|
|
|
int16_t gMapSizeUnits;
|
|
|
|
int16_t gMapBaseZ;
|
2016-09-12 17:37:57 +02:00
|
|
|
bool gTrackDesignSaveMode = false;
|
2019-01-12 12:26:26 +01:00
|
|
|
uint8_t gTrackDesignSaveRideIndex = RIDE_ID_NULL;
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t gClipHeight = 255;
|
2018-05-15 12:54:58 +02:00
|
|
|
LocationXY8 gClipSelectionA = { 0, 0 };
|
|
|
|
LocationXY8 gClipSelectionB = { MAXIMUM_MAP_SIZE_TECHNICAL - 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1 };
|
2018-06-20 17:28:51 +02:00
|
|
|
uint32_t gScenarioTicks;
|
|
|
|
uint8_t gCurrentRotation;
|
2016-08-24 13:19:25 +02:00
|
|
|
|
2018-06-25 14:41:24 +02:00
|
|
|
// clang-format off
|
|
|
|
const CoordsXY CoordsDirectionDelta[] = {
|
|
|
|
{ -32, 0 },
|
|
|
|
{ 0, +32 },
|
|
|
|
{ +32, 0 },
|
|
|
|
{ 0, -32 },
|
|
|
|
{ -32, +32 },
|
|
|
|
{ +32, +32 },
|
|
|
|
{ +32, -32 },
|
|
|
|
{ -32, -32 },
|
|
|
|
};
|
2018-05-03 13:17:00 +02:00
|
|
|
|
2018-06-25 14:41:24 +02:00
|
|
|
const TileCoordsXY TileDirectionDelta[] = {
|
|
|
|
{ -1, 0 },
|
|
|
|
{ 0, +1 },
|
|
|
|
{ +1, 0 },
|
|
|
|
{ 0, -1 },
|
|
|
|
{ -1, +1 },
|
|
|
|
{ +1, +1 },
|
|
|
|
{ +1, -1 },
|
|
|
|
{ -1, -1 },
|
|
|
|
};
|
|
|
|
// clang-format on
|
2016-08-24 13:19:25 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
TileCoordsXYZD ride_get_entrance_location(const Ride* ride, const int32_t stationIndex);
|
|
|
|
TileCoordsXYZD ride_get_exit_location(const Ride* ride, const int32_t stationIndex);
|
2018-03-07 19:10:50 +01:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
uint8_t get_current_rotation()
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return gCurrentRotation & 3;
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
const uint32_t construction_markers[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
COLOUR_DARK_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_REMAP, // White
|
2018-06-22 22:29:03 +02:00
|
|
|
2 << 19 | 0b110000 << 19 | IMAGE_TYPE_TRANSPARENT, // Translucent
|
2016-08-24 13:19:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
int object_entry_group_counts[] = {
|
2018-06-22 22:29:03 +02:00
|
|
|
128, // rides
|
|
|
|
252, // small scenery
|
|
|
|
128, // large scenery
|
|
|
|
128, // walls
|
|
|
|
32, // banners
|
|
|
|
16, // paths
|
|
|
|
15, // path bits
|
|
|
|
19, // scenery sets
|
|
|
|
1, // park entrance
|
|
|
|
1, // water
|
|
|
|
1 // scenario text
|
2016-08-24 13:19:25 +02:00
|
|
|
};
|
|
|
|
|
2017-02-21 07:29:06 +01:00
|
|
|
GeneralConfiguration gConfigGeneral;
|
2018-06-20 17:28:51 +02:00
|
|
|
uint16_t gMapSelectFlags;
|
|
|
|
uint16_t gMapSelectType;
|
2017-10-13 22:23:07 +02:00
|
|
|
LocationXY16 gMapSelectPositionA;
|
|
|
|
LocationXY16 gMapSelectPositionB;
|
|
|
|
LocationXYZ16 gMapSelectArrowPosition;
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t gMapSelectArrowDirection;
|
2016-08-24 13:19:25 +02:00
|
|
|
|
2018-11-01 13:53:50 +01:00
|
|
|
void entrance_paint(paint_session* session, uint8_t direction, int height, const TileElement* tile_element)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void banner_paint(paint_session* session, uint8_t direction, int height, const TileElement* tile_element)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void surface_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void path_paint(paint_session* session, uint16_t height, const TileElement* tileElement)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void scenery_paint(paint_session* session, uint8_t direction, int height, const TileElement* tileElement)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void fence_paint(paint_session* session, uint8_t direction, int height, const TileElement* tileElement)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2018-11-01 13:53:50 +01:00
|
|
|
void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-24 13:19:25 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
Ride* get_ride(int index)
|
|
|
|
{
|
|
|
|
if (index < 0 || index >= MAX_RIDES)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
log_error("invalid index %d for ride", index);
|
2018-01-29 17:06:01 +01:00
|
|
|
return nullptr;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
return &gRideList[index];
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
rct_ride_entry* get_ride_entry(int index)
|
|
|
|
{
|
|
|
|
if (index < 0 || index >= object_entry_group_counts[OBJECT_TYPE_RIDE])
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
log_error("invalid index %d for ride type", index);
|
2018-01-29 17:06:01 +01:00
|
|
|
return nullptr;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2017-10-12 21:07:35 +02:00
|
|
|
|
2017-10-15 15:53:16 +02:00
|
|
|
return gRideEntries[index];
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-11-02 09:04:27 +01:00
|
|
|
rct_ride_entry* get_ride_entry_by_ride(const Ride* ride)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
rct_ride_entry* type = get_ride_entry(ride->subtype);
|
|
|
|
if (type == nullptr)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
log_error("Invalid ride subtype for ride");
|
|
|
|
}
|
|
|
|
return type;
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
rct_sprite* get_sprite(size_t sprite_idx)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
assert(sprite_idx < MAX_SPRITES);
|
|
|
|
return &sprite_list[sprite_idx];
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-09-13 19:40:07 +02:00
|
|
|
bool TileElementBase::IsLastForTile() const
|
2018-05-24 13:13:51 +02:00
|
|
|
{
|
|
|
|
return (this->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0;
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-09-13 19:40:07 +02:00
|
|
|
uint8_t TileElementBase::GetType() const
|
2018-05-02 19:27:04 +02:00
|
|
|
{
|
|
|
|
return this->type & TILE_ELEMENT_TYPE_MASK;
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* map_get_first_element_at(int x, int y)
|
2018-06-22 22:29:03 +02:00
|
|
|
{
|
|
|
|
if (x < 0 || y < 0 || x > 255 || y > 255)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
log_error("Trying to access element outside of range");
|
2018-01-29 17:06:01 +01:00
|
|
|
return nullptr;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2017-10-31 14:03:45 +01:00
|
|
|
return gTileElementTilePointers[x + y * 256];
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
2019-02-10 00:32:16 +01:00
|
|
|
bool ride_type_has_flag(int rideType, uint32_t flag)
|
2016-08-24 13:19:25 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return (RideProperties[rideType].flags & flag) != 0;
|
2016-08-24 13:19:25 +02:00
|
|
|
}
|
2016-09-12 22:56:52 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
int16_t get_height_marker_offset()
|
2016-09-12 22:56:52 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return 0;
|
2016-09-12 22:56:52 +02:00
|
|
|
}
|
2016-10-01 19:03:31 +02:00
|
|
|
|
2018-09-18 14:06:38 +02:00
|
|
|
bool is_csg_loaded()
|
2016-10-01 19:03:31 +02:00
|
|
|
{
|
2018-09-18 14:06:38 +02:00
|
|
|
return false;
|
2016-10-01 19:03:31 +02:00
|
|
|
}
|
2016-10-09 00:20:29 +02:00
|
|
|
|
2018-09-18 14:06:38 +02:00
|
|
|
uint8_t TrackElement::GetSeatRotation() const
|
2017-04-11 19:53:52 +02:00
|
|
|
{
|
2018-09-18 14:06:38 +02:00
|
|
|
return colour >> 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetSeatRotation(uint8_t newSeatRotation)
|
|
|
|
{
|
|
|
|
colour &= 0x0F;
|
|
|
|
colour |= (newSeatRotation << 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TrackElement::IsTakingPhoto() const
|
|
|
|
{
|
|
|
|
return (sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetPhotoTimeout()
|
|
|
|
{
|
|
|
|
sequence &= MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK;
|
|
|
|
sequence |= (3 << 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::DecrementPhotoTimeout()
|
|
|
|
{
|
|
|
|
// We should only touch the upper 4 bits, avoid underflow into the lower 4.
|
|
|
|
if (sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK)
|
|
|
|
{
|
|
|
|
sequence -= (1 << 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16_t TrackElement::GetMazeEntry() const
|
|
|
|
{
|
|
|
|
return mazeEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetMazeEntry(uint16_t newMazeEntry)
|
|
|
|
{
|
|
|
|
mazeEntry = newMazeEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::MazeEntryAdd(uint16_t addVal)
|
|
|
|
{
|
|
|
|
mazeEntry |= addVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::MazeEntrySubtract(uint16_t subVal)
|
|
|
|
{
|
|
|
|
mazeEntry &= ~subVal;
|
2017-04-11 19:53:52 +02:00
|
|
|
}
|
2017-10-04 17:14:53 +02:00
|
|
|
|
2018-09-17 21:54:36 +02:00
|
|
|
uint8_t TrackElement::GetTrackType() const
|
2017-11-14 13:27:30 +01:00
|
|
|
{
|
2018-09-17 21:54:36 +02:00
|
|
|
return trackType;
|
2017-11-14 13:27:30 +01:00
|
|
|
}
|
|
|
|
|
2018-09-17 21:54:36 +02:00
|
|
|
void TrackElement::SetTrackType(uint8_t newType)
|
2017-11-14 13:27:30 +01:00
|
|
|
{
|
2018-09-17 21:54:36 +02:00
|
|
|
trackType = newType;
|
2017-11-15 09:23:01 +01:00
|
|
|
}
|
|
|
|
|
2018-09-17 22:10:15 +02:00
|
|
|
uint8_t TrackElement::GetSequenceIndex() const
|
|
|
|
{
|
|
|
|
return sequence & MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetSequenceIndex(uint8_t newSequenceIndex)
|
|
|
|
{
|
|
|
|
sequence &= ~MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK;
|
|
|
|
sequence |= (newSequenceIndex & MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK);
|
|
|
|
}
|
|
|
|
|
2018-09-18 14:06:38 +02:00
|
|
|
uint8_t TrackElement::GetStationIndex() const
|
|
|
|
{
|
|
|
|
return (sequence & MAP_ELEM_TRACK_SEQUENCE_STATION_INDEX_MASK) >> 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetStationIndex(uint8_t newStationIndex)
|
|
|
|
{
|
|
|
|
sequence &= ~MAP_ELEM_TRACK_SEQUENCE_STATION_INDEX_MASK;
|
|
|
|
sequence |= (newStationIndex << 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::GetDoorAState() const
|
|
|
|
{
|
|
|
|
return (colour & TRACK_ELEMENT_DOOR_A_MASK) >> 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::GetDoorBState() const
|
|
|
|
{
|
|
|
|
return (colour & TRACK_ELEMENT_DOOR_B_MASK) >> 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::GetRideIndex() const
|
|
|
|
{
|
|
|
|
return rideIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetRideIndex(uint8_t newRideIndex)
|
|
|
|
{
|
|
|
|
rideIndex = newRideIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::GetColourScheme() const
|
|
|
|
{
|
|
|
|
return colour & 0x3;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetColourScheme(uint8_t newColourScheme)
|
|
|
|
{
|
|
|
|
colour &= ~0x3;
|
|
|
|
colour |= (newColourScheme & 0x3);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TrackElement::HasCableLift() const
|
|
|
|
{
|
|
|
|
return colour & TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetHasCableLift(bool on)
|
|
|
|
{
|
|
|
|
colour &= ~TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
|
|
|
if (on)
|
|
|
|
colour |= TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TrackElement::IsInverted() const
|
|
|
|
{
|
|
|
|
return colour & TRACK_ELEMENT_COLOUR_FLAG_INVERTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetInverted(bool inverted)
|
|
|
|
{
|
|
|
|
if (inverted)
|
|
|
|
{
|
|
|
|
colour |= TRACK_ELEMENT_COLOUR_FLAG_INVERTED;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
colour &= ~TRACK_ELEMENT_COLOUR_FLAG_INVERTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::GetBrakeBoosterSpeed() const
|
|
|
|
{
|
|
|
|
return (sequence >> 4) << 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetBrakeBoosterSpeed(uint8_t speed)
|
|
|
|
{
|
|
|
|
sequence &= ~0b11110000;
|
|
|
|
sequence |= ((speed >> 1) << 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TrackElement::HasGreenLight() const
|
|
|
|
{
|
|
|
|
return (sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetHasGreenLight(uint8_t greenLight)
|
|
|
|
{
|
|
|
|
sequence &= ~MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT;
|
|
|
|
if (greenLight)
|
|
|
|
{
|
|
|
|
sequence |= MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TrackElement::HasChain() const
|
|
|
|
{
|
|
|
|
return type & TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrackElement::SetHasChain(bool on)
|
|
|
|
{
|
|
|
|
if (on)
|
|
|
|
{
|
|
|
|
type |= TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
type &= ~TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
TileCoordsXYZD ride_get_entrance_location(const Ride* ride, const int32_t stationIndex)
|
2018-03-07 19:10:50 +01:00
|
|
|
{
|
2019-01-01 02:14:19 +01:00
|
|
|
return ride->stations[stationIndex].Entrance;
|
2018-03-07 19:10:50 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
TileCoordsXYZD ride_get_exit_location(const Ride* ride, const int32_t stationIndex)
|
2018-03-07 19:10:50 +01:00
|
|
|
{
|
2019-01-01 02:14:19 +01:00
|
|
|
return ride->stations[stationIndex].Exit;
|
2018-05-15 12:54:58 +02:00
|
|
|
}
|
2018-09-15 23:32:19 +02:00
|
|
|
|
2018-09-23 12:01:58 +02:00
|
|
|
void TileElementBase::SetType(uint8_t newType)
|
|
|
|
{
|
|
|
|
this->type &= ~TILE_ELEMENT_TYPE_MASK;
|
|
|
|
this->type |= (newType & TILE_ELEMENT_TYPE_MASK);
|
|
|
|
}
|
|
|
|
|
2018-09-15 23:32:19 +02:00
|
|
|
uint8_t TileElementBase::GetDirection() const
|
|
|
|
{
|
|
|
|
return this->type & TILE_ELEMENT_DIRECTION_MASK;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t TileElementBase::GetDirectionWithOffset(uint8_t offset) const
|
|
|
|
{
|
|
|
|
return ((this->type & TILE_ELEMENT_DIRECTION_MASK) + offset) & TILE_ELEMENT_DIRECTION_MASK;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t SurfaceElement::GetSlope() const
|
|
|
|
{
|
|
|
|
return (slope & TILE_ELEMENT_SURFACE_SLOPE_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t SurfaceElement::GetWaterHeight() const
|
|
|
|
{
|
|
|
|
return terrain & TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK;
|
|
|
|
}
|
2018-10-03 11:39:33 +02:00
|
|
|
|
|
|
|
bool TrackElement::IsHighlighted() const
|
|
|
|
{
|
|
|
|
return (type & TILE_ELEMENT_TYPE_FLAG_HIGHLIGHT);
|
|
|
|
}
|
2018-10-05 13:11:44 +02:00
|
|
|
|
|
|
|
uint8_t PathElement::GetEdges() const
|
|
|
|
{
|
|
|
|
return edges & 0xF;
|
|
|
|
}
|
2018-12-05 21:33:45 +01:00
|
|
|
|
|
|
|
StationObject* ride_get_station_object(const Ride* ride)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|