1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-21 06:43:04 +01:00

Name a lot of the palettes (#19889)

This commit is contained in:
Duncan
2023-04-09 21:29:35 +01:00
committed by GitHub
parent 3d5cb20ca6
commit 01d9be4609
12 changed files with 43 additions and 39 deletions

View File

@@ -192,16 +192,19 @@ enum class FilterPaletteID : int32_t
PaletteWater = COLOUR_COUNT, PaletteWater = COLOUR_COUNT,
PaletteLandMarker, PaletteLandMarker0, // North (corner/edge)
Palette34, PaletteLandMarker1, // East (corner/edge)
PaletteLandMarker2, // South (corner/edge)
Palette37 = Palette34 + 3, PaletteLandMarker3, // West (corner/edge)
PaletteSceneryGroundMarker,
PaletteWaterMarker, PaletteWaterMarker,
PaletteQuarterMarker, PaletteQuarterMarker0, // North (not sure why it couldn't just use PaletteLandMarker0)
PaletteQuarterMarker1, // East
PaletteRideGroundMarker = PaletteQuarterMarker + 4, PaletteQuarterMarker2, // South
Palette44, // Construction marker PaletteQuarterMarker3, // West
Palette45, // Decolourise + lighten PaletteRideGroundMarker,
PaletteGhost, // Construction marker
Palette45, // Decolourise + lighten
Palette46, Palette46,
PaletteDarken3, PaletteDarken3,

View File

@@ -287,8 +287,8 @@ extern CoordsXY gClipSelectionA;
extern CoordsXY gClipSelectionB; extern CoordsXY gClipSelectionB;
/** rct2: 0x00993CC4. The white ghost that indicates not-yet-built elements. */ /** rct2: 0x00993CC4. The white ghost that indicates not-yet-built elements. */
constexpr const ImageId ConstructionMarker = ImageId(0).WithRemap(FilterPaletteID::Palette44); constexpr const ImageId ConstructionMarker = ImageId(0).WithRemap(FilterPaletteID::PaletteGhost);
constexpr const ImageId HighlightMarker = ImageId(0).WithRemap(FilterPaletteID::Palette44); constexpr const ImageId HighlightMarker = ImageId(0).WithRemap(FilterPaletteID::PaletteGhost);
constexpr const ImageId TrackGhost = ImageId(0, FilterPaletteID::PaletteNull); constexpr const ImageId TrackGhost = ImageId(0, FilterPaletteID::PaletteNull);
extern bool gShowDirtyVisuals; extern bool gShowDirtyVisuals;

View File

@@ -101,11 +101,11 @@ void PaintBanner(PaintSession& session, uint8_t direction, int32_t height, const
if (bannerElement.IsGhost()) if (bannerElement.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&bannerElement))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&bannerElement)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else else
{ {

View File

@@ -147,11 +147,11 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3
if (entranceEl.IsGhost()) if (entranceEl.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&entranceEl))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&entranceEl)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
// Format modified to stop repeated code // Format modified to stop repeated code
@@ -275,11 +275,11 @@ static void PaintParkEntrance(PaintSession& session, uint8_t direction, int32_t
if (entranceEl.IsGhost()) if (entranceEl.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&entranceEl))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&entranceEl)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
auto& objManager = GetContext()->GetObjectManager(); auto& objManager = GetContext()->GetObjectManager();

View File

@@ -359,12 +359,12 @@ void PaintLargeScenery(PaintSession& session, uint8_t direction, uint16_t height
else if (tileElement.IsGhost()) else if (tileElement.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
isGhost = true; isGhost = true;
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&tileElement))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&tileElement)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
isGhost = true; isGhost = true;
} }
else else

View File

@@ -1049,18 +1049,18 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl
if (tileElement.AdditionIsGhost()) if (tileElement.AdditionIsGhost())
{ {
sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
if (tileElement.IsGhost()) if (tileElement.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else if (TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&tileElement))) else if (TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&tileElement)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
// For debugging purpose, show blocked tiles with a colour // 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 // Draw wide flags as ghosts, leaving only the "walkable" paths to be drawn normally
if (gPaintWidePathsAsGhost && tileElement.IsWide()) if (gPaintWidePathsAsGhost && tileElement.IsWide())
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintPatrolAreas(session, tileElement); PaintPatrolAreas(session, tileElement);

View File

@@ -344,11 +344,11 @@ void PaintSmallScenery(PaintSession& session, uint8_t direction, int32_t height,
if (sceneryElement.IsGhost()) if (sceneryElement.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&sceneryElement))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&sceneryElement)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintSmallSceneryBody(session, direction, height, sceneryElement, sceneryEntry, imageTemplate); PaintSmallSceneryBody(session, direction, height, sceneryElement, sceneryEntry, imageTemplate);

View File

@@ -1141,7 +1141,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
if (OpenRCT2::TileInspector::IsElementSelected(elementPtr)) if (OpenRCT2::TileInspector::IsElementSelected(elementPtr))
{ {
imageId = imageId.WithRemap(FilterPaletteID::Palette44); imageId = imageId.WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, -1 }); 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: // Loc661089:
const auto fpId = static_cast<FilterPaletteID>( const auto fpId = static_cast<FilterPaletteID>(
(((mapSelectionType - MAP_SELECT_TYPE_EDGE_0 + 1) + rotation) & 3) (((mapSelectionType - MAP_SELECT_TYPE_EDGE_0 + 1) + rotation) & 3)
+ static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker)); + static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker0));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_EDGE + Byte97B444[surfaceShape], fpId); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_EDGE + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0); 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 // Selection split into four quarter segments
const auto fpId = static_cast<FilterPaletteID>( const auto fpId = static_cast<FilterPaletteID>(
(((mapSelectionType - MAP_SELECT_TYPE_QUARTER_0) + rotation) & 3) (((mapSelectionType - MAP_SELECT_TYPE_QUARTER_0) + rotation) & 3)
+ static_cast<uint32_t>(FilterPaletteID::PaletteQuarterMarker)); + static_cast<uint32_t>(FilterPaletteID::PaletteQuarterMarker0));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_QUARTER + Byte97B444[surfaceShape], fpId); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_QUARTER + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0); 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; eax = (mapSelectionType + rotation) & 3;
} }
const auto fpId = static_cast<FilterPaletteID>(eax + static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker)); const auto fpId = static_cast<FilterPaletteID>(
eax + static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker0));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + Byte97B444[surfaceShape], fpId); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0); PaintAttachToPreviousPS(session, image_id, 0, 0);
} }
@@ -1275,7 +1276,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
continue; continue;
} }
FilterPaletteID fpId = FilterPaletteID::Palette37; FilterPaletteID fpId = FilterPaletteID::PaletteSceneryGroundMarker;
if (gMapSelectFlags & MAP_SELECT_FLAG_GREEN) if (gMapSelectFlags & MAP_SELECT_FLAG_GREEN)
{ {
fpId = FilterPaletteID::PaletteRideGroundMarker; fpId = FilterPaletteID::PaletteRideGroundMarker;

View File

@@ -344,12 +344,12 @@ void PaintWall(PaintSession& session, uint8_t direction, int32_t height, const W
if (wallElement.IsGhost()) if (wallElement.IsGhost())
{ {
session.InteractionType = ViewportInteractionItem::None; session.InteractionType = ViewportInteractionItem::None;
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
isGhost = true; isGhost = true;
} }
else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&wallElement))) else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast<const TileElement*>(&wallElement)))
{ {
imageTemplate = ImageId().WithRemap(FilterPaletteID::Palette44); imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
isGhost = true; isGhost = true;
} }

View File

@@ -959,7 +959,7 @@ static void PaintVehicleRiders(
auto imageId = ImageId(offsetImageId, peepColour0, peepColour1); auto imageId = ImageId(offsetImageId, peepColour0, peepColour1);
if (vehicle->IsGhost()) if (vehicle->IsGhost())
{ {
imageId = ImageId(offsetImageId).WithRemap(FilterPaletteID::Palette44); imageId = ImageId(offsetImageId).WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintAddImageAsChild( PaintAddImageAsChild(
@@ -993,7 +993,7 @@ static void vehicle_sprite_paint(
auto imageId = ImageId(baseImageId, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); auto imageId = ImageId(baseImageId, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary);
if (vehicle->IsGhost()) if (vehicle->IsGhost())
{ {
imageId = ImageId(baseImageId).WithRemap(FilterPaletteID::Palette44); imageId = ImageId(baseImageId).WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintAddImageAsParent( PaintAddImageAsParent(
session, imageId, { 0, 0, z }, session, imageId, { 0, 0, z },

View File

@@ -69,8 +69,8 @@ void VehicleVisualObservationTower(
auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary);
if (vehicle->IsGhost()) if (vehicle->IsGhost())
{ {
imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::Palette44); imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::PaletteGhost);
imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::Palette44); imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::PaletteGhost);
} }
PaintAddImageAsParent(session, imageId0, { 0, 0, z }, { { -11, -11, z + 1 }, { 2, 2, 41 } }); PaintAddImageAsParent(session, imageId0, { 0, 0, z }, { { -11, -11, z + 1 }, { 2, 2, 41 } });

View File

@@ -50,8 +50,8 @@ void VehicleVisualSubmarine(
auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary); auto imageId1 = ImageId(baseImageId + 1, vehicle->colours.Body, vehicle->colours.Trim, vehicle->colours.Tertiary);
if (vehicle->IsGhost()) if (vehicle->IsGhost())
{ {
imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::Palette44); imageId0 = ImageId(baseImageId + 0).WithRemap(FilterPaletteID::PaletteGhost);
imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::Palette44); imageId1 = ImageId(baseImageId + 1).WithRemap(FilterPaletteID::PaletteGhost);
} }
const auto& bb = VehicleBoundboxes[carEntry->draw_order][OpenRCT2::Entity::Yaw::YawTo16(imageDirection)]; const auto& bb = VehicleBoundboxes[carEntry->draw_order][OpenRCT2::Entity::Yaw::YawTo16(imageDirection)];