aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
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
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')
-rw-r--r--engines/agos/agos.h1
-rw-r--r--engines/agos/charset.cpp31
-rw-r--r--engines/agos/window.cpp6
3 files changed, 32 insertions, 6 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 3f2fcd6c06..a5b9f4a3cc 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1188,6 +1188,7 @@ protected:
void tidyIconArray(uint i);
virtual void windowNewLine(WindowBlock *window);
+ void windowScroll(WindowBlock *window);
void windowDrawChar(WindowBlock *window, uint x, uint y, byte chr);
void loadMusic(uint track);
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;
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index 0c3e124e4b..aefe623952 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -128,12 +128,10 @@ void AGOSEngine_Feeble::colorWindow(WindowBlock *window) {
}
void AGOSEngine::colorWindow(WindowBlock *window) {
- uint16 x, y, h, w;
+ uint16 y, h;
- x = window->x * 8;
y = window->y;
h = window->height * 8;
- w = window->width * 8;
if (getGameType() == GType_ELVIRA2 && window->y == 146) {
if (window->fill_color == 1) {
@@ -152,7 +150,7 @@ void AGOSEngine::colorWindow(WindowBlock *window) {
_paletteFlag = 1;
}
- colorBlock(window, x, y, w, h);
+ colorBlock(window, window->x * 8, y, window->width * 8, h);
}
void AGOSEngine::colorBlock(WindowBlock *window, uint16 x, uint16 y, uint16 w, uint16 h) {