From 01625a01abc71fff54501d929bee5a6079bd3ee8 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 15 Feb 2009 13:54:53 +0000 Subject: Fix offset error in clearVideoBackGround(), that could cause menu glitches after fighting in Elvira 1. svn-id: r38238 --- engines/agos/vga.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index af876e9417..a42989e347 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -1120,7 +1120,7 @@ void AGOSEngine::vc34_setMouseOff() { void AGOSEngine::clearVideoBackGround(uint16 num, uint16 color) { const uint16 *vlut = &_videoWindows[num * 4]; - byte *dst = getBackGround() + vlut[0] * 16 + (vlut[1] * (vlut[2] * 16)); + byte *dst = getBackGround() + vlut[0] * 16 + vlut[1] * _dxSurfacePitch; for (uint h = 0; h < vlut[3]; h++) { memset(dst, color, vlut[2] * 16); @@ -1183,10 +1183,6 @@ void AGOSEngine::vc35_clearWindow() { uint16 num = vcReadNextWord(); uint16 color = vcReadNextWord(); - // Clear video window - clearVideoWindow(num, color); - _vgaSpriteChanged++; - // Clear video background if (getGameType() == GType_ELVIRA1) { if (num == 2 || num == 6) @@ -1199,7 +1195,10 @@ void AGOSEngine::vc35_clearWindow() { return; } + // Clear video window + clearVideoWindow(num, color); clearVideoBackGround(num, color); + _vgaSpriteChanged++; } void AGOSEngine::vc36_setWindowImage() { -- cgit v1.2.3