aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorVicent Marti2008-07-12 18:17:11 +0000
committerVicent Marti2008-07-12 18:17:11 +0000
commit4539cdf2188d6461ecdc2fbc485d49eab1fb7311 (patch)
tree871a4dab59e777f9a75d60031cdd9626cf4c3c91 /graphics
parentdb932dce89eac7664eb9fc654f87ba89576da66f (diff)
downloadscummvm-rg350-4539cdf2188d6461ecdc2fbc485d49eab1fb7311.tar.gz
scummvm-rg350-4539cdf2188d6461ecdc2fbc485d49eab1fb7311.tar.bz2
scummvm-rg350-4539cdf2188d6461ecdc2fbc485d49eab1fb7311.zip
- Better support for relative positions in Vector Renderer.
- More widgets. svn-id: r33016
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 01fccb8c30..4dcef24e31 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -62,15 +62,9 @@ struct DrawStep {
gradColor1, /** gradient start*/
gradColor2; /** gradient end */
- bool fillArea; /** If enabled, the draw step occupies the whole drawing area */
-
- struct {
- uint16 pos;
- bool relative;
- } x, y; /** Horizontal and vertical coordinates. Relative specifies if they are
- measured from the opposite direction of the drawing area */
-
- uint16 w, h; /** width and height */
+ bool autoWidth, autoHeight;
+ int16 x, y, w, h; /** width, height and position, if not measured automatically.
+ negative values mean counting from the opposite direction */
uint8 shadow, stroke, factor, radius; /** Misc options... */
@@ -332,23 +326,22 @@ public:
}
void stepGetPositions(const DrawStep &step, const Common::Rect &area, uint16 &in_x, uint16 &in_y, uint16 &in_w, uint16 &in_h) {
- if (step.fillArea) {
+ if (!step.autoWidth) {
+ in_w = step.w;
+ if (step.x >= 0) in_x = area.left + step.x;
+ else in_x = area.left + area.width() + step.x; // value relative to the opposite corner.
+ } else {
in_x = area.left;
- in_y = area.top;
in_w = area.width();
- in_h = area.height();
+ }
+
+ if (!step.autoHeight) {
+ in_h = step.h;
+ if (step.y >= 0) in_y = area.top + step.y;
+ else in_y = area.top + area.height() + step.y; // relative
} else {
- if (!step.x.relative) in_x = area.left + step.x.pos;
- else in_x = area.left + area.width() - step.x.pos;
-
- if (!step.y.relative) in_y = area.top + step.y.pos;
- else in_y = area.top + area.height() - step.y.pos;
-
- if (in_x + step.w > area.right) in_w = area.right - in_x;
- else in_w = step.w;
-
- if (in_y + step.h > area.bottom) in_h = area.bottom - in_y;
- else in_h = step.h;
+ in_y = area.top;
+ in_h = area.height();
}
if (step.scale != (1 << 16) && step.scale != 0) {