aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRenderer.cpp
diff options
context:
space:
mode:
authorVicent Marti2008-08-04 16:59:55 +0000
committerVicent Marti2008-08-04 16:59:55 +0000
commit85c36885f5bbf2d47276c7702f1b8ccbf22ecc34 (patch)
treedd3aeb61b4bcc37431b383c36f429d082f418965 /graphics/VectorRenderer.cpp
parent461e2f42149e3b1914b3c7b392d076c186c6d0a1 (diff)
downloadscummvm-rg350-85c36885f5bbf2d47276c7702f1b8ccbf22ecc34.tar.gz
scummvm-rg350-85c36885f5bbf2d47276c7702f1b8ccbf22ecc34.tar.bz2
scummvm-rg350-85c36885f5bbf2d47276c7702f1b8ccbf22ecc34.zip
Theme layout parsing. Work in progress.
svn-id: r33613
Diffstat (limited to 'graphics/VectorRenderer.cpp')
-rw-r--r--graphics/VectorRenderer.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index db9b774857..e3e7174d90 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -69,13 +69,16 @@ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, ui
if (step.fgColor.set)
setFgColor(step.fgColor.r, step.fgColor.g, step.fgColor.b);
+
+ if (step.bevelColor.set)
+ setBevelColor(step.bevelColor.r, step.bevelColor.g, step.bevelColor.b);
if (step.gradColor1.set && step.gradColor2.set)
setGradientColors(step.gradColor1.r, step.gradColor1.g, step.gradColor1.b,
step.gradColor2.r, step.gradColor2.g, step.gradColor2.b);
setShadowOffset(_disableShadows ? 0 : step.shadow);
- setInnerShadowOffset(_disableShadows ? 0 : step.innerShadow);
+ setBevel(step.bevel);
setGradientFactor(step.factor);
setStrokeWidth(step.stroke);
setFillMode((FillMode)step.fillMode);
@@ -513,8 +516,8 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
break;
}
- if (Base::_innerShadowOffset)
- drawRoundedSquareInnerShadow(x, y, r, w, h, Base::_innerShadowOffset);
+ if (Base::_bevel)
+ drawRoundedSquareFakeBevel(x, y, r, w, h, Base::_bevel);
}
template<typename PixelType, typename PixelFormat>
@@ -945,6 +948,8 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
int pitch = Base::surfacePitch();
int sw = 0, sp = 0, hp = h * pitch;
+// if (r < 8) r = 3;
+
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r);
PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r);
@@ -1160,7 +1165,7 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int blur) {
template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
-drawRoundedSquareInnerShadow(int x1, int y1, int r, int w, int h, int blur) {
+drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
int x, y;
int p = Base::surfacePitch(), px, py;
int sw = 0, sp = 0;
@@ -1169,7 +1174,7 @@ drawRoundedSquareInnerShadow(int x1, int y1, int r, int w, int h, int blur) {
uint32 T = 0, oldT;
uint8 a1, a2;
- PixelType color = RGBToColor<PixelFormat>(63, 60, 17);
+ PixelType color = _bevelColor; //RGBToColor<PixelFormat>(63, 60, 17);
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r);
@@ -1178,7 +1183,7 @@ drawRoundedSquareInnerShadow(int x1, int y1, int r, int w, int h, int blur) {
int short_h = h - 2 * r;
- while (sw++ < blur) {
+ while (sw++ < amount) {
colorFill(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color);
sp += p;
@@ -1188,9 +1193,6 @@ drawRoundedSquareInnerShadow(int x1, int y1, int r, int w, int h, int blur) {
while (x > y++) {
__WU_ALGORITHM();
- a1 = a1 * 3 / 4;
- a2 = a2 * 3 / 4;
-
blendPixelPtr(ptr_tr + (y) - (px - p), color, a2);
blendPixelPtr(ptr_tr + (x - 1) - (py), color, a2);
blendPixelPtr(ptr_tl - (x - 1) - (py), color, a2);
@@ -1209,7 +1211,7 @@ drawRoundedSquareInnerShadow(int x1, int y1, int r, int w, int h, int blur) {
ptr_fill += p * r;
while (short_h-- >= 0) {
- colorFill(ptr_fill, ptr_fill + blur, color);
+ colorFill(ptr_fill, ptr_fill + amount, color);
ptr_fill += p;
}
}