diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 25 |
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--; |