diff options
-rw-r--r-- | graphics/VectorRenderer.cpp | 36 | ||||
-rw-r--r-- | graphics/VectorRenderer.h | 7 | ||||
-rw-r--r-- | gui/ThemeDefaultXML.cpp | 10 | ||||
-rw-r--r-- | gui/ThemeRenderer.cpp | 8 | ||||
-rw-r--r-- | gui/ThemeRenderer.h | 2 |
5 files changed, 41 insertions, 22 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index aa0fad36c8..a8915eb0a6 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -53,7 +53,7 @@ VectorRenderer *createRenderer(int mode) { /******************************************************************** * DRAWSTEP handling functions ********************************************************************/ -void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step) { +void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, uint32 extra) { if (step.bgColor.set) setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b); @@ -69,8 +69,10 @@ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step) { setGradientFactor(step.factor); setStrokeWidth(step.stroke); setFillMode((FillMode)step.fillMode); + + _dynamicData = extra; - (this->*(step.drawingCall))(area, step); + (this->*(step.drawingCall))(area, step); } void VectorRenderer::textStep(const Common::String &text, const Common::Rect &area, const TextStep &step) { @@ -405,7 +407,7 @@ drawTab(int x, int y, int r, int w, int h) { case kFillBackground: drawTabAlg(x, y, w, h, r, (Base::_fillMode == kFillBackground) ? _bgColor : _fgColor, Base::_fillMode); if (Base::_strokeWidth) - drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled); + drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF)); break; case kFillForeground: @@ -472,7 +474,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) { /** TAB ALGORITHM - NON AA */ template<typename PixelType, typename PixelFormat> void VectorRendererSpec<PixelType, PixelFormat>:: -drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m) { +drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight) { int f, ddF_x, ddF_y; int x, y, px, py; int pitch = Base::surfacePitch(); @@ -507,10 +509,6 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer: *(ptr_tl - (y) - (px)) = color; if (Base::_strokeWidth > 1) { - *(ptr_tr + (y) - (px)) = color; - *(ptr_tr + (x - 1) - (py)) = color; - *(ptr_tl - (x - 1) - (py)) = color; - *(ptr_tl - (y) - (px)) = color; *(ptr_tr + (y) - (px - pitch)) = color; *(ptr_tr + (x) - (py)) = color; *(ptr_tl - (x) - (py)) = color; @@ -521,10 +519,28 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer: ptr_fill += pitch * real_radius; while (short_h--) { - colorFill(ptr_fill, ptr_fill + Base::_strokeWidth, color); - colorFill(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color); + colorFill(ptr_fill, ptr_fill + Base::_strokeWidth - 1, color); + colorFill(ptr_fill + w - Base::_strokeWidth + 2, ptr_fill + w, color); ptr_fill += pitch; } + + if (baseLeft) { + sw = 0; + ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1 + h); + while (sw++ < Base::_strokeWidth) { + colorFill(ptr_fill - baseLeft, ptr_fill, color); + ptr_fill += pitch; + } + } + + if (baseRight) { + sw = 0; + ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w, y1 + h); + while (sw++ < Base::_strokeWidth) { + colorFill(ptr_fill, ptr_fill + baseRight, color); + ptr_fill += pitch; + } + } } else { __BE_RESET(); diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 60cc20ac5a..e5fedd8ef5 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -78,7 +78,7 @@ struct DrawStep { uint8 shadow, stroke, factor, radius; /** Misc options... */ uint8 fillMode; /** active fill mode */ - uint8 extraData; /** Generic parameter for extra options (orientation/bevel) */ + uint32 extraData; /** Generic parameter for extra options (orientation/bevel) */ uint32 scale; /** scale of all the coordinates in FIXED POINT with 16 bits mantissa */ @@ -489,7 +489,7 @@ public: * @param area Zone to paint on * @param step Pointer to a DrawStep struct. */ - virtual void drawStep(const Common::Rect &area, const DrawStep &step); + virtual void drawStep(const Common::Rect &area, const DrawStep &step, uint32 extra = 0); virtual void textStep(const Common::String &text, const Common::Rect &area, const TextStep &step); /** @@ -519,6 +519,7 @@ protected: int _shadowOffset; /** offset for drawn shadows */ int _strokeWidth; /** Width of the stroke of all drawn shapes */ + uint32 _dynamicData; /** Dynamic data from the GUI Theme that modifies the drawing of the current shape */ int _gradientFactor; /** Multiplication factor of the active gradient */ int _gradientBytes[3]; /** Color bytes of the active gradient, used to speed up calculation */ @@ -763,7 +764,7 @@ protected: virtual void drawTriangleVertAlg(int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m); virtual void drawTriangleFast(int x, int y, int size, bool inverted, PixelType color, FillMode fill_m); virtual void drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color); - virtual void drawTabAlg(int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m); + virtual void drawTabAlg(int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft = 0, int baseRight = 0); /** * SHADOW DRAWING ALGORITHMS diff --git a/gui/ThemeDefaultXML.cpp b/gui/ThemeDefaultXML.cpp index bbd18fce5c..8c8f46d2ec 100644 --- a/gui/ThemeDefaultXML.cpp +++ b/gui/ThemeDefaultXML.cpp @@ -62,13 +62,13 @@ bool ThemeRenderer::loadDefaultXML() { "</drawdata>" "<drawdata id = 'tab_active' cache = false>" - "<text vertical_align = 'center' horizontal_align = 'center' color = '255, 255, 255' />" - "<drawstep func = 'tab' radius = '8' stroke = '2' fill = 'gradient' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' shadow = 3 />" + "<text vertical_align = 'center' horizontal_align = 'center' color = '0, 0, 0' />" + "<drawstep func = 'tab' radius = '4' stroke = '2' fill = 'gradient' gradient_end = '255, 231, 140' gradient_start = '255, 243, 206' shadow = 3 />" "</drawdata>" "<drawdata id = 'tab_inactive' cache = false>" - "<text vertical_align = 'center' horizontal_align = 'center' color = '255, 255, 255' />" - "<drawstep func = 'tab' radius = '8' stroke = '0' fill = 'foreground' fg_color = '206, 121, 99' shadow = 3 />" + "<text vertical_align = 'center' horizontal_align = 'center' color = '128, 128, 128' />" + "<drawstep func = 'tab' radius = '4' stroke = '0' fill = 'foreground' fg_color = '206, 121, 99' shadow = 3 />" "</drawdata>" "<drawdata id = 'slider_empty' cache = false>" @@ -93,7 +93,7 @@ bool ThemeRenderer::loadDefaultXML() { "</drawdata>" "<drawdata id = 'default_bg' cache = false>" - "<drawstep func = 'roundedsq' radius = 12 stroke = 4 fg_color = '206, 121, 99' fill = 'gradient' gradient_start = '255, 231, 140' gradient_end = '255, 243, 206' shadow = 3 />" + "<drawstep func = 'roundedsq' radius = 12 stroke = 2 fg_color = '255, 255, 255' fill = 'gradient' gradient_start = '255, 231, 140' gradient_end = '255, 243, 206' shadow = 3 />" "</drawdata>" "<drawdata id = 'button_idle' cache = false>" diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index 4b56eba4a2..7b64baba11 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -290,7 +290,7 @@ void ThemeRenderer::drawCached(DrawData type, const Common::Rect &r) { _vectorRenderer->blitSurface(_widgets[type]->_surfaceCache, r); } -void ThemeRenderer::drawDD(DrawData type, const Common::Rect &r) { +void ThemeRenderer::drawDD(DrawData type, const Common::Rect &r, uint32 dynamicData) { if (_widgets[type] == 0) return; @@ -299,7 +299,7 @@ void ThemeRenderer::drawDD(DrawData type, const Common::Rect &r) { } else { for (Common::List<Graphics::DrawStep>::const_iterator step = _widgets[type]->_steps.begin(); step != _widgets[type]->_steps.end(); ++step) - _vectorRenderer->drawStep(r, *step); + _vectorRenderer->drawStep(r, *step, dynamicData); } } @@ -473,7 +473,9 @@ void ThemeRenderer::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, if (active >= 0) { Common::Rect tabRect(r.left + active * (tabWidth + tabOffset), r.top, r.left + active * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight); - drawDD(kDDTabActive, tabRect); + const uint16 tabLeft = active * (tabWidth + tabOffset); + const uint16 tabRight = r.right - tabRect.right; + drawDD(kDDTabActive, tabRect, (tabLeft << 16) | (tabRight & 0xFFFF)); drawDDText(kDDTabActive, tabRect, tabs[active]); } } diff --git a/gui/ThemeRenderer.h b/gui/ThemeRenderer.h index e7e320d048..a5fccd8163 100644 --- a/gui/ThemeRenderer.h +++ b/gui/ThemeRenderer.h @@ -261,7 +261,7 @@ protected: bool isWidgetCached(DrawData type, const Common::Rect &r); void drawCached(DrawData type, const Common::Rect &r); - inline void drawDD(DrawData type, const Common::Rect &r); + inline void drawDD(DrawData type, const Common::Rect &r, uint32 dynamicData = 0); inline void drawDDText(DrawData type, const Common::Rect &r, const Common::String &text); inline void debugWidgetPosition(const char *name, const Common::Rect &r); |