Skip to content

Commit

Permalink
Add RCTC Booster offsets into sprites.json
Browse files Browse the repository at this point in the history
Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
  • Loading branch information
Harry-Hopkinson and Gymnasiast authored Jan 26, 2024
1 parent 73183f6 commit a14d471
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
24 changes: 18 additions & 6 deletions resources/g2/sprites.json
Original file line number Diff line number Diff line change
Expand Up @@ -2656,10 +2656,14 @@
"palette": "keep"
},
{
"path": "track/intamin/booster_1.png"
"path": "track/intamin/booster_1.png",
"x_offset": -22,
"y_offset": -4
},
{
"path": "track/intamin/booster_2.png"
"path": "track/intamin/booster_2.png",
"x_offset": -22,
"y_offset": -4
},
{
"path": "track/intamin/brake_horizontal_background_open.png",
Expand Down Expand Up @@ -6286,10 +6290,14 @@
"palette": "keep"
},
{
"path": "track/mini/booster_1.png"
"path": "track/mini/booster_1.png",
"x_offset": -22,
"y_offset": -4
},
{
"path": "track/mini/booster_2.png"
"path": "track/mini/booster_2.png",
"x_offset": -22,
"y_offset": -4
},
{
"path": "track/bm/brake_horizontal.png",
Expand Down Expand Up @@ -6328,10 +6336,14 @@
"palette": "keep"
},
{
"path": "track/bm/booster_1.png"
"path": "track/bm/booster_1.png",
"x_offset": -25,
"y_offset": -5
},
{
"path": "track/bm/booster_2.png"
"path": "track/bm/booster_2.png",
"x_offset": -25,
"y_offset": -5
},
{
"path": "track/railway/quarter_turn_3_tiles_sw_se_part_3.png",
Expand Down
14 changes: 4 additions & 10 deletions src/openrct2/ride/coaster/BolligerMabillardTrack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12637,25 +12637,19 @@ void BolligerMabillardTrackBooster(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
// These offsets could be moved to the g2.dat file when that supports offsets.
int8_t ne_sw_offsetX = 8;
int8_t ne_sw_offsetY = -17;
int8_t nw_se_offsetX = -17;
int8_t nw_se_offsetY = 8;

switch (direction)
{
case 0:
case 2:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_BM_BOOSTER_NE_SW),
{ ne_sw_offsetX, ne_sw_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_BM_BOOSTER_NE_SW), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
break;
case 1:
case 3:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_BM_BOOSTER_NW_SE),
{ nw_se_offsetX, nw_se_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_BM_BOOSTER_NW_SE), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
break;
}
if (TrackPaintUtilShouldPaintSupports(session.MapPosition))
Expand Down
14 changes: 4 additions & 10 deletions src/openrct2/ride/coaster/GigaCoaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9453,25 +9453,19 @@ static void GigaRCTrackBooster(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
// These offsets could be moved to the g2.dat file when that supports offsets.
int8_t ne_sw_offsetX = 7;
int8_t ne_sw_offsetY = -15;
int8_t nw_se_offsetX = -15;
int8_t nw_se_offsetY = 7;

switch (direction)
{
case 0:
case 2:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_GIGA_RC_BOOSTER_NE_SW),
{ ne_sw_offsetX, ne_sw_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_GIGA_RC_BOOSTER_NE_SW), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
break;
case 1:
case 3:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_GIGA_RC_BOOSTER_NW_SE),
{ nw_se_offsetX, nw_se_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_GIGA_RC_BOOSTER_NW_SE), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
break;
}
if (TrackPaintUtilShouldPaintSupports(session.MapPosition))
Expand Down
14 changes: 4 additions & 10 deletions src/openrct2/ride/coaster/MiniRollerCoaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9508,19 +9508,13 @@ static void MiniRCTrackBooster(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
// These offsets could be moved to the g2.dat file when that supports offsets.
int8_t ne_sw_offsetX = 7;
int8_t ne_sw_offsetY = -15;
int8_t nw_se_offsetX = -15;
int8_t nw_se_offsetY = 7;

switch (direction)
{
case 0:
case 2:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NE_SW),
{ ne_sw_offsetX, ne_sw_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NE_SW), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
if (TrackPaintUtilShouldPaintSupports(session.MapPosition))
{
MetalASupportsPaintSetup(
Expand All @@ -9530,8 +9524,8 @@ static void MiniRCTrackBooster(
case 1:
case 3:
PaintAddImageAsParentRotated(
session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NW_SE),
{ nw_se_offsetX, nw_se_offsetY, height }, { { 0, 6, height }, { 32, 20, 3 } });
session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NW_SE), { 0, 0, height },
{ { 0, 6, height }, { 32, 20, 3 } });
if (TrackPaintUtilShouldPaintSupports(session.MapPosition))
{
MetalASupportsPaintSetup(
Expand Down

0 comments on commit a14d471

Please sign in to comment.