From ae92e5ae7ea40a905416cd1f1e24506b81f3901e Mon Sep 17 00:00:00 2001 From: frozensnowy Date: Sun, 1 Feb 2026 22:08:32 +0100 Subject: [PATCH] Refactor: Extract PaintTrack to Paint.Track.h Part of #25803 --- src/openrct2/libopenrct2.vcxproj | 1 + .../paint/tile_element/Paint.TileElement.cpp | 1 + .../paint/tile_element/Paint.TileElement.h | 3 --- src/openrct2/paint/tile_element/Paint.Track.h | 21 +++++++++++++++++++ src/openrct2/ride/TrackPaint.cpp | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 src/openrct2/paint/tile_element/Paint.Track.h diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index da81353136..7fe581db85 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -401,6 +401,7 @@ + diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 7fd9a91db9..0faa969944 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -35,6 +35,7 @@ #include "Paint.Path.h" #include "Paint.SmallScenery.h" #include "Paint.Surface.h" +#include "Paint.Track.h" #include "Paint.Wall.h" #include "Segment.h" diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index a0f9b9d417..a6175f78c3 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -16,7 +16,6 @@ namespace OpenRCT2 struct BannerElement; struct PathElement; struct SurfaceElement; - struct TrackElement; } // namespace OpenRCT2 struct PaintSession; @@ -50,6 +49,4 @@ void TileElementPaintSetup(PaintSession& session, const CoordsXY& mapCoords, boo void PaintBanner(PaintSession& session, uint8_t direction, int32_t height, const OpenRCT2::BannerElement& bannerElement); void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, const OpenRCT2::SurfaceElement& tileElement); -void PaintTrack(PaintSession& session, uint8_t direction, int32_t height, const OpenRCT2::TrackElement& tileElement); - bool PaintShouldShowHeightMarkers(const PaintSession& session, uint32_t viewportFlag); diff --git a/src/openrct2/paint/tile_element/Paint.Track.h b/src/openrct2/paint/tile_element/Paint.Track.h new file mode 100644 index 0000000000..fc4fe9eb04 --- /dev/null +++ b/src/openrct2/paint/tile_element/Paint.Track.h @@ -0,0 +1,21 @@ +/***************************************************************************** + * Copyright (c) 2014-2026 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include + +struct PaintSession; + +namespace OpenRCT2 +{ + struct TrackElement; +} + +void PaintTrack(PaintSession& session, uint8_t direction, int32_t height, const OpenRCT2::TrackElement& tileElement); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 4147ae1a49..da9f2c7a77 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -23,6 +23,7 @@ #include "../paint/support/MetalSupports.h" #include "../paint/support/WoodenSupports.h" #include "../paint/tile_element/Paint.TileElement.h" +#include "../paint/tile_element/Paint.Track.h" #include "../paint/tile_element/Segment.h" #include "../paint/track/Segment.h" #include "../paint/track/Support.h"