Cache vehicle positions across draw blocks in viewport map mode

This commit is contained in:
Jonathan G Rennison
2020-03-04 22:57:47 +00:00
parent 7949de2c05
commit a4608f6f72
7 changed files with 80 additions and 24 deletions

View File

@@ -27,6 +27,8 @@
static const int VEHICLE_PROFIT_MIN_AGE = DAYS_IN_YEAR * 2; ///< Only vehicles older than this have a meaningful profit.
static const Money VEHICLE_PROFIT_THRESHOLD = 10000; ///< Threshold for a vehicle to be considered making good profit.
struct ViewPort;
/**
* Helper to check whether an image index is valid for a particular vehicle.
* @tparam T The type of vehicle.
@@ -126,7 +128,7 @@ void ResetVehicleColourMap();
byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_type);
void ViewportAddVehicles(DrawPixelInfo *dpi);
void ViewportMapDrawVehicles(DrawPixelInfo *dpi);
void ViewportMapDrawVehicles(DrawPixelInfo *dpi, ViewPort *vp);
void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRFBugs bug_type, bool critical);
CommandCost TunnelBridgeIsFree(TileIndex tile, TileIndex endtile, const Vehicle *ignore = nullptr, bool across_only = false);