Skip to content

Commit

Permalink
Update support drawing for thrill rides and water rides
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Nov 24, 2023
1 parent efea009 commit f0e01da
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 84 deletions.
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/3dCinema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ static void Paint3dCinema(

int32_t edges = edges_3x3[trackSequence];

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();

Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/Enterprise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ static void PaintEnterprise(

int32_t edges = edges_4x4[trackSequence];

WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();
TrackPaintUtilPaintFloor(session, edges, session.TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject);
Expand Down
60 changes: 45 additions & 15 deletions src/openrct2/ride/thrill/GoKarts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ static void PaintGoKartsTrackFlat(
PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT);
}

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS]);

PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0);
PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20);
Expand Down Expand Up @@ -190,19 +192,27 @@ static void PaintGoKartsTrack25DegUp(
switch (direction)
{
case 0:
WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25Deg);
PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7);
break;
case 1:
WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25Deg);
PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8);
break;
case 2:
WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25Deg);
PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8);
break;
case 3:
WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25Deg);
PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7);
break;
}
Expand Down Expand Up @@ -244,19 +254,27 @@ static void PaintGoKartsTrackFlatTo25DegUp(
switch (direction)
{
case 0:
WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::FlatToUp25Deg);
PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT);
break;
case 1:
WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::FlatToUp25Deg);
PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8);
break;
case 2:
WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::FlatToUp25Deg);
PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8);
break;
case 3:
WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::FlatToUp25Deg);
PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT);
break;
}
Expand Down Expand Up @@ -298,19 +316,27 @@ static void PaintGoKartsTrack25DegUpToFlat(
switch (direction)
{
case 0:
WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25DegToFlat);
PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT);
break;
case 1:
WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25DegToFlat);
PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14);
break;
case 2:
WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25DegToFlat);
PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14);
break;
case 3:
WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS], WoodenSupportTransitionType::Up25DegToFlat);
PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT);
break;
}
Expand Down Expand Up @@ -446,7 +472,9 @@ static void PaintGoKartsStation(
}
}

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS]);

PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0);
PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20);
Expand Down Expand Up @@ -516,7 +544,9 @@ static void PaintGoKartsTrackLeftQuarterTurn1Tile(
break;
}

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS]);

PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0);
PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20);
Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/LaunchedFreefall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ static void PaintLaunchedFreefallBase(

int32_t edges = edges_3x3[trackSequence];

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();

Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/MotionSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ static void PaintMotionSimulator(

int32_t edges = edges_2x2[trackSequence];

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();

Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/RotoDrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static void PaintRotoDropBase(

int32_t edges = edges_3x3[trackSequence];

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();

Expand Down
4 changes: 3 additions & 1 deletion src/openrct2/ride/thrill/SwingingShip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ static void PaintSwingingShip(

if (relativeTrackSequence == 1 || relativeTrackSequence == 4)
{
WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height,
session.TrackColours[SCHEME_SUPPORTS]);
}
else if (direction & 1)
{
Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/TopSpin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ static void PaintTopSpin(

int32_t edges = edges_3x3[trackSequence];

WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();

Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/ride/thrill/Twist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static void PaintTwist(

ImageId imageId;

WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]);
WoodenASupportsPaintSetupRotated(
session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.TrackColours[SCHEME_MISC]);

const StationObject* stationObject = ride.GetStationObject();
TrackPaintUtilPaintFloor(session, edges, session.TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject);
Expand Down
Loading

0 comments on commit f0e01da

Please sign in to comment.