mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #15118 from Gymnasiast/no-platforms
"No platforms" stations from NSF
This commit is contained in:
commit
193e9b0e11
|
@ -94,6 +94,7 @@ void StationObject::ReadJson(IReadObjectContext* context, json_t& root)
|
|||
{ "hasPrimaryColour", STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR },
|
||||
{ "hasSecondaryColour", STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR },
|
||||
{ "isTransparent", STATION_OBJECT_FLAGS::IS_TRANSPARENT },
|
||||
{ "noPlatforms", STATION_OBJECT_FLAGS::NO_PLATFORMS },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace STATION_OBJECT_FLAGS
|
|||
const uint32_t HAS_PRIMARY_COLOUR = 1 << 0;
|
||||
const uint32_t HAS_SECONDARY_COLOUR = 1 << 1;
|
||||
const uint32_t IS_TRANSPARENT = 1 << 2;
|
||||
const uint32_t NO_PLATFORMS = 1 << 3;
|
||||
} // namespace STATION_OBJECT_FLAGS
|
||||
|
||||
class StationObject final : public Object
|
||||
|
|
|
@ -204,6 +204,10 @@ enum
|
|||
bool track_paint_util_has_fence(
|
||||
enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation)
|
||||
{
|
||||
const auto* stationObject = ride_get_station_object(ride);
|
||||
if (stationObject != nullptr && stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return false;
|
||||
|
||||
TileCoordsXY offset;
|
||||
switch (edge)
|
||||
{
|
||||
|
@ -231,8 +235,12 @@ bool track_paint_util_has_fence(
|
|||
}
|
||||
|
||||
void track_paint_util_paint_floor(
|
||||
paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4])
|
||||
paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4],
|
||||
const StationObject* stationStyle)
|
||||
{
|
||||
if (stationStyle != nullptr && stationStyle->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return;
|
||||
|
||||
uint32_t imageId;
|
||||
|
||||
if (edges & EDGE_SW && edges & EDGE_SE)
|
||||
|
@ -331,6 +339,9 @@ static void track_paint_util_draw_station_impl(
|
|||
auto stationObj = ride_get_station_object(ride);
|
||||
const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight();
|
||||
|
||||
if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return;
|
||||
|
||||
bool hasFence;
|
||||
uint32_t imageId;
|
||||
|
||||
|
@ -539,6 +550,9 @@ void track_paint_util_draw_station_inverted(
|
|||
auto stationObj = ride_get_station_object(ride);
|
||||
const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight();
|
||||
|
||||
if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return;
|
||||
|
||||
bool hasFence;
|
||||
uint32_t imageId;
|
||||
|
||||
|
@ -838,11 +852,14 @@ bool track_paint_util_draw_station_covers_2(
|
|||
return true;
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station_platform(
|
||||
void track_paint_util_draw_narrow_station_platform(
|
||||
paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return;
|
||||
|
||||
if (direction & 1)
|
||||
{
|
||||
bool hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation);
|
||||
|
@ -887,6 +904,9 @@ void track_paint_util_draw_pier(
|
|||
paint_session* session, Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction,
|
||||
int32_t height, const TileElement* tileElement, uint8_t rotation)
|
||||
{
|
||||
if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)
|
||||
return;
|
||||
|
||||
bool hasFence;
|
||||
uint32_t imageId;
|
||||
|
||||
|
|
|
@ -280,7 +280,8 @@ extern const size_t mini_golf_peep_animation_lengths[];
|
|||
bool track_paint_util_has_fence(
|
||||
enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation);
|
||||
void track_paint_util_paint_floor(
|
||||
paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4]);
|
||||
paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4],
|
||||
const StationObject* stationStyle);
|
||||
void track_paint_util_paint_fences(
|
||||
paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride,
|
||||
uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation);
|
||||
|
@ -289,7 +290,7 @@ bool track_paint_util_draw_station_covers(
|
|||
bool track_paint_util_draw_station_covers_2(
|
||||
paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height,
|
||||
uint8_t stationVariant);
|
||||
void track_paint_util_draw_station_platform(
|
||||
void track_paint_util_draw_narrow_station_platform(
|
||||
paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement);
|
||||
void track_paint_util_draw_station(
|
||||
paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement);
|
||||
|
|
|
@ -220,7 +220,7 @@ static void air_powered_vertical_rc_track_station(
|
|||
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 5, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement);
|
||||
|
||||
paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ void bolliger_mabillard_track_station(
|
|||
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 9, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 9, tileElement);
|
||||
|
||||
paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT);
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace HybridRC
|
|||
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 10, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, tileElement);
|
||||
|
||||
paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT);
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
|
|
|
@ -254,7 +254,7 @@ static void paint_reverse_freefall_rc_station(
|
|||
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 5, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement);
|
||||
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
paint_util_set_general_support_height(session, height + 32, 0x20);
|
||||
|
|
|
@ -62,9 +62,13 @@ static void paint_circus(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -72,9 +72,13 @@ static void paint_crooked_house(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -151,12 +151,16 @@ static void paint_ferris_wheel(
|
|||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
uint32_t imageId;
|
||||
uint8_t rotation = session->CurrentRotation;
|
||||
uint32_t colourFlags = session->TrackColours[SCHEME_MISC];
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, rotation))
|
||||
|
|
|
@ -104,9 +104,13 @@ static void paint_haunted_house(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -113,9 +113,13 @@ static void paint_merry_go_round(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -102,7 +102,8 @@ static void paint_space_rings(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
StationObject* stationObject = ride_get_station_object(ride);
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
switch (trackSequence)
|
||||
{
|
||||
|
|
|
@ -62,9 +62,13 @@ static void paint_3d_cinema(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -92,7 +92,8 @@ static void paint_enterprise(
|
|||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
StationObject* stationObject = ride_get_station_object(ride);
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope,
|
||||
|
|
|
@ -140,9 +140,14 @@ static void paint_motionsimulator(
|
|||
int32_t edges = edges_2x2[trackSequence];
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -257,9 +257,13 @@ static void paint_top_spin(
|
|||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
auto ride = get_ride(rideIndex);
|
||||
StationObject* stationObject = nullptr;
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
|
||||
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
|
|
|
@ -94,7 +94,8 @@ static void paint_twist(
|
|||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork);
|
||||
StationObject* stationObject = ride_get_station_object(ride);
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject);
|
||||
|
||||
switch (trackSequence)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "../../common.h"
|
||||
#include "../../interface/Viewport.h"
|
||||
#include "../../object/StationObject.h"
|
||||
#include "../../paint/Paint.h"
|
||||
#include "../../paint/Supports.h"
|
||||
#include "../../world/Map.h"
|
||||
|
@ -458,16 +459,23 @@ static void paint_monorail_station(
|
|||
const TileElement* tileElement)
|
||||
{
|
||||
uint32_t imageId;
|
||||
const StationObject* stationObject = nullptr;
|
||||
const auto* ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
stationObject = ride_get_station_object(ride);
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
if (stationObject == nullptr || !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS))
|
||||
{
|
||||
imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC];
|
||||
PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height);
|
||||
}
|
||||
else if (direction == 1 || direction == 3)
|
||||
{
|
||||
imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC];
|
||||
PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height);
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC];
|
||||
PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height);
|
||||
}
|
||||
else if (direction == 1 || direction == 3)
|
||||
{
|
||||
imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC];
|
||||
PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height);
|
||||
}
|
||||
}
|
||||
|
||||
imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
|
|
@ -325,7 +325,7 @@ static void paint_river_rapids_station(
|
|||
paint_river_rapids_track_flat(session, rideIndex, trackSequence, direction, height, tileElement);
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 12, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, tileElement);
|
||||
paint_util_set_general_support_height(session, height + 32, 0x20);
|
||||
}
|
||||
|
||||
|
|
|
@ -811,7 +811,7 @@ static void paint_splash_boats_station(
|
|||
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
track_paint_util_draw_station_platform(session, ride, direction, height, 7, tileElement);
|
||||
track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, tileElement);
|
||||
|
||||
paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT);
|
||||
|
||||
|
|
Loading…
Reference in New Issue