aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2013-12-13 23:41:24 +0000
committerD G Turner2013-12-13 23:41:24 +0000
commit094c378217d0af49d92c3be4dc1733e68a7f248a (patch)
treed1117d725bc69ced2ded573ee1e82e182c3908da
parentc111eff575a979bcf43c80e5fffc1c303b5892fc (diff)
downloadscummvm-rg350-094c378217d0af49d92c3be4dc1733e68a7f248a.tar.gz
scummvm-rg350-094c378217d0af49d92c3be4dc1733e68a7f248a.tar.bz2
scummvm-rg350-094c378217d0af49d92c3be4dc1733e68a7f248a.zip
GRAPHICS: Minor readability fixes to drawBevelSquareAlg method.
No functional change.
-rw-r--r--graphics/VectorRendererSpec.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 491a9d7f42..ce04db8a67 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -1266,51 +1266,50 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill) {
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
+ int i, j;
+ PixelType *ptr_left;
- int height = h;
- PixelType *ptr_fill = (PixelType *)_activeSurface->getBasePtr(x, y);
-
+ // Fill Background
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
+ i = h;
if (fill) {
assert((_bgColor & ~_alphaMask) == 0); // only support black
- while (height--) {
- darkenFill(ptr_fill, ptr_fill + w);
- ptr_fill += pitch;
+ while (i--) {
+ darkenFill(ptr_left, ptr_left + w);
+ ptr_left += pitch;
}
}
- int i, j;
-
x = MAX(x - bevel, 0);
y = MAX(y - bevel, 0);
w = MIN(w + (bevel * 2), (int)_activeSurface->w);
h = MIN(h + (bevel * 2), (int)_activeSurface->h);
- PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
-
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
i = bevel;
while (i--) {
colorFill<PixelType>(ptr_left, ptr_left + w, top_color);
ptr_left += pitch;
}
- i = h - bevel;
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y + bevel);
+ i = h - bevel;
while (i--) {
colorFill<PixelType>(ptr_left, ptr_left + bevel, top_color);
ptr_left += pitch;
}
- i = bevel;
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y + h - bevel);
+ i = bevel;
while (i--) {
colorFill<PixelType>(ptr_left + i, ptr_left + w, bottom_color);
ptr_left += pitch;
}
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x + w - bevel, y);
i = h - bevel;
j = bevel - 1;
- ptr_left = (PixelType *)_activeSurface->getBasePtr(x + w - bevel, y);
while (i--) {
colorFill<PixelType>(ptr_left + j, ptr_left + bevel, bottom_color);
if (j > 0) j--;