1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Fix 19853: Landscaping tool not indicating corners when choosing where to raise or lower land (#19857)

* Fix land marker palettes

* Appease Clang

* Remove one more magic number

---------

Co-authored-by: Trevor Finney <8711258+finneyt@users.noreply.github.com>
This commit is contained in:
kyphii
2023-04-07 01:12:55 -04:00
committed by GitHub
parent 70e97bd322
commit ce4ca96b27
2 changed files with 14 additions and 7 deletions

View File

@@ -192,10 +192,14 @@ enum class FilterPaletteID : int32_t
PaletteWater = COLOUR_COUNT,
Palette34 = PaletteWater + 2,
PaletteLandMarker,
Palette34,
Palette44 = Palette34 + 10, // Construction marker
Palette45, // Decolourise + lighten
PaletteWaterMarker = Palette34 + 4,
PaletteQuarterMarker,
Palette44 = PaletteQuarterMarker + 5, // Construction marker
Palette45, // Decolourise + lighten
Palette46,
PaletteDarken3,

View File

@@ -1220,7 +1220,9 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
{
// Walls
// Loc661089:
const auto fpId = static_cast<FilterPaletteID>((((mapSelectionType - 9) + rotation) & 3) + 0x21);
const auto fpId = static_cast<FilterPaletteID>(
(((mapSelectionType - MAP_SELECT_TYPE_EDGE_0 + 1) + rotation) & 3)
+ static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_EDGE + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0);
}
@@ -1229,7 +1231,8 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
// Loc661051:(no jump)
// Selection split into four quarter segments
const auto fpId = static_cast<FilterPaletteID>(
(((mapSelectionType - MAP_SELECT_TYPE_QUARTER_0) + rotation) & 3) + 0x27);
(((mapSelectionType - MAP_SELECT_TYPE_QUARTER_0) + rotation) & 3)
+ static_cast<uint32_t>(FilterPaletteID::PaletteQuarterMarker));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_QUARTER + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0);
}
@@ -1242,7 +1245,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
eax = (mapSelectionType + rotation) & 3;
}
const auto fpId = static_cast<FilterPaletteID>(eax + 0x21);
const auto fpId = static_cast<FilterPaletteID>(eax + static_cast<uint32_t>(FilterPaletteID::PaletteLandMarker));
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + Byte97B444[surfaceShape], fpId);
PaintAttachToPreviousPS(session, image_id, 0, 0);
}
@@ -1251,7 +1254,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
// The water tool should draw its grid _on_ the water, rather than on the surface under water.
auto [local_height, local_surfaceShape] = SurfaceGetHeightAboveWater(tileElement, height, surfaceShape);
const auto fpId = static_cast<FilterPaletteID>(38);
const auto fpId = FilterPaletteID::PaletteWaterMarker;
const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + Byte97B444[local_surfaceShape], fpId);
PaintStruct* backup = session.LastPS;