[Scummvm-cvs-logs] SF.net SVN: scummvm: [27184] scummvm/branches/branch-0-10-0/engines/agos
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Fri Jun 8 04:19:22 CEST 2007
Revision: 27184
http://scummvm.svn.sourceforge.net/scummvm/?rev=27184&view=rev
Author: Kirben
Date: 2007-06-07 19:19:22 -0700 (Thu, 07 Jun 2007)
Log Message:
-----------
Fix window scrolling in earlier games.
Modified Paths:
--------------
scummvm/branches/branch-0-10-0/engines/agos/agos.h
scummvm/branches/branch-0-10-0/engines/agos/charset.cpp
scummvm/branches/branch-0-10-0/engines/agos/window.cpp
Modified: scummvm/branches/branch-0-10-0/engines/agos/agos.h
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/agos.h 2007-06-08 02:18:22 UTC (rev 27183)
+++ scummvm/branches/branch-0-10-0/engines/agos/agos.h 2007-06-08 02:19:22 UTC (rev 27184)
@@ -1188,6 +1188,7 @@
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);
Modified: scummvm/branches/branch-0-10-0/engines/agos/charset.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/charset.cpp 2007-06-08 02:18:22 UTC (rev 27183)
+++ scummvm/branches/branch-0-10-0/engines/agos/charset.cpp 2007-06-08 02:19:22 UTC (rev 27184)
@@ -699,13 +699,40 @@
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;
Modified: scummvm/branches/branch-0-10-0/engines/agos/window.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/window.cpp 2007-06-08 02:18:22 UTC (rev 27183)
+++ scummvm/branches/branch-0-10-0/engines/agos/window.cpp 2007-06-08 02:19:22 UTC (rev 27184)
@@ -128,12 +128,10 @@
}
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 @@
_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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list