From eb2dc7ef91499310c5b505a5c99fd7fa069f6d34 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 8 Aug 2005 21:35:27 +0000 Subject: (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 --- viewport.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'viewport.c') diff --git a/viewport.c b/viewport.c index a7c82edf0..c3cc10834 100644 --- a/viewport.c +++ b/viewport.c @@ -403,12 +403,12 @@ static void AddCombinedSprite(uint32 image, int x, int y, byte z) { const ViewportDrawer *vd = _cur_vd; Point pt = RemapCoords(x, y, z); - const SpriteDimension *sd = GetSpriteDimension(image & SPRITE_MASK); + const Sprite* spr = GetSprite(image & SPRITE_MASK); - if (pt.x + sd->xoffs >= vd->dpi.left + vd->dpi.width || - pt.x + sd->xoffs + sd->xsize <= vd->dpi.left || - pt.y + sd->yoffs >= vd->dpi.top + vd->dpi.height || - pt.y + sd->yoffs + sd->ysize <= vd->dpi.top) + if (pt.x + spr->x_offs >= vd->dpi.left + vd->dpi.width || + pt.x + spr->x_offs + spr->width <= vd->dpi.left || + pt.y + spr->y_offs >= vd->dpi.top + vd->dpi.height || + pt.y + spr->y_offs + spr->height <= vd->dpi.top) return; AddChildSpriteScreen(image, pt.x - vd->parent_list[-1]->left, pt.y - vd->parent_list[-1]->top); @@ -419,7 +419,7 @@ void AddSortableSpriteToDraw(uint32 image, int x, int y, int w, int h, byte dz, { ViewportDrawer *vd = _cur_vd; ParentSpriteToDraw *ps; - const SpriteDimension *sd; + const Sprite* spr; Point pt; assert((image & SPRITE_MASK) < MAX_SPRITES); @@ -462,11 +462,11 @@ void AddSortableSpriteToDraw(uint32 image, int x, int y, int w, int h, byte dz, pt = RemapCoords(x, y, z); - sd = GetSpriteDimension(image & SPRITE_MASK); - if ((ps->left = (pt.x += sd->xoffs)) >= vd->dpi.left + vd->dpi.width || - (ps->right = (pt.x + sd->xsize)) <= vd->dpi.left || - (ps->top = (pt.y += sd->yoffs)) >= vd->dpi.top + vd->dpi.height || - (ps->bottom = (pt.y + sd->ysize)) <= vd->dpi.top) { + spr = GetSprite(image & SPRITE_MASK); + if ((ps->left = (pt.x += spr->x_offs)) >= vd->dpi.left + vd->dpi.width || + (ps->right = (pt.x + spr->width )) <= vd->dpi.left || + (ps->top = (pt.y += spr->y_offs)) >= vd->dpi.top + vd->dpi.height || + (ps->bottom = (pt.y + spr->height)) <= vd->dpi.top) { return; } -- cgit v1.2.3-54-g00ecf