[Scummvm-cvs-logs] scummvm master -> 094c378217d0af49d92c3be4dc1733e68a7f248a
digitall
dgturner at iee.org
Sat Dec 14 00:38:09 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
094c378217 GRAPHICS: Minor readability fixes to drawBevelSquareAlg method.
Commit: 094c378217d0af49d92c3be4dc1733e68a7f248a
https://github.com/scummvm/scummvm/commit/094c378217d0af49d92c3be4dc1733e68a7f248a
Author: D G Turner (digitall at scummvm.org)
Date: 2013-12-13T15:41:24-08:00
Commit Message:
GRAPHICS: Minor readability fixes to drawBevelSquareAlg method.
No functional change.
Changed paths:
graphics/VectorRendererSpec.cpp
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 491a9d7..ce04db8 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--;
More information about the Scummvm-git-logs
mailing list