From d30033fc0499491487a872fd8a99738f781a9541 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 19 Apr 2009 01:28:27 +0000 Subject: Fix possible overwriting of sound data in earlier games, and cleanup. svn-id: r40015 --- engines/agos/zones.cpp | 53 +++++--------------------------------------------- 1 file changed, 5 insertions(+), 48 deletions(-) (limited to 'engines/agos/zones.cpp') diff --git a/engines/agos/zones.cpp b/engines/agos/zones.cpp index 86f2edc820..b8d2d7c04a 100644 --- a/engines/agos/zones.cpp +++ b/engines/agos/zones.cpp @@ -144,12 +144,12 @@ byte *AGOSEngine::allocBlock(uint32 size) { } void AGOSEngine::checkRunningAnims() { - VgaSprite *vsp; - if (getGameType() != GType_FF && getGameType() != GType_PP && + if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) && (_videoLockOut & 0x20)) { return; } + VgaSprite *vsp; for (vsp = _vgaSprites; vsp->id; vsp++) { checkAnims(vsp->zoneNum); if (_rejectBlock == true) @@ -157,7 +157,7 @@ void AGOSEngine::checkRunningAnims() { } } -void AGOSEngine_Feeble::checkNoOverWrite() { +void AGOSEngine::checkNoOverWrite() { VgaPointersEntry *vpe; if (_noOverWrite == 0xFFFF) @@ -179,7 +179,7 @@ void AGOSEngine_Feeble::checkNoOverWrite() { } } -void AGOSEngine_Feeble::checkAnims(uint a) { +void AGOSEngine::checkAnims(uint a) { VgaPointersEntry *vpe; vpe = &_vgaBufferPointers[a]; @@ -198,7 +198,7 @@ void AGOSEngine_Feeble::checkAnims(uint a) { } } -void AGOSEngine_Feeble::checkZonePtrs() { +void AGOSEngine::checkZonePtrs() { uint count = ARRAYSIZE(_vgaBufferPointers); VgaPointersEntry *vpe = _vgaBufferPointers; do { @@ -215,49 +215,6 @@ void AGOSEngine_Feeble::checkZonePtrs() { } while (++vpe, --count); } -void AGOSEngine::checkNoOverWrite() { - VgaPointersEntry *vpe; - - if (_noOverWrite == 0xFFFF) - return; - - vpe = &_vgaBufferPointers[_noOverWrite]; - - if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) || - ((_vgaMemPtr <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) { - _rejectBlock = true; - _vgaMemPtr = vpe->vgaFile1 + 0x5000; - } else { - _rejectBlock = false; - } -} - -void AGOSEngine::checkAnims(uint a) { - VgaPointersEntry *vpe; - - vpe = &_vgaBufferPointers[a]; - - if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) || - ((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) { - _rejectBlock = true; - _vgaMemPtr = vpe->vgaFile1 + 0x5000; - } else { - _rejectBlock = false; - } -} - -void AGOSEngine::checkZonePtrs() { - uint count = ARRAYSIZE(_vgaBufferPointers); - VgaPointersEntry *vpe = _vgaBufferPointers; - do { - if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) || - ((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) { - vpe->vgaFile1 = NULL; - vpe->vgaFile2 = NULL; - } - } while (++vpe, --count); -} - } // End of namespace AGOS -- cgit v1.2.3