Fix sprite bound issues for vehicles which vary bounds with curvature

If a vehicle uses curvature vars 0x45 or 0x62, cache the directions
of its 4 nearest neighbours, and check them in UpdateViewport along
with the vehicle's own direction.
This commit is contained in:
Jonathan G Rennison
2021-01-03 16:12:59 +00:00
parent bf313338c0
commit 204f8e173f
4 changed files with 36 additions and 1 deletions

View File

@@ -3811,6 +3811,7 @@ char *Vehicle::DumpVehicleFlags(char *b, const char *last, bool include_tile) co
dump('s', HasBit(this->vcache.cached_veh_flags, VCF_REDRAW_ON_SPEED_CHANGE));
dump('R', HasBit(this->vcache.cached_veh_flags, VCF_IMAGE_REFRESH));
dump('N', HasBit(this->vcache.cached_veh_flags, VCF_IMAGE_REFRESH_NEXT));
dump('c', HasBit(this->vcache.cached_veh_flags, VCF_IMAGE_CURVATURE));
if (this->IsGroundVehicle()) {
uint16 gv_flags = this->GetGroundVehicleFlags();
b += seprintf(b, last, ", gvf:");