aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-26 13:54:20 +0100
committerEugene Sandulenko2015-12-27 15:41:03 +0100
commitcd063ec0e8e3870f1d2386bd138010b370c79a85 (patch)
treede76a1fcd0eb7ca521973dc90f5ef14338096379 /engines
parent069735d0b7ab1d182c21100521ebc4691da34ceb (diff)
downloadscummvm-rg350-cd063ec0e8e3870f1d2386bd138010b370c79a85.tar.gz
scummvm-rg350-cd063ec0e8e3870f1d2386bd138010b370c79a85.tar.bz2
scummvm-rg350-cd063ec0e8e3870f1d2386bd138010b370c79a85.zip
WAGE: Further work on border drawing
Diffstat (limited to 'engines')
-rw-r--r--engines/wage/gui.cpp62
-rw-r--r--engines/wage/gui.h4
-rw-r--r--engines/wage/wage.cpp3
3 files changed, 40 insertions, 29 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 377b89b65e..2207e8e938 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -63,7 +63,25 @@ void Gui::drawBox(Graphics::Surface *g, int x, int y, int w, int h) {
g->frameRect(r, kColorBlack);
}
-void Gui::paintBorder(Graphics::Surface *g, int x, int y, int width, int height) {
+void Gui::fillRect(Graphics::Surface *g, int x, int y, int w, int h) {
+ Common::Rect r(x, y, x + w + 1, y + h + 1);
+
+ g->fillRect(r, kColorBlack);
+}
+
+#define ARROW_W 12
+#define ARROW_H 6
+const int arrowPixels[ARROW_H][ARROW_W] = {
+ {0,0,0,0,0,1,1,0,0,0,0,0},
+ {0,0,0,0,1,1,1,1,0,0,0,0},
+ {0,0,0,1,1,1,1,1,1,0,0,0},
+ {0,0,1,1,1,1,1,1,1,1,0,0},
+ {0,1,1,1,1,1,1,1,1,1,1,0},
+ {1,1,1,1,1,1,1,1,1,1,1,1}};
+
+
+void Gui::paintBorder(Graphics::Surface *g, int x, int y, int width, int height,
+ bool active, bool scrollable, bool closeable, bool closeBoxPressed) {
int size = 17;
drawBox(g, x, y, size, size);
drawBox(g, x+width-size-1, y, size, size);
@@ -74,52 +92,42 @@ void Gui::paintBorder(Graphics::Surface *g, int x, int y, int width, int height)
drawBox(g, x + 2, y + size, size - 4, height - 2*size - 1);
drawBox(g, x + width - size + 1, y + size, size - 4, height - 2*size-1);
-#if 0
if (active) {
- g.setColor(Color.BLACK);
- g.fillRect(x + size, y + 5, width - 2*size - 1, 8);
- g.fillRect(x + size, y + height - 13, width - 2*size - 1, 8);
- g.fillRect(x + 5, y + size, 8, height - 2*size - 1);
+ fillRect(g, x + size, y + 5, width - 2*size - 1, 8);
+ fillRect(g, x + size, y + height - 13, width - 2*size - 1, 8);
+ fillRect(g, x + 5, y + size, 8, height - 2*size - 1);
if (!scrollable) {
- g.fillRect(x + width - 13, y + size, 8, height - 2*size - 1);
+ fillRect(g, x + width - 13, y + size, 8, height - 2*size - 1);
} else {
- int pixels[][] = new int[][] {
- {0,0,0,0,0,1,1,0,0,0,0,0},
- {0,0,0,0,1,1,1,1,0,0,0,0},
- {0,0,0,1,1,1,1,1,1,0,0,0},
- {0,0,1,1,1,1,1,1,1,1,0,0},
- {0,1,1,1,1,1,1,1,1,1,1,0},
- {1,1,1,1,1,1,1,1,1,1,1,1}};
- final int h = pixels.length;
- final int w = pixels[0].length;
int x1 = x + width - 15;
int y1 = y + size + 1;
- for (int yy = 0; yy < h; yy++) {
- for (int xx = 0; xx < w; xx++) {
- if (pixels[yy][xx] != 0) {
- g.drawRect(x1+xx, y1+yy, 0, 0);
+ for (int yy = 0; yy < ARROW_H; yy++) {
+ for (int xx = 0; xx < ARROW_W; xx++) {
+ if (arrowPixels[yy][xx] != 0) {
+ g->hLine(x1+xx, y1+yy, 1, 0);
}
}
}
- g.fillRect(x + width - 13, y + size + h, 8, height - 2*size - 1 - h*2);
- y1 += height - 2*size - h - 2;
- for (int yy = 0; yy < h; yy++) {
- for (int xx = 0; xx < w; xx++) {
- if (pixels[h-yy-1][xx] != 0) {
- g.drawRect(x1+xx, y1+yy, 0, 0);
+ fillRect(g, x + width - 13, y + size + ARROW_H, 8, height - 2*size - 1 - ARROW_H*2);
+ y1 += height - 2*size - ARROW_H - 2;
+ for (int yy = 0; yy < ARROW_H; yy++) {
+ for (int xx = 0; xx < ARROW_W; xx++) {
+ if (arrowPixels[ARROW_H-yy-1][xx] != 0) {
+ g->hLine(x1+xx, y1+yy, 1, 0);
}
}
}
}
if (closeable) {
if (closeBoxPressed) {
- g.fillRect(x + 6, y + 6, 6, 6);
+ fillRect(g, x + 6, y + 6, 6, 6);
} else {
drawBox(g, x + 5, y + 5, 7, 7);
}
}
}
+#if 0
if (title != null) {
// TODO: This "Chicago" is not faithful to the original one on the Mac.
Font f = new Font("Chicago", Font.BOLD, 12);
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 0e5be4fb8f..0410686d3f 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -58,10 +58,12 @@ public:
Gui();
~Gui();
- void paintBorder(Graphics::Surface *g, int x, int y, int width, int height);
+ void paintBorder(Graphics::Surface *g, int x, int y, int width, int height,
+ bool active, bool scrollable, bool closeable, bool closeBoxPressed);
private:
void drawBox(Graphics::Surface *g, int x, int y, int w, int h);
+ void fillRect(Graphics::Surface *g, int x, int y, int w, int h);
};
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index acff92f38b..882b11567b 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -128,7 +128,8 @@ Common::Error WageEngine::run() {
Scene *scene = _world->_orderedScenes[1];
scene->paint(&screen);
- _gui->paintBorder(&screen, 0, 0, scene->_design->getBounds()->width(), scene->_design->getBounds()->height());
+ _gui->paintBorder(&screen, 0, 0, scene->_design->getBounds()->width(), scene->_design->getBounds()->height(),
+ true, false, true, false);
g_system->copyRectToScreen(screen.getPixels(), screen.pitch, 0, 0, screen.w, screen.h);