aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/charset.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-06-08 02:18:22 +0000
committerTravis Howell2007-06-08 02:18:22 +0000
commitc03fe8e8cf1bfa2115c6288598628d26ab86f8bc (patch)
treeca882d3fda9e467626f7bf00c5ce1b22c6289e72 /engines/agos/charset.cpp
parent56a7a29c4275f829134ed869cf74ea5a312dcec2 (diff)
downloadscummvm-rg350-c03fe8e8cf1bfa2115c6288598628d26ab86f8bc.tar.gz
scummvm-rg350-c03fe8e8cf1bfa2115c6288598628d26ab86f8bc.tar.bz2
scummvm-rg350-c03fe8e8cf1bfa2115c6288598628d26ab86f8bc.zip
Fix window scrolling in earlier games.
svn-id: r27183
Diffstat (limited to 'engines/agos/charset.cpp')
-rw-r--r--engines/agos/charset.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp
index 93d2ec7e58..ce772b46e6 100644
--- a/engines/agos/charset.cpp
+++ b/engines/agos/charset.cpp
@@ -699,13 +699,40 @@ void AGOSEngine::windowNewLine(WindowBlock *window) {
window->textLength = 0;
if (window->textRow == window->height) {
- // TODO
- debug(0, "Window Scroll");
+ if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 ||
+ getGameType() == GType_WW) {
+ windowScroll(window);
+ }
} else {
window->textRow++;
}
}
+void AGOSEngine::windowScroll(WindowBlock *window) {
+ _lockWord |= 0x8000;
+
+ if (window->height != 1) {
+ byte *src, *dst;
+ uint16 w, h;
+
+ w = window->width * 8;
+ h = (window->height -1) * 8;
+
+ dst = getFrontBuf() + window->y * _screenWidth + window->x * 8;
+ src = dst + 8 * _screenWidth;
+
+ do {
+ memcpy(dst, src, w);
+ src += _screenWidth;
+ dst += _screenWidth;
+ } while (--h);
+ }
+
+ colorBlock(window, window->x * 8, (window->height - 1) * 8 + window->y, window->width * 8, 8);
+
+ _lockWord &= ~0x8000;
+}
+
#ifdef PALMOS_68K
static const byte *feeble_windowFont;
static const byte *czech_simonFont;