aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorVicent Marti2008-08-14 18:43:27 +0000
committerVicent Marti2008-08-14 18:43:27 +0000
commit8eaa982c41a083337aa512f1d303b178d25f6a2a (patch)
treef71ae86498ec1a9b6e71144141443b957a848af0 /graphics
parent4368e8132f2caefe886bce595731c67ea16855ad (diff)
downloadscummvm-rg350-8eaa982c41a083337aa512f1d303b178d25f6a2a.tar.gz
scummvm-rg350-8eaa982c41a083337aa512f1d303b178d25f6a2a.tar.bz2
scummvm-rg350-8eaa982c41a083337aa512f1d303b178d25f6a2a.zip
Added Classic Theme - WIP (yes, it's working).
Added Builtin theme back. Added Python script to automatically build themes. svn-id: r33868
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp74
-rw-r--r--graphics/VectorRenderer.h7
2 files changed, 75 insertions, 6 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 17a221a725..16797fa930 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -477,7 +477,7 @@ template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
drawRoundedSquare(int x, int y, int r, int w, int h) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
- w <= 0 || h <= 0 || x < 0 || y < 0)
+ w <= 0 || h <= 0 || x < 0 || y < 0 || r <= 0)
return;
if ((r << 1) > w || (r << 1) > h)
@@ -527,6 +527,13 @@ drawTab(int x, int y, int r, int w, int h) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r > w || r > h)
return;
+
+ if (r == 0 && Base::_bevel > 0) {
+ drawBevelTabAlg(x, y, w, h, Base::_bevel, _bevelColor, _fgColor, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
+ return;
+ }
+
+ if (r == 0) return;
switch (Base::_fillMode) {
case kFillDisabled:
@@ -696,6 +703,51 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
}
}
+
+/** BEVELED TABS FOR CLASSIC THEME **/
+template<typename PixelType, typename PixelFormat>
+void VectorRendererSpec<PixelType, PixelFormat>::
+drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, int baseLeft, int baseRight) {
+ int pitch = Base::surfacePitch();
+ int i, j;
+
+ PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
+
+ i = bevel;
+ while (i--) {
+ colorFill(ptr_left, ptr_left + w, top_color);
+ ptr_left += pitch;
+ }
+
+ if (baseLeft > 0) {
+ i = h - bevel;
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
+ while (i--) {
+ colorFill(ptr_left, ptr_left + bevel, top_color);
+ ptr_left += pitch;
+ }
+ }
+
+ i = h - bevel;
+ j = bevel;
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x + w - bevel, y);
+ while (i--) {
+ colorFill(ptr_left + j, ptr_left + bevel, bottom_color);
+ if (j > 0) j--;
+ ptr_left += pitch;
+ }
+
+ i = bevel;
+ ptr_left = (PixelType *)_activeSurface->getBasePtr(x + w - bevel, y + h - bevel);
+ while (i--) {
+ colorFill(ptr_left, ptr_left + baseRight + bevel, bottom_color);
+
+ if (baseLeft)
+ colorFill(ptr_left - w - baseLeft + bevel, ptr_left - w + bevel + bevel, top_color);
+ ptr_left += pitch;
+ }
+}
+
/** SQUARE ALGORITHM **/
template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
@@ -732,10 +784,26 @@ drawSquareAlg(int x, int y, int w, int h, PixelType color, VectorRenderer::FillM
/** SQUARE ALGORITHM **/
template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
-drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color) {
- PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
+drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill) {
int pitch = Base::surfacePitch();
+
+ int height = h;
+ PixelType *ptr_fill = (PixelType *)_activeSurface->getBasePtr(x, y);
+
+ if (fill) {
+ while (height--) {
+ blendFill(ptr_fill, ptr_fill + w, _bgColor, 200);
+ ptr_fill += pitch;
+ }
+ }
+
int i, j;
+ x = MAX(x - bevel, 0);
+ y = MAX(y - bevel, 0);
+ h += bevel << 1;
+ w += bevel << 1;
+
+ PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
i = bevel;
while (i--) {
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 34c9c2c8a5..0407028556 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -405,7 +405,7 @@ public:
void drawCallback_BEVELSQ(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
- drawBeveledSquare(x, y, w, h, step.extraData);
+ drawBeveledSquare(x, y, w, h, _bevel);
}
void drawCallback_TAB(const Common::Rect &area, const DrawStep &step) {
@@ -599,7 +599,7 @@ public:
void drawTab(int x, int y, int r, int w, int h);
void drawBeveledSquare(int x, int y, int w, int h, int bevel) {
- drawBevelSquareAlg(x, y, w, h, bevel, _fgColor, _bgColor);
+ drawBevelSquareAlg(x, y, w, h, bevel, _bevelColor, _fgColor, Base::_fillMode != kFillDisabled);
}
void drawString(const Graphics::Font *font, const Common::String &text,
@@ -860,8 +860,9 @@ protected:
virtual void drawSquareAlg(int x, int y, int w, int h, PixelType color, FillMode fill_m);
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 drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill);
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);
+ virtual void drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType topColor, PixelType bottomColor, int baseLeft = 0, int baseRight = 0);
/**
* SHADOW DRAWING ALGORITHMS