diff options
author | tron <tron@openttd.org> | 2006-08-28 07:33:51 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-08-28 07:33:51 +0000 |
commit | 2eb76813edab81cbc3bcfbd10737979d7d5439f2 (patch) | |
tree | 7bdfd7c5d958ecb70ce91a2e6f5a707140d4f90d /gfx.c | |
parent | 523519c8ec4db318d151051a9b6281767136f314 (diff) | |
download | openttd-2eb76813edab81cbc3bcfbd10737979d7d5439f2.tar.xz |
(svn r6184) Remove the unused (because it was NULL in all callers) second parameter of FillDrawPixelInfo() and simplify some expressions
Diffstat (limited to 'gfx.c')
-rw-r--r-- | gfx.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -1880,43 +1880,43 @@ void MarkWholeScreenDirty(void) SetDirtyBlocks(0, 0, _screen.width, _screen.height); } -bool FillDrawPixelInfo(DrawPixelInfo *n, const DrawPixelInfo *o, int left, int top, int width, int height) +bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height) { - int t; - - if (o == NULL) o = _cur_dpi; + const DrawPixelInfo *o = _cur_dpi; n->zoom = 0; assert(width > 0); assert(height > 0); - n->left = 0; if ((left -= o->left) < 0) { width += left; if (width < 0) return false; n->left = -left; left = 0; + } else { + n->left = 0; } - if ((t=width + left - o->width) > 0) { - width -= t; + if (width > o->width - left) { + width = o->width - left; if (width < 0) return false; } n->width = width; - n->top = 0; if ((top -= o->top) < 0) { height += top; if (height < 0) return false; n->top = -top; top = 0; + } else { + n->top = 0; } n->dst_ptr = o->dst_ptr + left + top * (n->pitch = o->pitch); - if ((t=height + top - o->height) > 0) { - height -= t; + if (height > o->height - top) { + height = o->height - top; if (height < 0) return false; } n->height = height; |