Cache the result of GetImage() in Vehicle::UpdateViewport() where possible.
Sprite number is not cached if callback is made, or a variable access outside a whitelist occurs. Invalidate cached sprite number when direction or cargo changes, or vehicle is marked dirty.
This commit is contained in:
@@ -367,6 +367,7 @@ Vehicle::Vehicle(VehicleType type)
|
||||
this->cargo_age_counter = 1;
|
||||
this->last_station_visited = INVALID_STATION;
|
||||
this->last_loading_station = INVALID_STATION;
|
||||
this->cur_image_valid_dir = INVALID_DIR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user