Only update vehicle image when in the vicinity of a viewport

This reduces the performance impact of expensive NewGRF
graphics chains.
This commit is contained in:
Jonathan G Rennison
2021-05-20 18:03:11 +01:00
parent 3e8ee4f49f
commit aa0c1ba2e0
5 changed files with 228 additions and 66 deletions

View File

@@ -127,7 +127,7 @@ void ResetVehicleColourMap();
byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_type);
void ViewportAddVehicles(DrawPixelInfo *dpi);
void ViewportAddVehicles(DrawPixelInfo *dpi, bool update_vehicles);
void ViewportMapDrawVehicles(DrawPixelInfo *dpi, Viewport *vp);
void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRFBugs bug_type, bool critical);