From 01d9be4609dcab1acb583a8a7cf161640599658d Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 9 Apr 2023 21:29:35 +0100 Subject: [PATCH] Name a lot of the palettes (#19889) --- src/openrct2/drawing/Drawing.h | 21 +++++++++++-------- src/openrct2/paint/Paint.h | 4 ++-- .../paint/tile_element/Paint.Banner.cpp | 4 ++-- .../paint/tile_element/Paint.Entrance.cpp | 8 +++---- .../paint/tile_element/Paint.LargeScenery.cpp | 4 ++-- .../paint/tile_element/Paint.Path.cpp | 10 ++++----- .../paint/tile_element/Paint.SmallScenery.cpp | 4 ++-- .../paint/tile_element/Paint.Surface.cpp | 11 +++++----- .../paint/tile_element/Paint.Wall.cpp | 4 ++-- src/openrct2/ride/VehiclePaint.cpp | 4 ++-- src/openrct2/ride/gentle/ObservationTower.cpp | 4 ++-- src/openrct2/ride/water/SubmarineRide.cpp | 4 ++-- 12 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index b5dc495f58..5cb8e66147 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -192,16 +192,19 @@ enum class FilterPaletteID : int32_t PaletteWater = COLOUR_COUNT, - PaletteLandMarker, - Palette34, - - Palette37 = Palette34 + 3, + PaletteLandMarker0, // North (corner/edge) + PaletteLandMarker1, // East (corner/edge) + PaletteLandMarker2, // South (corner/edge) + PaletteLandMarker3, // West (corner/edge) + PaletteSceneryGroundMarker, PaletteWaterMarker, - PaletteQuarterMarker, - - PaletteRideGroundMarker = PaletteQuarterMarker + 4, - Palette44, // Construction marker - Palette45, // Decolourise + lighten + PaletteQuarterMarker0, // North (not sure why it couldn't just use PaletteLandMarker0) + PaletteQuarterMarker1, // East + PaletteQuarterMarker2, // South + PaletteQuarterMarker3, // West + PaletteRideGroundMarker, + PaletteGhost, // Construction marker + Palette45, // Decolourise + lighten Palette46, PaletteDarken3, diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 7a0c3d26a3..d133f6417f 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -287,8 +287,8 @@ extern CoordsXY gClipSelectionA; extern CoordsXY gClipSelectionB; /** rct2: 0x00993CC4. The white ghost that indicates not-yet-built elements. */ -constexpr const ImageId ConstructionMarker = ImageId(0).WithRemap(FilterPaletteID::Palette44); -constexpr const ImageId HighlightMarker = ImageId(0).WithRemap(FilterPaletteID::Palette44); +constexpr const ImageId ConstructionMarker = ImageId(0).WithRemap(FilterPaletteID::PaletteGhost); +constexpr const ImageId HighlightMarker = ImageId(0).WithRemap(FilterPaletteID::PaletteGhost); constexpr const ImageId TrackGhost = ImageId(0, FilterPaletteID::PaletteNull); extern bool gShowDirtyVisuals; diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 386028deda..269533171b 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -101,11 +101,11 @@ void PaintBanner(PaintSession& session, uint8_t direction, int32_t height, const if (bannerElement.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&bannerElement))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else { diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index c6dfc5d83e..53a960c931 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -147,11 +147,11 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 if (entranceEl.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&entranceEl))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } // Format modified to stop repeated code @@ -275,11 +275,11 @@ static void PaintParkEntrance(PaintSession& session, uint8_t direction, int32_t if (entranceEl.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&entranceEl))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } auto& objManager = GetContext()->GetObjectManager(); diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index c6d2c90217..74350d2d61 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -359,12 +359,12 @@ void PaintLargeScenery(PaintSession& session, uint8_t direction, uint16_t height else if (tileElement.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); isGhost = true; } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&tileElement))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); isGhost = true; } else diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 96f31dd9dc..e26f576135 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -1049,18 +1049,18 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl if (tileElement.AdditionIsGhost()) { - sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } if (tileElement.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else if (TileInspector::IsElementSelected(reinterpret_cast(&tileElement))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); - sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); + sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } // For debugging purpose, show blocked tiles with a colour @@ -1072,7 +1072,7 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl // Draw wide flags as ghosts, leaving only the "walkable" paths to be drawn normally if (gPaintWidePathsAsGhost && tileElement.IsWide()) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } PaintPatrolAreas(session, tileElement); diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 2e4cce3329..63addceca6 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -344,11 +344,11 @@ void PaintSmallScenery(PaintSession& session, uint8_t direction, int32_t height, if (sceneryElement.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&sceneryElement))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); } PaintSmallSceneryBody(session, direction, height, sceneryElement, sceneryEntry, imageTemplate); diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index df8c29f699..9b4ed0507f 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1141,7 +1141,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con if (OpenRCT2::TileInspector::IsElementSelected(elementPtr)) { - imageId = imageId.WithRemap(FilterPaletteID::Palette44); + imageId = imageId.WithRemap(FilterPaletteID::PaletteGhost); } PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, -1 }); @@ -1222,7 +1222,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // Loc661089: const auto fpId = static_cast( (((mapSelectionType - MAP_SELECT_TYPE_EDGE_0 + 1) + rotation) & 3) - + static_cast(FilterPaletteID::PaletteLandMarker)); + + static_cast(FilterPaletteID::PaletteLandMarker0)); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_EDGE + Byte97B444[surfaceShape], fpId); PaintAttachToPreviousPS(session, image_id, 0, 0); } @@ -1232,7 +1232,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // Selection split into four quarter segments const auto fpId = static_cast( (((mapSelectionType - MAP_SELECT_TYPE_QUARTER_0) + rotation) & 3) - + static_cast(FilterPaletteID::PaletteQuarterMarker)); + + static_cast(FilterPaletteID::PaletteQuarterMarker0)); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_QUARTER + Byte97B444[surfaceShape], fpId); PaintAttachToPreviousPS(session, image_id, 0, 0); } @@ -1245,7 +1245,8 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con eax = (mapSelectionType + rotation) & 3; } - const auto fpId = static_cast(eax + static_cast(FilterPaletteID::PaletteLandMarker)); + const auto fpId = static_cast( + eax + static_cast(FilterPaletteID::PaletteLandMarker0)); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + Byte97B444[surfaceShape], fpId); PaintAttachToPreviousPS(session, image_id, 0, 0); } @@ -1275,7 +1276,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con continue; } - FilterPaletteID fpId = FilterPaletteID::Palette37; + FilterPaletteID fpId = FilterPaletteID::PaletteSceneryGroundMarker; if (gMapSelectFlags & MAP_SELECT_FLAG_GREEN) { fpId = FilterPaletteID::PaletteRideGroundMarker; diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index e277bddcf9..31478e9073 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -344,12 +344,12 @@ void PaintWall(PaintSession& session, uint8_t direction, int32_t height, const W if (wallElement.IsGhost()) { session.InteractionType = ViewportInteractionItem::None; - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); isGhost = true; } else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&wallElement))) { - imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); + imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost); isGhost = true; } diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 020dc44111..f7bf45c6e4 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -959,7 +959,7 @@ static void PaintVehicleRiders( auto imageId = ImageId(offsetImageId, peepColour0, peepColour1); if (vehicle->IsGhost()) { - imageId = ImageId(offsetImageId).WithRemap(FilterPaletteID::Palette44); + imageId = ImageId(offsetImageId).WithRemap(FilterPaletteID::PaletteGhost); } PaintAddImageAsChild( @@ -993,7 +993,7 @@ static void vehicle_sprite_paint( auto imageId = ImageId(baseImageId, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); if (vehicle->IsGhost()) { - imageId = ImageId(baseImageId).WithRemap(FilterPaletteID::Palette44); + imageId = ImageId(baseImageId).WithRemap(FilterPaletteID::PaletteGhost); } PaintAddImageAsParent( session, imageId, { 0, 0, z }, diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index e635ea55ea..a1a498fb48 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -69,8 +69,8 @@ void VehicleVisualObservationTower( auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); if (vehicle->IsGhost()) { - imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::Palette44); - imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::Palette44); + imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::PaletteGhost); + imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::PaletteGhost); } PaintAddImageAsParent(session, imageId0, { 0, 0, z }, { { -11, -11, z + 1 }, { 2, 2, 41 } }); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 53c07b6727..5d9da48e19 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -50,8 +50,8 @@ void VehicleVisualSubmarine( auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); if (vehicle->IsGhost()) { - imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::Palette44); - imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::Palette44); + imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::PaletteGhost); + imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::PaletteGhost); } const auto& bb = VehicleBoundboxes[carEntry->draw_order][OpenRCT2::Entity::Yaw::YawTo16(imageDirection)];