diff options
author | Vicent Marti | 2008-07-25 00:59:53 +0000 |
---|---|---|
committer | Vicent Marti | 2008-07-25 00:59:53 +0000 |
commit | 49b4df308ff7beb771531598c074535241e547ca (patch) | |
tree | 6440655dcbc9977ca99947430310351b24e1d159 | |
parent | 7c562788968060e7fe764b9946384fa88cdd4de4 (diff) | |
download | scummvm-rg350-49b4df308ff7beb771531598c074535241e547ca.tar.gz scummvm-rg350-49b4df308ff7beb771531598c074535241e547ca.tar.bz2 scummvm-rg350-49b4df308ff7beb771531598c074535241e547ca.zip |
Fixed triangle drawing. A bit.
svn-id: r33268
-rw-r--r-- | graphics/VectorRenderer.cpp | 24 | ||||
-rw-r--r-- | graphics/VectorRenderer.h | 1 | ||||
-rw-r--r-- | gui/ThemeDefaultXML.cpp | 4 | ||||
-rw-r--r-- | gui/ThemeRenderer.cpp | 4 |
4 files changed, 20 insertions, 13 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index 178f760751..6bbb84acaa 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -498,9 +498,9 @@ void VectorRendererSpec<PixelType, PixelFormat>:: drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) { // Awesome hack: the AA messes up the last pixel triangles if their width is even // ...fix the width instead of fixing the AA :p - if (w % 2 == 0) { - w++; h++; - } + // if (w % 2 == 0) { + // w++; h++; + // } if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h) return; @@ -517,16 +517,22 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) { return; color = _fgColor; } + + if (Base::_dynamicData != 0) + orient = (TriangleOrientation)Base::_dynamicData; + + int newW = w * 3 / 4; + if (newW % 2) newW++; switch(orient) { case kTriangleUp: case kTriangleDown: -#ifdef VECTOR_RENDERER_FAST_TRIANGLES - if (w == h) - drawTriangleFast(x, y, w, (orient == kTriangleDown), color, Base::_fillMode); - else -#endif - drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), color, Base::_fillMode); +// #ifdef VECTOR_RENDERER_FAST_TRIANGLES + // if (w == h) + drawTriangleFast(x + (w / 2) - w * 3 / 8, y + w / 4, newW, (orient == kTriangleDown), color, Base::_fillMode); + // else +// #endif + // drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), color, Base::_fillMode); break; case kTriangleLeft: diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index f659626bbf..88072da923 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -107,6 +107,7 @@ public: }; enum TriangleOrientation { + kTriangleAuto = 0, kTriangleUp, kTriangleDown, kTriangleLeft, diff --git a/gui/ThemeDefaultXML.cpp b/gui/ThemeDefaultXML.cpp index 64641b13a3..2e3c3b1270 100644 --- a/gui/ThemeDefaultXML.cpp +++ b/gui/ThemeDefaultXML.cpp @@ -79,12 +79,12 @@ bool ThemeRenderer::loadDefaultXML() { "<drawdata id = 'scrollbar_button_idle' cache = false>" "<drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '120, 120, 120' stroke = 1 />" - "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />" + "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' />" "</drawdata>" "<drawdata id = 'scrollbar_button_hover' cache = false>" "<drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 />" - "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />" + "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' />" "</drawdata>" "<drawdata id = 'tab_active' cache = false>" diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index 52c4e895a6..403fecf12e 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -476,10 +476,10 @@ void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int slider const int buttonExtra = (r.width() * 120) / 100; r2.bottom = r2.top + buttonExtra; - queueDD(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2); + queueDD(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, Graphics::VectorRenderer::kTriangleUp); r2.translate(0, r.height() - r2.height()); - queueDD(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2); + queueDD(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, Graphics::VectorRenderer::kTriangleDown); r2 = r; r2.left += 1; |