mirror of https://github.com/OpenRCT2/OpenRCT2.git
Map unknown elem type to corrupt, update tile inspector
In map view, all unknown types are mapped to MAP_ELEMENT_TYPE_CORRUPT, the type that prevents rendering of all following elements on given tile. Tile inspector now displays element type (numeric value) for unknown types.
This commit is contained in:
parent
53970c2d77
commit
e3f5ea25ae
|
@ -1547,9 +1547,13 @@ static uint16 map_window_get_pixel_colour_peep(int x, int y)
|
|||
if (!(mapElement->properties.surface.ownership & OWNERSHIP_OWNED))
|
||||
colour = 10 | (colour & 0xFF00);
|
||||
|
||||
const size_t count = countof(ElementTypeAddColour);
|
||||
while (!map_element_is_last_for_tile(mapElement++)) {
|
||||
int mapElementType = map_element_get_type(mapElement) >> 2;
|
||||
assert(mapElementType < countof(ElementTypeMaskColour));
|
||||
if (mapElementType >= count)
|
||||
{
|
||||
mapElementType = MAP_ELEMENT_TYPE_CORRUPT >> 2;
|
||||
}
|
||||
colour &= ElementTypeMaskColour[mapElementType];
|
||||
colour |= ElementTypeAddColour[mapElementType];
|
||||
}
|
||||
|
|
|
@ -390,6 +390,11 @@ static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *
|
|||
);
|
||||
type_name = buffer;
|
||||
break;
|
||||
case MAP_ELEMENT_TYPE_CORRUPT:
|
||||
// fall-through
|
||||
default:
|
||||
sprintf(buffer, "Unknown (type %d)", type);
|
||||
type_name = buffer;
|
||||
}
|
||||
|
||||
gfx_draw_string(dpi, type_name, 12, x, y);
|
||||
|
|
|
@ -121,7 +121,10 @@ enum {
|
|||
MAP_ELEMENT_TYPE_ENTRANCE = (4 << 2),
|
||||
MAP_ELEMENT_TYPE_FENCE = (5 << 2),
|
||||
MAP_ELEMENT_TYPE_SCENERY_MULTIPLE = (6 << 2),
|
||||
MAP_ELEMENT_TYPE_BANNER = (7 << 2)
|
||||
MAP_ELEMENT_TYPE_BANNER = (7 << 2),
|
||||
// The corrupt element type is used for skipping drawing other following
|
||||
// elements on a given tile.
|
||||
MAP_ELEMENT_TYPE_CORRUPT = (8 << 2),
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
Loading…
Reference in New Issue