Skip to content

Commit

Permalink
Fix# 20672: Maze Ghost Elements (OpenRCT2#20746)
Browse files Browse the repository at this point in the history
* Fix maze construction ghost glitch

* Update changelog

* Clang format
  • Loading branch information
duncanspumpkin authored Aug 28, 2023
1 parent 3cffbcc commit b75275d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- Fix: [#20607] Infinite loop when renaming rides with default names longer than 32 bytes.
- Fix: [#20642] Track list is sometimes empty due to uninitialized data for the filter string.
- Fix: [#20659] Phantom rides remain when closing construction window while paused.
- Fix: [#20672] Maze ghost elements incorrectly displayed.
- Fix: [#20684] Footpath additions getting removed by Miniature railway ghost elements.
- Fix: [#20693] Incorrect information shown when hovering over station when another station before it was removed.
- Fix: [#20739] Build version info on title screen leaving stray pixels when the camera is moved.
Expand Down
25 changes: 10 additions & 15 deletions src/openrct2/ride/gentle/Maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,31 +155,26 @@ static void MazePaintSetup(
if (mazeEntry & (MAZE_ENTRY_FLAG_12 | MAZE_ENTRY_FLAG_13))
PaintAddImageAsParent(session, imageId, { 30, 0, height }, { { 30, 1, height + 2 }, { 1, 1, 9 } });

imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnTopLeft);
if (mazeEntry & (MAZE_ENTRY_FLAG_0 | MAZE_ENTRY_FLAG_13 | MAZE_ENTRY_FLAG_14))
PaintAddImageAsParent(
session, ImageId(baseImageId + SprMazeOffsetColumnTopLeft), { 14, 0, height },
{ { 15, 1, height + 2 }, { 2, 1, 9 } });
PaintAddImageAsParent(session, imageId, { 14, 0, height }, { { 15, 1, height + 2 }, { 2, 1, 9 } });

imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnBottomRight);
if (mazeEntry & (MAZE_ENTRY_FLAG_5 | MAZE_ENTRY_FLAG_6 | MAZE_ENTRY_FLAG_8))
PaintAddImageAsParent(
session, ImageId(baseImageId + SprMazeOffsetColumnBottomRight), { 14, 30, height },
{ { 15, 30, height + 2 }, { 2, 1, 9 } });
PaintAddImageAsParent(session, imageId, { 14, 30, height }, { { 15, 30, height + 2 }, { 2, 1, 9 } });

imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnTopRight);
if (mazeEntry & (MAZE_ENTRY_FLAG_1 | MAZE_ENTRY_FLAG_2 | MAZE_ENTRY_FLAG_4))
PaintAddImageAsParent(
session, ImageId(baseImageId + SprMazeOffsetColumnTopRight), { 0, 14, height },
{ { 1, 15, height + 2 }, { 1, 2, 9 } });
PaintAddImageAsParent(session, imageId, { 0, 14, height }, { { 1, 15, height + 2 }, { 1, 2, 9 } });

imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnBottomLeft);
if (mazeEntry & (MAZE_ENTRY_FLAG_9 | MAZE_ENTRY_FLAG_10 | MAZE_ENTRY_FLAG_12))
PaintAddImageAsParent(
session, ImageId(baseImageId + SprMazeOffsetColumnBottomLeft), { 30, 14, height },
{ { 30, 15, height + 2 }, { 1, 2, 9 } });
PaintAddImageAsParent(session, imageId, { 30, 14, height }, { { 30, 15, height + 2 }, { 1, 2, 9 } });

if (mazeEntry & (MAZE_ENTRY_FLAG_2 | MAZE_ENTRY_FLAG_6 | MAZE_ENTRY_FLAG_10 | MAZE_ENTRY_FLAG_14))
{
PaintAddImageAsParent(
session, ImageId(baseImageId + SprMazeOffsetColumnCentre), { 14, 14, height },
{ { 15, 15, height + 2 }, { 2, 2, 8 } });
imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnCentre);
PaintAddImageAsParent(session, imageId, { 14, 14, height }, { { 15, 15, height + 2 }, { 2, 2, 8 } });

PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, height + 12, 0x20);
}
Expand Down

0 comments on commit b75275d

Please sign in to comment.