aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorVicent Marti2008-07-07 18:37:22 +0000
committerVicent Marti2008-07-07 18:37:22 +0000
commit92ef8dd7502eb86185989a9e2e2b9d722930ec1e (patch)
tree306ba186fb7855db84635a71eea385f60f62c2ef /graphics
parent9b7faedb0de9f9c3bc18bff5bfc0a629142806b5 (diff)
downloadscummvm-rg350-92ef8dd7502eb86185989a9e2e2b9d722930ec1e.tar.gz
scummvm-rg350-92ef8dd7502eb86185989a9e2e2b9d722930ec1e.tar.bz2
scummvm-rg350-92ef8dd7502eb86185989a9e2e2b9d722930ec1e.zip
Rendering pipeline. Bugfixes / debug widgets.
svn-id: r32946
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 08c8a8435d..7b04191f91 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -39,6 +39,16 @@ namespace Graphics {
class VectorRenderer;
struct DrawStep;
+struct TextStep {
+ struct {
+ uint8 r, g, b;
+ bool set;
+ }
+ color; /** text color */
+
+ GUI::Theme::TextAlign align;
+};
+
struct DrawStep {
struct {
uint8 r, g, b;
@@ -294,7 +304,7 @@ public:
* @see shadowDisable()
*/
virtual void shadowEnable(int offset) {
- if (offset > 0)
+ if (offset >= 0)
_shadowOffset = offset;
}
@@ -346,13 +356,30 @@ public:
}
}
+ int stepGetRadius(const DrawStep &step, const Common::Rect &area) {
+ int radius = 0;
+
+ if (step.radius == 0xFF)
+ radius = MIN(area.width(), area.height()) / 2;
+ else
+ radius = step.radius;
+
+ if (step.scale != (1 << 16) && step.scale != 0)
+ radius = (radius * step.scale) >> 16;
+
+ return radius;
+ }
+
/**
* DrawStep callback functions for each drawing feature
*/
void drawCallback_CIRCLE(const Common::Rect &area, const DrawStep &step) {
- uint16 x, y, w, h;
+ uint16 x, y, w, h, radius;
+
+ radius = stepGetRadius(step, area);
stepGetPositions(step, area, x, y, w, h);
- drawCircle(x, y, (step.radius * step.scale) >> 16);
+
+ drawCircle(x + radius, y + radius, radius);
}
void drawCallback_SQUARE(const Common::Rect &area, const DrawStep &step) {
@@ -370,8 +397,7 @@ public:
void drawCallback_ROUNDSQ(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
- /* HACK! Radius of the rounded squares isn't scaled */
- drawRoundedSquare(x, y, step.radius, w, h);
+ drawRoundedSquare(x, y, stepGetRadius(step, area), w, h);
}
void drawCallback_FILLSURFACE(const Common::Rect &area, const DrawStep &step) {