aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorDavid Corrales2007-07-08 16:58:54 +0000
committerDavid Corrales2007-07-08 16:58:54 +0000
commit9bfe5d53540af7dc9bf0214202f4e35b272320ea (patch)
tree69dcaf6f735e9fd0913a3e2f163852d4b9af87e3 /engines/agi
parent256e4d9521b79160d1f9ed670656097a96dc5a34 (diff)
parent17da12ca07a1f18f3fe1ef5b0c2c0cd9fd8359b4 (diff)
downloadscummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.gz
scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.bz2
scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.zip
Merged the FSNode branch with trunk r27681:27969
svn-id: r27970
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/agi.cpp2
-rw-r--r--engines/agi/agi.h12
-rw-r--r--engines/agi/cycle.cpp21
-rw-r--r--engines/agi/graphics.cpp161
-rw-r--r--engines/agi/graphics.h3
-rw-r--r--engines/agi/keyboard.cpp14
-rw-r--r--engines/agi/op_cmd.cpp12
-rw-r--r--engines/agi/picture.cpp4
-rw-r--r--engines/agi/saveload.cpp63
-rw-r--r--engines/agi/sprite.cpp13
-rw-r--r--engines/agi/words.cpp2
11 files changed, 219 insertions, 88 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 74795271fc..0839b7de99 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -334,7 +334,7 @@ void AgiEngine::replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
case ADD_PIC:
debugC(8, kDebugLevelMain, "--- decoding picture %d ---", p1);
agiLoadResource(rPICTURE, p1);
- _picture->decodePicture(p1, p2);
+ _picture->decodePicture(p1, p2, p3 != 0);
break;
case ADD_VIEW:
agiLoadResource(rVIEW, p1);
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 56ae1288b8..01db2acb23 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -247,6 +247,18 @@ enum {
};
/**
+ * Different monitor types.
+ * Used with AGI variable 26 i.e. vMonitor.
+ */
+enum AgiMonitorType {
+ kAgiMonitorCga = 0,
+ // kAgiMonitorTandy = 1, // Not sure about this
+ kAgiMonitorHercules = 2,
+ kAgiMonitorEga = 3
+ // kAgiMonitorVga = 4 // Not sure about this
+};
+
+/**
* AGI flags
*/
enum {
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 22d2582021..bd8fcb0394 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -367,7 +367,26 @@ int AgiEngine::runGame() {
setvar(vComputer, 0); /* IBM PC (4 = Atari ST) */
setvar(vSoundgen, 1); /* IBM PC SOUND */
- setvar(vMonitor, 0x3); /* EGA monitor */
+
+ // Set monitor type (v26 i.e. vMonitor)
+ switch (_renderMode) {
+ case Common::kRenderCGA:
+ setvar(vMonitor, kAgiMonitorCga);
+ break;
+ case Common::kRenderHercG:
+ case Common::kRenderHercA:
+ setvar(vMonitor, kAgiMonitorHercules);
+ break;
+ // Don't know if Amiga AGI games use a different value than kAgiMonitorEga
+ // for vMonitor so I just use kAgiMonitorEga for them (As was done before too).
+ case Common::kRenderAmiga:
+ case Common::kRenderDefault:
+ case Common::kRenderEGA:
+ default:
+ setvar(vMonitor, kAgiMonitorEga);
+ break;
+ }
+
setvar(vMaxInputChars, 38);
_game.inputMode = INPUT_NONE;
_game.inputEnabled = 0;
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 2d64a4352e..54f1783d83 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -624,8 +624,7 @@ int GfxMgr::keypress() {
/**
* Initialize the color palette
* This function initializes the color palette using the specified 16-color
- * RGB palette and creates 16 extra palette entries with translucent colors
- * for the interpreter console.
+ * RGB palette.
* @param p A pointer to the 16-color RGB palette.
*/
void GfxMgr::initPalette(uint8 *p) {
@@ -633,7 +632,6 @@ void GfxMgr::initPalette(uint8 *p) {
for (i = 0; i < 48; i++) {
_palette[i] = p[i];
- _palette[i + 48] = (p[i] + 0x30) >> 2;
}
}
@@ -642,13 +640,13 @@ void GfxMgr::gfxSetPalette() {
byte pal[256 * 4];
if (!(_vm->getFeatures() & (GF_AGI256 | GF_AGI256_2))) {
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < 16; i++) {
pal[i * 4 + 0] = _palette[i * 3 + 0] << 2;
pal[i * 4 + 1] = _palette[i * 3 + 1] << 2;
pal[i * 4 + 2] = _palette[i * 3 + 2] << 2;
pal[i * 4 + 3] = 0;
}
- g_system->setPalette(pal, 0, 32);
+ g_system->setPalette(pal, 0, 16);
} else {
for (i = 0; i < 256; i++) {
pal[i * 4 + 0] = vgaPalette[i * 3 + 0];
@@ -715,19 +713,107 @@ void GfxMgr::gfxPutBlock(int x1, int y1, int x2, int y2) {
g_system->copyRectToScreen(_screen + y1 * 320 + x1, 320, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
-static const byte mouseCursorArrow[] = {
- // This is the same arrow cursor that was later used in early SCI games
- 0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x70, 0x00,
- 0x78, 0x00, 0x7C, 0x00, 0x7E, 0x00, 0x7F, 0x00,
- 0x7F, 0x80, 0x7F, 0xC0, 0x7C, 0x00, 0x46, 0x00,
- 0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x80,
- 0xC0, 0x00, 0xA0, 0x00, 0x90, 0x00, 0x88, 0x00,
- 0x84, 0x00, 0x82, 0x00, 0x81, 0x00, 0x80, 0x80,
- 0x80, 0x40, 0x80, 0x20, 0x82, 0x00, 0xA9, 0x00,
- 0xC9, 0x00, 0x04, 0x80, 0x04, 0x80, 0x02, 0x40
+/**
+ * A black and white SCI-style arrow cursor (11x16).
+ * 0 = Transparent.
+ * 1 = Black (#000000 in 24-bit RGB).
+ * 2 = White (#FFFFFF in 24-bit RGB).
+ */
+static const byte sciMouseCursor[] = {
+ 1,1,0,0,0,0,0,0,0,0,0,
+ 1,2,1,0,0,0,0,0,0,0,0,
+ 1,2,2,1,0,0,0,0,0,0,0,
+ 1,2,2,2,1,0,0,0,0,0,0,
+ 1,2,2,2,2,1,0,0,0,0,0,
+ 1,2,2,2,2,2,1,0,0,0,0,
+ 1,2,2,2,2,2,2,1,0,0,0,
+ 1,2,2,2,2,2,2,2,1,0,0,
+ 1,2,2,2,2,2,2,2,2,1,0,
+ 1,2,2,2,2,2,2,2,2,2,1,
+ 1,2,2,2,2,2,1,0,0,0,0,
+ 1,2,1,0,1,2,2,1,0,0,0,
+ 1,1,0,0,1,2,2,1,0,0,0,
+ 0,0,0,0,0,1,2,2,1,0,0,
+ 0,0,0,0,0,1,2,2,1,0,0,
+ 0,0,0,0,0,0,1,2,2,1,0
+};
+
+/**
+ * RGBA-palette for the black and white SCI-style arrow cursor.
+ */
+static const byte sciMouseCursorPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, // Black
+ 0xFF, 0xFF, 0xFF, 0x00 // White
+};
+
+/**
+ * An Amiga-style arrow cursor (8x11).
+ * 0 = Transparent.
+ * 1 = Black (#000000 in 24-bit RGB).
+ * 2 = Red (#DE2021 in 24-bit RGB).
+ * 3 = Light red (#FFCFAD in 24-bit RGB).
+ */
+static const byte amigaMouseCursor[] = {
+ 2,3,1,0,0,0,0,0,
+ 2,2,3,1,0,0,0,0,
+ 2,2,2,3,1,0,0,0,
+ 2,2,2,2,3,1,0,0,
+ 2,2,2,2,2,3,1,0,
+ 2,2,2,2,2,2,3,1,
+ 2,0,2,2,3,1,0,0,
+ 0,0,0,2,3,1,0,0,
+ 0,0,0,2,2,3,1,0,
+ 0,0,0,0,2,3,1,0,
+ 0,0,0,0,2,2,3,1
+};
+
+/**
+ * RGBA-palette for the Amiga-style arrow cursor
+ * and the Amiga-style busy cursor.
+ */
+static const byte amigaMouseCursorPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, // Black
+ 0xDE, 0x20, 0x21, 0x00, // Red
+ 0xFF, 0xCF, 0xAD, 0x00 // Light red
};
/**
+ * An Amiga-style busy cursor showing an hourglass (13x16).
+ * 0 = Transparent.
+ * 1 = Black (#000000 in 24-bit RGB).
+ * 2 = Red (#DE2021 in 24-bit RGB).
+ * 3 = Light red (#FFCFAD in 24-bit RGB).
+ */
+static const byte busyAmigaMouseCursor[] = {
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,2,2,2,2,2,2,2,2,2,2,2,1,
+ 1,2,2,2,2,2,2,2,2,2,2,2,1,
+ 0,1,3,3,3,3,3,3,3,3,3,1,0,
+ 0,0,1,3,3,3,3,3,3,3,1,0,0,
+ 0,0,0,1,3,3,3,3,3,1,0,0,0,
+ 0,0,0,0,1,3,3,3,1,0,0,0,0,
+ 0,0,0,0,0,1,3,1,0,0,0,0,0,
+ 0,0,0,0,0,1,3,1,0,0,0,0,0,
+ 0,0,0,0,1,2,3,2,1,0,0,0,0,
+ 0,0,0,1,2,2,3,2,2,1,0,0,0,
+ 0,0,1,2,2,2,3,2,2,2,1,0,0,
+ 0,1,2,2,2,3,3,3,2,2,2,1,0,
+ 1,3,3,3,3,3,3,3,3,3,3,3,1,
+ 1,3,3,3,3,3,3,3,3,3,3,3,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1
+};
+
+void GfxMgr::setCursor(bool amigaStyleCursor) {
+ if (!amigaStyleCursor) {
+ CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4);
+ CursorMan.replaceCursor(sciMouseCursor, 11, 16, 1, 1, 0);
+ } else { // amigaStyleCursor
+ CursorMan.replaceCursorPalette(amigaMouseCursorPalette, 1, ARRAYSIZE(amigaMouseCursorPalette) / 4);
+ CursorMan.replaceCursor(amigaMouseCursor, 8, 11, 1, 1, 0);
+ }
+}
+
+/**
* Initialize graphics device.
*
* @see deinit_video()
@@ -743,31 +829,7 @@ int GfxMgr::initVideo() {
gfxSetPalette();
- byte mouseCursor[16 * 16];
- const byte *src = mouseCursorArrow;
- for (int i = 0; i < 32; ++i) {
- int offs = i * 8;
- for (byte mask = 0x80; mask != 0; mask >>= 1) {
- if (src[0] & mask) {
- mouseCursor[offs] = 2;
- } else if (src[32] & mask) {
- mouseCursor[offs] = 0;
- } else {
- mouseCursor[offs] = 0xFF;
- }
- ++offs;
- }
- ++src;
- }
-
- const byte cursorPalette[] = {
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 255, 255, 255, 0
- };
-
- CursorMan.replaceCursorPalette(cursorPalette, 0, 3);
- CursorMan.replaceCursor(mouseCursor, 16, 16, 1, 1);
+ setCursor(_vm->_renderMode == Common::kRenderAmiga);
return errOK;
}
@@ -804,23 +866,26 @@ int GfxMgr::deinitMachine() {
* @param x x coordinate of the row start (AGI coord.)
* @param y y coordinate of the row start (AGI coord.)
* @param n number of pixels in the row
- * @param p pointer to the row start in the AGI screen
+ * @param p pointer to the row start in the AGI screen (Always use sbuf16c as base, not sbuf256c)
+ * FIXME: CGA rendering doesn't work correctly with AGI256 or AGI256-2.
*/
void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) {
+ const uint rShift = _vm->_debug.priority ? 4 : 0; // Priority information is in the top 4 bits of a byte taken from sbuf16c.
+
+ // Choose the correct screen to read from. If AGI256 or AGI256-2 is used and we're not trying to show the priority information,
+ // then choose the 256 color screen, otherwise choose the 16 color screen (Which also has the priority information).
+ p += _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) && !_vm->_debug.priority ? FROM_SBUF16_TO_SBUF256_OFFSET : 0;
+
if (_vm->_renderMode == Common::kRenderCGA) {
for (x *= 2; n--; p++, x += 2) {
register uint16 q = (cgaMap[(*p & 0xf0) >> 4] << 4) | cgaMap[*p & 0x0f];
- if (_vm->_debug.priority)
- q >>= 4;
- *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = q & 0x0f0f;
+ *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = (q >> rShift) & 0x0f0f;
}
} else {
- const uint16 mask = _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) ? 0xffff : 0x0f0f;
+ const uint16 mask = _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) && !_vm->_debug.priority ? 0xffff : 0x0f0f;
for (x *= 2; n--; p++, x += 2) {
register uint16 q = ((uint16) * p << 8) | *p;
- if (_vm->_debug.priority)
- q >>= 4;
- *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = q & mask;
+ *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = (q >> rShift) & mask;
}
}
}
diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h
index cdbae8d6e6..b1f9c0e1d7 100644
--- a/engines/agi/graphics.h
+++ b/engines/agi/graphics.h
@@ -41,7 +41,7 @@ class GfxMgr {
private:
AgiEngine *_vm;
- uint8 _palette[32 * 3];
+ uint8 _palette[16 * 3];
uint8 *_agiScreen;
unsigned char *_screen;
@@ -87,6 +87,7 @@ public:
void putPixel(int, int, int);
void putBlock(int x1, int y1, int x2, int y2);
void gfxSetPalette();
+ void setCursor(bool amigaStyleCursor = false);
int keypress();
int getKey();
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 17865e1f3a..3acc81ddff 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -29,6 +29,9 @@
#include "agi/graphics.h"
#include "agi/keyboard.h"
#include "agi/menu.h"
+#ifdef __DS__
+#include "wordcompletion.h"
+#endif
namespace Agi {
@@ -308,6 +311,9 @@ void AgiEngine::handleKeys(int key) {
debugC(3, kDebugLevelInput, "clear lines");
clearLines(l, l + 1, bg);
flushLines(l, l + 1);
+#ifdef __DS__
+ DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
break;
case KEY_ESCAPE:
@@ -324,6 +330,10 @@ void AgiEngine::handleKeys(int key) {
_game.inputBuffer[--_game.cursorPos] = 0;
/* Print cursor */
_gfx->printCharacter(_game.cursorPos + 1, l, _game.cursorChar, fg, bg);
+
+#ifdef __DS__
+ DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
break;
default:
/* Ignore invalid keystrokes */
@@ -337,6 +347,10 @@ void AgiEngine::handleKeys(int key) {
_game.inputBuffer[_game.cursorPos++] = key;
_game.inputBuffer[_game.cursorPos] = 0;
+#ifdef __DS__
+ DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
+
/* echo */
_gfx->printCharacter(_game.cursorPos, l, _game.inputBuffer[_game.cursorPos - 1], fg, bg);
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index c51514f237..588ee1dd30 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -153,6 +153,18 @@ cmd(toggle_v) {
cmd(new_room) {
g_agi->newRoom(p0);
+
+ // WORKAROUND: Works around intro skipping bug (#1737343) in Gold Rush.
+ // Intro was skipped because the enter-keypress finalizing the entering
+ // of the copy protection string (Copy protection is in logic.128) was
+ // left over to the intro scene (Starts with room 73 i.e. logic.073).
+ // The intro scene checks for any keys pressed and if it finds any it
+ // jumps to the game's start (Room 1 i.e. logic.001). We clear the
+ // keyboard buffer when the intro sequence's first room (Room 73) is
+ // loaded so that no keys from the copy protection scene can be left
+ // over to cause the intro to skip to the game's start.
+ if (g_agi->getGameID() == GID_GOLDRUSH && p0 == 73)
+ game.keypress = 0;
}
cmd(new_room_f) {
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index cd8ef83de0..144e965465 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -652,7 +652,7 @@ int PictureMgr::decodePicture(int n, int clear, bool agi256) {
if (clear)
_vm->clearImageStack();
- _vm->recordImageStackCall(ADD_PIC, n, clear, 0, 0, 0, 0, 0);
+ _vm->recordImageStackCall(ADD_PIC, n, clear, agi256, 0, 0, 0, 0);
return errOK;
}
@@ -686,7 +686,7 @@ void PictureMgr::showPic() {
i = 0;
offset = _vm->_game.lineMinPrint * CHAR_LINES;
for (y = 0; y < _HEIGHT; y++) {
- _gfx->putPixelsA(0, y + offset, _WIDTH, &_vm->_game.sbuf[i]);
+ _gfx->putPixelsA(0, y + offset, _WIDTH, &_vm->_game.sbuf16c[i]);
i += _WIDTH;
}
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index ab5f818d17..9144dae96c 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -519,41 +519,48 @@ int AgiEngine::selectSlot() {
_gfx->drawButton(buttonX[i], buttonY, buttonText[i], 0, 0, MSG_BOX_TEXT, MSG_BOX_COLOUR);
AllowSyntheticEvents on(this);
+ int oldFirstSlot = _firstSlot + 1;
+ int oldActive = active + 1;
for (;;) {
- char dstr[64];
- for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
- sprintf(dstr, "[%2d. %-28.28s]", i + _firstSlot, desc[i]);
- printText(dstr, 0, hm + 1, vm + 4 + i,
- (40 - 2 * hm) - 1, i == active ? MSG_BOX_COLOUR : MSG_BOX_TEXT,
- i == active ? MSG_BOX_TEXT : MSG_BOX_COLOUR);
- }
+ int sbPos;
- char upArrow[] = "^";
- char downArrow[] = "v";
- char scrollBar[] = " ";
+ if (oldFirstSlot != _firstSlot || oldActive != active) {
+ char dstr[64];
+ for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
+ sprintf(dstr, "[%2d. %-28.28s]", i + _firstSlot, desc[i]);
+ printText(dstr, 0, hm + 1, vm + 4 + i,
+ (40 - 2 * hm) - 1, i == active ? MSG_BOX_COLOUR : MSG_BOX_TEXT,
+ i == active ? MSG_BOX_TEXT : MSG_BOX_COLOUR);
+ }
- int sbPos;
+ char upArrow[] = "^";
+ char downArrow[] = "v";
+ char scrollBar[] = " ";
+
+ // Use the extreme scrollbar positions only if the
+ // extreme slots are in sight.
+
+ if (_firstSlot == 0)
+ sbPos = 1;
+ else if (_firstSlot == NUM_SLOTS - NUM_VISIBLE_SLOTS)
+ sbPos = NUM_VISIBLE_SLOTS - 2;
+ else {
+ sbPos = 2 + (_firstSlot * (NUM_VISIBLE_SLOTS - 4)) / (NUM_SLOTS - NUM_VISIBLE_SLOTS - 1);
+ if (sbPos >= NUM_VISIBLE_SLOTS - 3)
+ sbPos = NUM_VISIBLE_SLOTS - 3;
+ }
- // Use the extreme scrollbar positions only if the extreme
- // slots are in sight.
-
- if (_firstSlot == 0)
- sbPos = 1;
- else if (_firstSlot == NUM_SLOTS - NUM_VISIBLE_SLOTS)
- sbPos = NUM_VISIBLE_SLOTS - 2;
- else {
- sbPos = 2 + (_firstSlot * (NUM_VISIBLE_SLOTS - 4)) / (NUM_SLOTS - NUM_VISIBLE_SLOTS - 1);
- if (sbPos >= NUM_VISIBLE_SLOTS - 3)
- sbPos = NUM_VISIBLE_SLOTS - 3;
- }
+ for (i = 1; i < NUM_VISIBLE_SLOTS - 1; i++)
+ printText(scrollBar, 35, hm + 1, vm + 4 + i, 1, MSG_BOX_COLOUR, 7, true);
- for (i = 1; i < NUM_VISIBLE_SLOTS - 1; i++)
- printText(scrollBar, 35, hm + 1, vm + 4 + i, 1, MSG_BOX_COLOUR, 7, true);
+ printText(upArrow, 35, hm + 1, vm + 4, 1, 8, 7);
+ printText(downArrow, 35, hm + 1, vm + 4 + NUM_VISIBLE_SLOTS - 1, 1, 8, 7);
+ printText(scrollBar, 35, hm + 1, vm + 4 + sbPos, 1, MSG_BOX_COLOUR, MSG_BOX_TEXT);
- printText(upArrow, 35, hm + 1, vm + 4, 1, 8, 7);
- printText(downArrow, 35, hm + 1, vm + 4 + NUM_VISIBLE_SLOTS - 1, 1, 8, 7);
- printText(scrollBar, 35, hm + 1, vm + 4 + sbPos, 1, MSG_BOX_COLOUR, MSG_BOX_TEXT);
+ oldActive = active;
+ oldFirstSlot = _firstSlot;
+ }
_gfx->pollTimer(); /* msdos driver -> does nothing */
key = doPollKeyboard();
diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp
index 3d69968075..006e3dddee 100644
--- a/engines/agi/sprite.cpp
+++ b/engines/agi/sprite.cpp
@@ -215,7 +215,8 @@ void SpritesMgr::objsRestoreArea(Sprite *s) {
int y, offset;
int16 xPos = s->xPos, yPos = s->yPos;
int16 xSize = s->xSize, ySize = s->ySize;
- uint8 *p0, *q;
+ uint8 *q;
+ uint32 pos0;
if (xPos + xSize > _WIDTH)
xSize = _WIDTH - xPos;
@@ -236,14 +237,14 @@ void SpritesMgr::objsRestoreArea(Sprite *s) {
if (xSize <= 0 || ySize <= 0)
return;
- p0 = &_vm->_game.sbuf[xPos + yPos * _WIDTH];
+ pos0 = xPos + yPos * _WIDTH;
q = s->buffer;
offset = _vm->_game.lineMinPrint * CHAR_LINES;
for (y = 0; y < ySize; y++) {
- memcpy(p0, q, xSize);
- _gfx->putPixelsA(xPos, yPos + y + offset, xSize, p0);
+ memcpy(&_vm->_game.sbuf[pos0], q, xSize);
+ _gfx->putPixelsA(xPos, yPos + y + offset, xSize, &_vm->_game.sbuf16c[pos0]);
q += xSize;
- p0 += _WIDTH;
+ pos0 += _WIDTH;
}
}
@@ -728,7 +729,7 @@ void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2) {
debugC(7, kDebugLevelSprites, "%d, %d, %d, %d", x1, y1, x2, y2);
w = x2 - x1 + 1;
- q = &_vm->_game.sbuf[x1 + _WIDTH * y1];
+ q = &_vm->_game.sbuf16c[x1 + _WIDTH * y1];
offset = _vm->_game.lineMinPrint * CHAR_LINES;
for (i = y1; i <= y2; i++) {
_gfx->putPixelsA(x1, i + offset, w, q);
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index 5fc3c3bca9..ed33b9463a 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -88,7 +88,7 @@ void AgiEngine::unloadWords() {
* Uses an algorithm hopefully like the one Sierra used. Returns the ID
* of the word and the length in flen. Returns -1 if not found.
*
- * Thomas Åkesson, November 2001
+ * Thomas Akesson, November 2001
*/
int AgiEngine::findWord(char *word, int *flen) {
int mchr = 0; /* matched chars */