Skip to content

Commit

Permalink
Merge pull request #8427 from Mikroscopic/minimap-fix
Browse files Browse the repository at this point in the history
Fix #8385: Ghost objects rendered in minimap
  • Loading branch information
Gymnasiast committed May 14, 2019
2 parents abc1342 + 710da03 commit c9cbe39
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Feature: [#8963] Add missing Czech letters to sprite font, use sprite font for Czech.
- Feature: [#9154] Change map toolbar icon with current viewport rotation.
- Change: [#7877] Files are now sorted in logical rather than dictionary order.
- Change: [#8427] Ghost elements now show up as white on the mini-map.
- Change: [#8688] Move common actions from debug menu into cheats menu.
- Fix: [#2294] Clients crashing the server with invalid object selection.
- Fix: [#5103] OpenGL: ride track preview not rendered.
Expand Down
13 changes: 13 additions & 0 deletions src/openrct2-ui/windows/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ static void window_map_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
g1temp.x_offset = -8;
g1temp.y_offset = -8;
gfx_set_g1_element(SPR_TEMP, &g1temp);
drawing_engine_invalidate_image(SPR_TEMP);
gfx_draw_sprite(dpi, SPR_TEMP, 0, 0, 0);

if (w->selected_tab == PAGE_PEEPS)
Expand Down Expand Up @@ -1551,6 +1552,12 @@ static uint16_t map_window_get_pixel_colour_peep(CoordsXY c)
const int32_t maxSupportedTileElementType = (int32_t)std::size(ElementTypeAddColour);
while (!(tileElement++)->IsLastForTile())
{
if (tileElement->IsGhost())
{
colour = MAP_COLOUR(PALETTE_INDEX_21);
break;
}

int32_t tileElementType = tileElement->GetType() >> 2;
if (tileElementType >= maxSupportedTileElementType)
{
Expand All @@ -1573,6 +1580,12 @@ static uint16_t map_window_get_pixel_colour_ride(CoordsXY c)
TileElement* tileElement = map_get_surface_element_at(c);
do
{
if (tileElement->IsGhost())
{
colourA = MAP_COLOUR(PALETTE_INDEX_21);
break;
}

switch (tileElement->GetType())
{
case TILE_ELEMENT_TYPE_SURFACE:
Expand Down

0 comments on commit c9cbe39

Please sign in to comment.