diff options
author | Vicent Marti | 2008-07-13 17:08:44 +0000 |
---|---|---|
committer | Vicent Marti | 2008-07-13 17:08:44 +0000 |
commit | e7e7ff9b344356c0a9ffed2998b597328eb1331f (patch) | |
tree | 8e8e535c7df8727c4223c001b43f4f1647e1fd34 | |
parent | a95c6fc76d58d3225e4f31e45ea9d686c79def84 (diff) | |
download | scummvm-rg350-e7e7ff9b344356c0a9ffed2998b597328eb1331f.tar.gz scummvm-rg350-e7e7ff9b344356c0a9ffed2998b597328eb1331f.tar.bz2 scummvm-rg350-e7e7ff9b344356c0a9ffed2998b597328eb1331f.zip |
Bugfix of the bugfix. Rounded squares work now on all resolutions.
svn-id: r33040
-rw-r--r-- | graphics/VectorRenderer.cpp | 34 | ||||
-rw-r--r-- | gui/ThemeDefaultXML.cpp | 2 |
2 files changed, 27 insertions, 9 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index 1827d71024..19a4f75058 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -129,6 +129,17 @@ inline uint32 fp_sqroot(uint32 x) { *(ptr4 + (y) + (px)) = color; \ } +#define __BE_DRAWCIRCLE_XCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py) { \ + *(ptr1 + (y) - (px)) = color1; \ + *(ptr1 + (x) - (py)) = color2; \ + *(ptr2 - (x) - (py)) = color2; \ + *(ptr2 - (y) - (px)) = color1; \ + *(ptr3 - (y) + (px)) = color3; \ + *(ptr3 - (x) + (py)) = color4; \ + *(ptr4 + (x) + (py)) = color4; \ + *(ptr4 + (y) + (px)) = color3; \ +} + #define __BE_RESET() { \ f = 1 - r; \ ddF_x = 0; ddF_y = -2 * r; \ @@ -703,17 +714,24 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto } } else { __BE_RESET(); - + PixelType color1, color2, color3, color4; + if (fill_m == kFillGradient) { while (x++ < y) { __BE_ALGORITHM(); - colorFill(ptr_tl - x - py, ptr_tr + x - py, calcGradient(real_radius - y, long_h)); - colorFill(ptr_tl - y - px, ptr_tr + y - px, calcGradient(real_radius - x, long_h)); + + color1 = calcGradient(real_radius - x, long_h); + color2 = calcGradient(real_radius - y, long_h); + color3 = calcGradient(long_h - r + x, long_h); + color4 = calcGradient(long_h - r + y, long_h); + + colorFill(ptr_tl - x - py, ptr_tr + x - py, color2); + colorFill(ptr_tl - y - px, ptr_tr + y - px, color1); - colorFill(ptr_bl - x + py, ptr_br + x + py, calcGradient(long_h - r + y, long_h)); - colorFill(ptr_bl - y + px, ptr_br + y + px, calcGradient(long_h - r + x, long_h)); + colorFill(ptr_bl - x + py, ptr_br + x + py, color4); + colorFill(ptr_bl - y + px, ptr_br + y + px, color3); -// __BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); + __BE_DRAWCIRCLE_XCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); } } else { while (x++ < y) { @@ -725,8 +743,8 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto colorFill(ptr_bl - x + py, ptr_br + x + py, color); colorFill(ptr_bl - y + px, ptr_br + y + px, color); - // FIXME: maybe not needed at all? -// __BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); + // do not remove - messes up the drawing at lower resolutions + __BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); } } diff --git a/gui/ThemeDefaultXML.cpp b/gui/ThemeDefaultXML.cpp index 68c87c6f2c..be2a9df8b6 100644 --- a/gui/ThemeDefaultXML.cpp +++ b/gui/ThemeDefaultXML.cpp @@ -60,7 +60,7 @@ bool ThemeRenderer::loadDefaultXML() { "</drawdata>" "<drawdata id = 'button_idle' cache = false>" - "<text vertical_align = 'center' horizontal_align = 'center' color = '128, 128, 128' />" + "<text vertical_align = 'center' horizontal_align = 'center' color = '173, 40, 8' />" "<drawstep func = 'roundedsq' radius = '8' stroke = 0 fill = 'foreground' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' shadow = 3 />" "</drawdata>" |