@@ -397,11 +397,10 @@ bool RecentreShipSpriteBounds(Vehicle *v)
|
|||||||
Ship *ship = Ship::From(v);
|
Ship *ship = Ship::From(v);
|
||||||
if (ship->rotation != ship->cur_image_valid_dir) {
|
if (ship->rotation != ship->cur_image_valid_dir) {
|
||||||
ship->cur_image_valid_dir = INVALID_DIR;
|
ship->cur_image_valid_dir = INVALID_DIR;
|
||||||
Point offset = RemapCoords(ship->x_offs, ship->y_offs, 0);
|
ship->sprite_seq_bounds.left = -16;
|
||||||
ship->sprite_seq_bounds.left = -offset.x - 16;
|
ship->sprite_seq_bounds.right = 16;
|
||||||
ship->sprite_seq_bounds.right = ship->sprite_seq_bounds.left + 32;
|
ship->sprite_seq_bounds.top = -16;
|
||||||
ship->sprite_seq_bounds.top = -offset.y - 16;
|
ship->sprite_seq_bounds.bottom = 16;
|
||||||
ship->sprite_seq_bounds.bottom = ship->sprite_seq_bounds.top + 32;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -2064,7 +2064,7 @@ void ViewportMapDrawVehicles(DrawPixelInfo *dpi, Viewport *vp)
|
|||||||
|
|
||||||
while (v != nullptr) {
|
while (v != nullptr) {
|
||||||
if (!(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) && (v->type != VEH_EFFECT)) {
|
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) {
|
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_x = UnScaleByZoomLower(pt.x - l, dpi->zoom);
|
||||||
const int pixel_y = UnScaleByZoomLower(pt.y - t, dpi->zoom);
|
const int pixel_y = UnScaleByZoomLower(pt.y - t, dpi->zoom);
|
||||||
|
Reference in New Issue
Block a user