Fix ships leaving dots behind in viewport map mode

Fixes: 57db9a41
pull/688/head
Jonathan G Rennison 2 weeks ago
parent 1e38e513ae
commit 41543498f4

@ -397,11 +397,10 @@ bool RecentreShipSpriteBounds(Vehicle *v)
Ship *ship = Ship::From(v);
if (ship->rotation != ship->cur_image_valid_dir) {
ship->cur_image_valid_dir = INVALID_DIR;
Point offset = RemapCoords(ship->x_offs, ship->y_offs, 0);
ship->sprite_seq_bounds.left = -offset.x - 16;
ship->sprite_seq_bounds.right = ship->sprite_seq_bounds.left + 32;
ship->sprite_seq_bounds.top = -offset.y - 16;
ship->sprite_seq_bounds.bottom = ship->sprite_seq_bounds.top + 32;
ship->sprite_seq_bounds.left = -16;
ship->sprite_seq_bounds.right = 16;
ship->sprite_seq_bounds.top = -16;
ship->sprite_seq_bounds.bottom = 16;
return true;
}
return false;

@ -2064,7 +2064,7 @@ void ViewportMapDrawVehicles(DrawPixelInfo *dpi, Viewport *vp)
while (v != nullptr) {
if (!(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) && (v->type != VEH_EFFECT)) {
Point pt = RemapCoords(v->x_pos + v->x_offs, v->y_pos + v->y_offs, v->z_pos);
Point pt = { v->coord.left, v->coord.top };
if (pt.x >= l && pt.x < r && pt.y >= t && pt.y < b) {
const int pixel_x = UnScaleByZoomLower(pt.x - l, dpi->zoom);
const int pixel_y = UnScaleByZoomLower(pt.y - t, dpi->zoom);

Loading…
Cancel
Save