From b5f281e9d8b0f2d75c03b40c2f04e1df1c0cc94c Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sat, 2 Apr 2005 14:24:43 +0000 Subject: Cleanup svn-id: r17333 --- scumm/actor.cpp | 12 ++++++++++-- scumm/gfx.cpp | 15 +++++---------- scumm/gfx.h | 2 +- scumm/script_v7he.cpp | 4 ++-- scumm/script_v90he.cpp | 4 ++-- scumm/scumm.cpp | 4 +++- scumm/scumm.h | 1 + scumm/sprite_he.cpp | 11 +++++------ scumm/wiz_he.cpp | 8 ++++---- 9 files changed, 33 insertions(+), 28 deletions(-) (limited to 'scumm') diff --git a/scumm/actor.cpp b/scumm/actor.cpp index fcb1294fac..1ef8f04ff0 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1171,6 +1171,15 @@ void Actor::animateLimb(int limb, int f) { } } +void ScummEngine::redrawAllActors() { + int j; + + for (j = 1; j < _numActors; j++) { + _actors[j]._needRedraw = true; + _actors[j]._needBgReset = true; + } +} + void ScummEngine::setActorRedrawFlags() { int i, j; @@ -1927,7 +1936,6 @@ void ScummEngine::postProcessAuxQueue() { break; default: error("unimplemented compression type %d", comp); - break; } } const uint8 *axur = findResourceData(MKID('AXUR'), auxd); @@ -1938,7 +1946,7 @@ void ScummEngine::postProcessAuxQueue() { int y1 = (int16)READ_LE_UINT16(axur + 2) + dy; int x2 = (int16)READ_LE_UINT16(axur + 4) + dx; int y2 = (int16)READ_LE_UINT16(axur + 6) + dy; - markRectAsDirty(kMainVirtScreen, x1, x2, y1, y2 + 1); + markRectAsDirty(kMainVirtScreen, x1, x2, y1, y2 + 1, a->_number); axur += 8; } } diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 68cae6b929..b5bdcb312a 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -777,21 +777,16 @@ void ScummEngine_v70he::redrawBGAreas() { return; } - int val = 0; if (camera._cur.x != camera._last.x && _charset->_hasMask) stopTalk(); byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs; - if (findResource(MKID('BMAP'), room) != NULL) { - if (_fullRedraw) { - _bgNeedsRedraw = false; - gdi.drawBMAPBg(room, &virtscr[0]); - } - } else if (findResource(MKID('SMAP'), room) == NULL) { - warning("redrawBGAreas(): Both SMAP and BMAP are missing..."); + if (_fullRedraw) { + _bgNeedsRedraw = false; + gdi.drawBMAPBg(room, &virtscr[0]); } - drawRoomObjects(val); + drawRoomObjects(0); _bgNeedsRedraw = false; } @@ -1629,7 +1624,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, } } -void Gdi::copyVirtScreenBuffers(Common::Rect rect) { +void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) { byte *src, *dst; VirtScreen *vs = &_vm->virtscr[0]; diff --git a/scumm/gfx.h b/scumm/gfx.h index 172be4de20..fc90953697 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -290,7 +290,7 @@ public: void drawBMAPBg(const byte *ptr, VirtScreen *vs); void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h); - void copyVirtScreenBuffers(Common::Rect rect); + void copyVirtScreenBuffers(Common::Rect rect, int dirtybit = 0); byte *getMaskBuffer(int x, int y, int z); void disableZBuffer() { _zbufferDisabled = true; } diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 3afaacb5e4..12ef2b9452 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -748,11 +748,11 @@ void ScummEngine_v70he::o70_kernelSetFunctions() { break; case 24: _skipProcessActors = 1; - _fullRedraw = 1; + redrawAllActors(); break; case 25: _skipProcessActors = 0; - _fullRedraw = 1; + redrawAllActors(); break; case 30: a = derefActor(args[1], "o70_kernelSetFunctions: 30"); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 065a4f7fa1..6a7cb369c3 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -2307,11 +2307,11 @@ void ScummEngine_v90he::o90_kernelSetFunctions() { break; case 24: _skipProcessActors = 1; - //_fullRedraw = 1; + redrawAllActors(); break; case 25: _skipProcessActors = 0; - //_fullRedraw = 1; + redrawAllActors(); break; case 42: _wiz._rectOverrideEnabled = true; diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 6af839cee9..7f3d81c2d6 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -2012,7 +2012,6 @@ load_game: } processActors(); - postProcessAuxQueue(); } else { processActors(); @@ -2020,6 +2019,9 @@ load_game: _fullRedraw = false; + if (_heversion >= 71) { + postProcessAuxQueue(); + } if (_heversion >= 90) { ((ScummEngine_v90he *)this)->spritesMarkDirty(1); ((ScummEngine_v90he *)this)->spritesProcessWiz(false); diff --git a/scumm/scumm.h b/scumm/scumm.h index e02c250e88..6806f2039d 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -815,6 +815,7 @@ public: protected: void walkActors(); void playActorSounds(); + void redrawAllActors(); void setActorRedrawFlags(); void putActors(); void showActors(); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 451e967920..47dc9bb1de 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -26,6 +26,7 @@ #include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/sprite_he.h" +#include "scumm/usage_bits.h" #include "scumm/wiz_he.h" namespace Scumm { @@ -1061,7 +1062,7 @@ void ScummEngine_v90he::spritesBlitToScreen() { spi->flags &= ~kSFChanged; if (spi->bbox.left <= spi->bbox.right && spi->bbox.top <= spi->bbox.bottom) { if (spi->flags & kSFBlitDirectly) { - gdi.copyVirtScreenBuffers(spi->bbox); // XXX 0, 0x40000000); + gdi.copyVirtScreenBuffers(spi->bbox, USAGE_BIT_RESTORED); } else if (firstLoop) { xmin = spi->bbox.left; ymin = spi->bbox.top; @@ -1090,7 +1091,7 @@ void ScummEngine_v90he::spritesBlitToScreen() { } } if (refreshScreen) { - gdi.copyVirtScreenBuffers(Common::Rect(xmin, ymin, xmax, ymax)); // , 0, 0x40000000); + gdi.copyVirtScreenBuffers(Common::Rect(xmin, ymin, xmax, ymax), USAGE_BIT_RESTORED); } } @@ -1210,10 +1211,8 @@ void ScummEngine_v90he::spritesProcessWiz(bool arg) { for (int i = 0; i < _numSpritesToProcess; i++) { SpriteInfo *spi = _activeSpritesTable[i]; - // HACK Sprite redraws aren't always been triggered - // so leave disabled for now. - //if (!(spi->flags & kSFNeedRedraw)) - // continue; + if (!(spi->flags & kSFNeedRedraw)) + continue; spr_flags = spi->flags; diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 019f30b083..bb9a803f0e 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -231,21 +231,21 @@ void Wiz::copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int } static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w, int src_h, const Common::Rect *rect, Common::Rect &srcRect, Common::Rect &dstRect) { - srcRect = Common::Rect(0, 0, src_w, src_h); + srcRect = Common::Rect(src_w, src_h); dstRect = Common::Rect(src_x, src_y, src_x + src_w, src_y + src_h); Common::Rect r3; int diff; if (rect) { r3 = *rect; - Common::Rect r4(0, 0, dst_w, dst_h); + Common::Rect r4(dst_w, dst_h); if (r3.intersects(r4)) { r3.clip(r4); } else { return false; } } else { - r3 = Common::Rect(0, 0, dst_w, dst_h); + r3 = Common::Rect(dst_w, dst_h); } diff = dstRect.left - r3.left; if (diff < 0) { @@ -782,7 +782,7 @@ void ScummEngine_v72he::captureWizImage(int resNum, const Common::Rect& r, bool } else { src = pvs->getBackPixels(0, 0); } - Common::Rect rCapt(0, 0, pvs->w, pvs->h); + Common::Rect rCapt(pvs->w, pvs->h); if (rCapt.intersects(r)) { rCapt.clip(r); const uint8 *palPtr = _currentPalette; -- cgit v1.2.3