From 0d789e074e6ff1ed76e75619eae9d337d3faad29 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 28 May 2007 08:54:13 +0000 Subject: Fix glitches caused by interface differences in the AtariST verison of Elvira 2. svn-id: r26988 --- engines/agos/event.cpp | 18 ++++++++++-------- engines/agos/script_e2.cpp | 11 ++++++----- engines/agos/vga.cpp | 7 +++++++ 3 files changed, 23 insertions(+), 13 deletions(-) (limited to 'engines') diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 9fc8cb72e5..a46661c205 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -362,10 +362,11 @@ static const byte _image4[32] = { 0x3A, 0x3A, 0x3B, 0x3A, }; -void AGOSEngine::drawStuff(const byte *src, uint offs) { - byte *dst = getFrontBuf() + offs; +void AGOSEngine::drawStuff(const byte *src, uint xoffs) { + const uint8 y = (getPlatform() == Common::kPlatformAtariST) ? 132 : 135; + byte *dst = getFrontBuf() + y * _screenWidth + xoffs; - for (uint y = 0; y < 6; y++) { + for (uint h = 0; h < 6; h++) { memcpy(dst, src, 4); src += 4; dst += _screenWidth; @@ -373,11 +374,11 @@ void AGOSEngine::drawStuff(const byte *src, uint offs) { } void AGOSEngine::imageEvent2(VgaTimerEntry * vte, uint dx) { - // Draws damage indicator gauge + // Draws damage indicator gauge when player hit _nextVgaTimerToProcess = vte + 1; if (!_opcode177Var1) { - drawStuff(_image1, 43204 + _opcode177Var2 * 4); + drawStuff(_image1, 4 + _opcode177Var2 * 4); _opcode177Var2++; if (_opcode177Var2 == dx) { _opcode177Var1 = 1; @@ -387,7 +388,7 @@ void AGOSEngine::imageEvent2(VgaTimerEntry * vte, uint dx) { } } else if (_opcode177Var2) { _opcode177Var2--; - drawStuff(_image2, 43204 + _opcode177Var2 * 4); + drawStuff(_image2, 4 + _opcode177Var2 * 4); vte->delay = 3; } else { deleteVgaEvent(vte); @@ -395,10 +396,11 @@ void AGOSEngine::imageEvent2(VgaTimerEntry * vte, uint dx) { } void AGOSEngine::imageEvent3(VgaTimerEntry * vte, uint dx) { + // Draws damage indicator gauge when monster hit _nextVgaTimerToProcess = vte + 1; if (!_opcode178Var1) { - drawStuff(_image3, 43475 + _opcode178Var2 * 4); + drawStuff(_image3, 275 + _opcode178Var2 * 4); _opcode178Var2++; if (_opcode178Var2 >= 10 || _opcode178Var2 == dx) { _opcode178Var1 = 1; @@ -408,7 +410,7 @@ void AGOSEngine::imageEvent3(VgaTimerEntry * vte, uint dx) { } } else if (_opcode178Var2) { _opcode178Var2--; - drawStuff(_image4, 43475 + _opcode178Var2 * 4); + drawStuff(_image4, 275 + _opcode178Var2 * 4); vte->delay = 3; } else { deleteVgaEvent(vte); diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index ac278a6426..2ffb60731f 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -498,6 +498,7 @@ void AGOSEngine_Elvira2::oe2_printStats() { // 161: print stats WindowBlock *window = _dummyWindow; int val; + const uint8 y = (getPlatform() == Common::kPlatformAtariST) ? 131 : 134; window->flags = 1; @@ -509,7 +510,7 @@ void AGOSEngine_Elvira2::oe2_printStats() { val = -99; if (val > 99) val = 99; - writeChar(window, 10, 134, 0, val); + writeChar(window, 10, y, 0, val); // PP val = _variableArray[22]; @@ -517,7 +518,7 @@ void AGOSEngine_Elvira2::oe2_printStats() { val = -99; if (val > 99) val = 99; - writeChar(window, 16, 134, 6, val); + writeChar(window, 16, y, 6, val); // HP val = _variableArray[23]; @@ -525,7 +526,7 @@ void AGOSEngine_Elvira2::oe2_printStats() { val = -99; if (val > 99) val = 99; - writeChar(window, 23, 134, 4, val); + writeChar(window, 23, y, 4, val); // Experience val = _variableArray[21]; @@ -533,8 +534,8 @@ void AGOSEngine_Elvira2::oe2_printStats() { val = -99; if (val > 9999) val = 9999; - writeChar(window, 30, 134, 6, val / 100); - writeChar(window, 32, 134, 2, val / 10); + writeChar(window, 30, y, 6, val / 100); + writeChar(window, 32, y, 2, val / 10); mouseOn(); } diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index ac8bde5d4f..be76b69c64 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -606,6 +606,13 @@ void AGOSEngine::vc10_draw() { flags = vcReadNextWord(); } + if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformAtariST) { + if (((image >= 11 && image <= 16) || (image >= 195 && image <= 198)) && + _vgaCurSpriteId == 100) { + y += 75; + } + } + drawImage_init(image, palette, x, y, flags); } -- cgit v1.2.3