diff options
author | tron <tron@openttd.org> | 2005-08-08 21:35:27 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-08-08 21:35:27 +0000 |
commit | e42b560049dd76b600323ac5de1f5424f141926f (patch) | |
tree | 141477785c427feae7e947288ef130ed6317e658 /vehicle.c | |
parent | b67af2df3e6307e75e26f165b291ff3f9c9e4ad3 (diff) | |
download | openttd-e42b560049dd76b600323ac5de1f5424f141926f.tar.xz |
(svn r2845) Remove sprite size caching, it was unused
This makes GetSpriteDimension() superflous, because now it's just a thin wrapper around GetSprite() returning only part of the information, therefore remove it too
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -165,20 +165,18 @@ Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z) void VehiclePositionChanged(Vehicle *v) { int img = v->cur_image; - const SpriteDimension *sd; Point pt = RemapCoords(v->x_pos + v->x_offs, v->y_pos + v->y_offs, v->z_pos); + const Sprite* spr = GetSprite(img); - sd = GetSpriteDimension(img); - - pt.x += sd->xoffs; - pt.y += sd->yoffs; + pt.x += spr->x_offs; + pt.y += spr->y_offs; UpdateVehiclePosHash(v, pt.x, pt.y); v->left_coord = pt.x; v->top_coord = pt.y; - v->right_coord = pt.x + sd->xsize + 2; - v->bottom_coord = pt.y + sd->ysize + 2; + v->right_coord = pt.x + spr->width + 2; + v->bottom_coord = pt.y + spr->height + 2; } // Called after load to update coordinates |