Merge branch 'master' into jgrpp
# Conflicts: # src/core/strong_typedef_type.hpp # src/gfx.cpp # src/group_cmd.cpp # src/industry_cmd.cpp # src/map_func.h # src/newgrf_debug_gui.cpp # src/order_cmd.cpp # src/pathfinder/follow_track.hpp # src/rail_cmd.cpp # src/road_cmd.cpp # src/road_gui.cpp # src/saveload/saveload.cpp # src/screenshot.cpp # src/smallmap_gui.cpp # src/station_cmd.cpp # src/strings.cpp # src/tile_type.h # src/timetable_gui.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/viewport.cpp
This commit is contained in:
@@ -1826,9 +1826,6 @@ static void ViewportAddKdtreeSigns(ViewportDrawerDynamic *vdd, DrawPixelInfo *dp
|
||||
bool show_competitors = HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS) && !towns_only;
|
||||
bool hide_hidden_waypoints = _settings_client.gui.allow_hiding_waypoint_labels && !HasBit(_extra_display_opt, XDO_SHOW_HIDDEN_SIGNS);
|
||||
|
||||
const BaseStation *st;
|
||||
const Sign *si;
|
||||
|
||||
/* Collect all the items first and draw afterwards, to ensure layering */
|
||||
std::vector<const BaseStation *> stations;
|
||||
std::vector<const Town *> towns;
|
||||
@@ -1836,19 +1833,20 @@ static void ViewportAddKdtreeSigns(ViewportDrawerDynamic *vdd, DrawPixelInfo *dp
|
||||
|
||||
_viewport_sign_kdtree.FindContained(search_rect.left, search_rect.top, search_rect.right, search_rect.bottom, [&](const ViewportSignKdtreeItem & item) {
|
||||
switch (item.type) {
|
||||
case ViewportSignKdtreeItem::VKI_STATION:
|
||||
case ViewportSignKdtreeItem::VKI_STATION: {
|
||||
if (!show_stations) break;
|
||||
st = BaseStation::Get(item.id.station);
|
||||
const BaseStation *st = BaseStation::Get(item.id.station);
|
||||
|
||||
/* Don't draw if station is owned by another company and competitor station names are hidden. Stations owned by none are never ignored. */
|
||||
if (!show_competitors && _local_company != st->owner && st->owner != OWNER_NONE) break;
|
||||
|
||||
stations.push_back(st);
|
||||
break;
|
||||
}
|
||||
|
||||
case ViewportSignKdtreeItem::VKI_WAYPOINT:
|
||||
case ViewportSignKdtreeItem::VKI_WAYPOINT: {
|
||||
if (!show_waypoints) break;
|
||||
st = BaseStation::Get(item.id.station);
|
||||
const BaseStation *st = BaseStation::Get(item.id.station);
|
||||
|
||||
/* Don't draw if station is owned by another company and competitor station names are hidden. Stations owned by none are never ignored. */
|
||||
if (!show_competitors && _local_company != st->owner && st->owner != OWNER_NONE) break;
|
||||
@@ -1856,15 +1854,16 @@ static void ViewportAddKdtreeSigns(ViewportDrawerDynamic *vdd, DrawPixelInfo *dp
|
||||
|
||||
stations.push_back(st);
|
||||
break;
|
||||
}
|
||||
|
||||
case ViewportSignKdtreeItem::VKI_TOWN:
|
||||
if (!show_towns) break;
|
||||
towns.push_back(Town::Get(item.id.town));
|
||||
break;
|
||||
|
||||
case ViewportSignKdtreeItem::VKI_SIGN:
|
||||
case ViewportSignKdtreeItem::VKI_SIGN: {
|
||||
if (!show_signs) break;
|
||||
si = Sign::Get(item.id.sign);
|
||||
const Sign *si = Sign::Get(item.id.sign);
|
||||
|
||||
/* Don't draw if sign is owned by another company and competitor signs should be hidden.
|
||||
* Note: It is intentional that also signs owned by OWNER_NONE are hidden. Bankrupt
|
||||
@@ -1873,6 +1872,7 @@ static void ViewportAddKdtreeSigns(ViewportDrawerDynamic *vdd, DrawPixelInfo *dp
|
||||
|
||||
signs.push_back(si);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
NOT_REACHED();
|
||||
|
Reference in New Issue
Block a user