Add setting to control RV re-routing on road layout change

Default to road removal only
This is due to poor performance with many RVs when town growth is
continually adding to the road layout
This commit is contained in:
Jonathan G Rennison
2020-07-02 17:47:26 +01:00
parent 903b0fdd39
commit d5ada6a14b
8 changed files with 66 additions and 26 deletions

View File

@@ -14,6 +14,7 @@
#include "road.h"
#include "economy_func.h"
#include "transparency.h"
#include "settings_type.h"
/**
* Whether the given roadtype is valid.
@@ -160,11 +161,21 @@ void UpdateCompanyRoadInfrastructure(RoadType rt, Owner o, int count);
struct TileInfo;
void DrawRoadOverlays(const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rit, uint road_offset, uint tram_offset);
inline bool RoadLayoutChangeNotificationEnabled(bool added)
{
return _settings_game.pf.reroute_rv_on_layout_change >= (added ? 2 : 1);
}
inline void NotifyRoadLayoutChanged()
{
_road_layout_change_counter++;
}
inline void NotifyRoadLayoutChanged(bool added)
{
if (RoadLayoutChangeNotificationEnabled(added)) NotifyRoadLayoutChanged();
}
void NotifyRoadLayoutChangedIfTileNonLeaf(TileIndex tile, RoadTramType rtt, RoadBits present_bits);
void NotifyRoadLayoutChangedIfSimpleTunnelBridgeNonLeaf(TileIndex start, TileIndex end, DiagDirection start_dir, RoadTramType rtt);