[Scummvm-cvs-logs] scummvm master -> f299e96273cb73df34ec229aa0639db140b99286
sev-
sev at scummvm.org
Wed Mar 23 18:51:41 CET 2016
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c6abe904c4 WAGE: Proper scroll drawing
1addc5884a WAGE: Draw the scrollbar bar inverted to match the original
f299e96273 WAGE: Added detection for 3 more games
Commit: c6abe904c481671edb219b1b37bb5bd050610a7c
https://github.com/scummvm/scummvm/commit/c6abe904c481671edb219b1b37bb5bd050610a7c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-03-23T18:51:31+01:00
Commit Message:
WAGE: Proper scroll drawing
Changed paths:
engines/wage/gui.cpp
engines/wage/gui.h
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 9dd1a24..f95113f 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -310,7 +310,7 @@ const int arrowPixels[ARROW_H][ARROW_W] = {
{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, Common::Rect &r, WindowType windowType, int highlightedPart) {
+void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart, float scrollPos, float scrollSize) {
bool active = false, scrollable = false, closeable = false, drawTitle = false;
const int size = kBorderWidth;
int x = r.left - size;
@@ -351,39 +351,22 @@ void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowTy
} else {
int x1 = x + width - 15;
int y1 = y + size + 1;
- int color1 = kColorBlack;
- int color2 = kColorWhite;
- if (highlightedPart == kBorderScrollUp) {
- SWAP(color1, color2);
- fillRect(g, x + width - kBorderWidth + 2, y + size, size - 4, r.height() / 2);
- }
+
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, x1 + xx, color1);
- } else {
- g->hLine(x1 + xx, y1 + yy, x1 + xx, color2);
- }
- }
+ for (int xx = 0; xx < ARROW_W; xx++)
+ g->hLine(x1 + xx, y1 + yy, x1 + xx, (arrowPixels[yy][xx] != 0 ? kColorBlack : kColorWhite));
}
- fillRect(g, x + width - 13, y + size + ARROW_H, 8, r.height() / 2 - ARROW_H, color1);
- color1 = kColorBlack;
- color2 = kColorWhite;
- if (highlightedPart == kBorderScrollDown) {
- SWAP(color1, color2);
- fillRect(g, x + width - kBorderWidth + 2, y + size + r.height() / 2, size - 4, r.height() / 2);
- }
- fillRect(g, x + width - 13, y + size + r.height() / 2, 8, r.height() / 2 - ARROW_H, color1);
+ 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, x1 + xx, color1);
- } else {
- g->hLine(x1 + xx, y1 + yy, x1 + xx, color2);
- }
- }
+ for (int xx = 0; xx < ARROW_W; xx++)
+ g->hLine(x1 + xx, y1 + yy, x1 + xx, (arrowPixels[ARROW_H - yy - 1][xx] != 0 ? kColorBlack : kColorWhite));
+ }
+
+ if (highlightedPart == kBorderScrollUp || highlightedPart == kBorderScrollDown) {
+ fillRect(g, x + width - kBorderWidth + 2, y + size + r.height() * scrollPos, size - 4, r.height() * scrollSize, kColorGray);
}
}
if (closeable) {
@@ -619,7 +602,11 @@ void Gui::mouseDown(int x, int y) {
} else if (_consoleTextArea.contains(x, y)) {
startMarking(x, y);
} else if ((borderClick = isInBorder(_consoleTextArea, x, y)) != kBorderNone) {
- paintBorder(&_screen, _consoleTextArea, kWindowConsole, borderClick);
+ int textFullSize = _lines.size() * _consoleLineHeight + _consoleTextArea.height();
+ float scrollPos = (float)_scrollPos / textFullSize;
+ float scrollSize = (float)_consoleTextArea.height() / textFullSize;
+
+ paintBorder(&_screen, _consoleTextArea, kWindowConsole, borderClick, scrollPos, scrollSize);
}
}
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 73814d3..c136163 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -123,7 +123,8 @@ public:
private:
void undrawCursor();
void drawDesktop();
- void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart = kBorderNone);
+ void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart = kBorderNone,
+ float scrollPos = 0.0, float scrollSize = 0.0);
void renderConsole(Graphics::Surface *g, Common::Rect &r);
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, int color = kColorBlack);
Commit: 1addc5884aed78003b38c4c219796bccb81f9bb3
https://github.com/scummvm/scummvm/commit/1addc5884aed78003b38c4c219796bccb81f9bb3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-03-23T18:51:31+01:00
Commit Message:
WAGE: Draw the scrollbar bar inverted to match the original
Changed paths:
engines/wage/gui.cpp
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index f95113f..15d82a6 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -50,6 +50,7 @@
#include "graphics/cursorman.h"
#include "graphics/fonts/bdf.h"
#include "graphics/palette.h"
+#include "graphics/primitives.h"
#include "wage/wage.h"
#include "wage/design.h"
@@ -310,6 +311,16 @@ const int arrowPixels[ARROW_H][ARROW_W] = {
{0,1,1,1,1,1,1,1,1,1,1,0},
{1,1,1,1,1,1,1,1,1,1,1,1}};
+static void drawPixelInverted(int x, int y, int color, void *data) {
+ Graphics::Surface *surface = (Graphics::Surface *)data;
+
+ if (x >= 0 && x < surface->w && y >= 0 && y < surface->h) {
+ byte *p = (byte *)surface->getBasePtr(x, y);
+
+ *p = *p == kColorWhite ? kColorBlack : kColorWhite;
+ }
+}
+
void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart, float scrollPos, float scrollSize) {
bool active = false, scrollable = false, closeable = false, drawTitle = false;
const int size = kBorderWidth;
@@ -366,7 +377,13 @@ void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowTy
}
if (highlightedPart == kBorderScrollUp || highlightedPart == kBorderScrollDown) {
- fillRect(g, x + width - kBorderWidth + 2, y + size + r.height() * scrollPos, size - 4, r.height() * scrollSize, kColorGray);
+ int rx1 = x + width - kBorderWidth + 2;
+ int ry1 = y + size + r.height() * scrollPos;
+ int rx2 = rx1 + size - 4;
+ int ry2 = ry1 + r.height() * scrollSize;
+ Common::Rect rr(rx1, ry1, rx2, ry2);
+
+ Graphics::drawFilledRect(rr, kColorBlack, drawPixelInverted, g);
}
}
if (closeable) {
Commit: f299e96273cb73df34ec229aa0639db140b99286
https://github.com/scummvm/scummvm/commit/f299e96273cb73df34ec229aa0639db140b99286
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-03-23T18:51:32+01:00
Commit Message:
WAGE: Added detection for 3 more games
Changed paths:
engines/wage/detection_tables.h
diff --git a/engines/wage/detection_tables.h b/engines/wage/detection_tables.h
index 1a177c2..530b56c 100644
--- a/engines/wage/detection_tables.h
+++ b/engines/wage/detection_tables.h
@@ -64,6 +64,11 @@ static const ADGameDescription gameDescriptions[] = {
// Crash in console rendering on the first scene
FANGAME("Fantasy Quest", "4b0e1a1fbaaa4930accd0f9f0e1519c7", 762754),
FANGAME("Find the Heart", "595117cbed33e8de1ab3714b33880205", 106235), // From Joshua's Worlds 1.0
+ FANGAMEN("Fortune Teller", "Fortune Teller 1.1", "e5df11bfec42dd12b675ad4d98479ef3", 73931),
+ // Cropped graphics on first scene
+ FANGAME("Intro to Gothic", "d81f2d03a1e863f04fb1e3a5495b720e", 208067),
+ // No Next button in intro
+ FANGAME("Jamie the Demon Slayer", "94a9c4f8b3dabd1846d76215a49bd221", 232789),
// Problems with window overlay
FANGAMEN("Jumble", "LSJUMBLE", "e12ec4d76d48bdc86567c5e63750547e", 647339), // Original file name is "LSJUMBLE†"
FANGAME("Karth of the Jungle", "595117cbed33e8de1ab3714b33880205", 96711),
More information about the Scummvm-git-logs
mailing list