svn-id: r17333
This commit is contained in:
Travis Howell 2005-04-02 14:24:43 +00:00
parent eb4dce05ee
commit b5f281e9d8
9 changed files with 33 additions and 28 deletions

View file

@ -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() { void ScummEngine::setActorRedrawFlags() {
int i, j; int i, j;
@ -1927,7 +1936,6 @@ void ScummEngine::postProcessAuxQueue() {
break; break;
default: default:
error("unimplemented compression type %d", comp); error("unimplemented compression type %d", comp);
break;
} }
} }
const uint8 *axur = findResourceData(MKID('AXUR'), auxd); const uint8 *axur = findResourceData(MKID('AXUR'), auxd);
@ -1938,7 +1946,7 @@ void ScummEngine::postProcessAuxQueue() {
int y1 = (int16)READ_LE_UINT16(axur + 2) + dy; int y1 = (int16)READ_LE_UINT16(axur + 2) + dy;
int x2 = (int16)READ_LE_UINT16(axur + 4) + dx; int x2 = (int16)READ_LE_UINT16(axur + 4) + dx;
int y2 = (int16)READ_LE_UINT16(axur + 6) + dy; 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; axur += 8;
} }
} }

View file

@ -777,21 +777,16 @@ void ScummEngine_v70he::redrawBGAreas() {
return; return;
} }
int val = 0;
if (camera._cur.x != camera._last.x && _charset->_hasMask) if (camera._cur.x != camera._last.x && _charset->_hasMask)
stopTalk(); stopTalk();
byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs; byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
if (findResource(MKID('BMAP'), room) != NULL) { if (_fullRedraw) {
if (_fullRedraw) { _bgNeedsRedraw = false;
_bgNeedsRedraw = false; gdi.drawBMAPBg(room, &virtscr[0]);
gdi.drawBMAPBg(room, &virtscr[0]);
}
} else if (findResource(MKID('SMAP'), room) == NULL) {
warning("redrawBGAreas(): Both SMAP and BMAP are missing...");
} }
drawRoomObjects(val); drawRoomObjects(0);
_bgNeedsRedraw = false; _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; byte *src, *dst;
VirtScreen *vs = &_vm->virtscr[0]; VirtScreen *vs = &_vm->virtscr[0];

View file

@ -290,7 +290,7 @@ public:
void drawBMAPBg(const byte *ptr, VirtScreen *vs); 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 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); byte *getMaskBuffer(int x, int y, int z);
void disableZBuffer() { _zbufferDisabled = true; } void disableZBuffer() { _zbufferDisabled = true; }

View file

@ -748,11 +748,11 @@ void ScummEngine_v70he::o70_kernelSetFunctions() {
break; break;
case 24: case 24:
_skipProcessActors = 1; _skipProcessActors = 1;
_fullRedraw = 1; redrawAllActors();
break; break;
case 25: case 25:
_skipProcessActors = 0; _skipProcessActors = 0;
_fullRedraw = 1; redrawAllActors();
break; break;
case 30: case 30:
a = derefActor(args[1], "o70_kernelSetFunctions: 30"); a = derefActor(args[1], "o70_kernelSetFunctions: 30");

View file

@ -2307,11 +2307,11 @@ void ScummEngine_v90he::o90_kernelSetFunctions() {
break; break;
case 24: case 24:
_skipProcessActors = 1; _skipProcessActors = 1;
//_fullRedraw = 1; redrawAllActors();
break; break;
case 25: case 25:
_skipProcessActors = 0; _skipProcessActors = 0;
//_fullRedraw = 1; redrawAllActors();
break; break;
case 42: case 42:
_wiz._rectOverrideEnabled = true; _wiz._rectOverrideEnabled = true;

View file

@ -2012,7 +2012,6 @@ load_game:
} }
processActors(); processActors();
postProcessAuxQueue();
} else { } else {
processActors(); processActors();
@ -2020,6 +2019,9 @@ load_game:
_fullRedraw = false; _fullRedraw = false;
if (_heversion >= 71) {
postProcessAuxQueue();
}
if (_heversion >= 90) { if (_heversion >= 90) {
((ScummEngine_v90he *)this)->spritesMarkDirty(1); ((ScummEngine_v90he *)this)->spritesMarkDirty(1);
((ScummEngine_v90he *)this)->spritesProcessWiz(false); ((ScummEngine_v90he *)this)->spritesProcessWiz(false);

View file

@ -815,6 +815,7 @@ public:
protected: protected:
void walkActors(); void walkActors();
void playActorSounds(); void playActorSounds();
void redrawAllActors();
void setActorRedrawFlags(); void setActorRedrawFlags();
void putActors(); void putActors();
void showActors(); void showActors();

View file

@ -26,6 +26,7 @@
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/sprite_he.h" #include "scumm/sprite_he.h"
#include "scumm/usage_bits.h"
#include "scumm/wiz_he.h" #include "scumm/wiz_he.h"
namespace Scumm { namespace Scumm {
@ -1061,7 +1062,7 @@ void ScummEngine_v90he::spritesBlitToScreen() {
spi->flags &= ~kSFChanged; spi->flags &= ~kSFChanged;
if (spi->bbox.left <= spi->bbox.right && spi->bbox.top <= spi->bbox.bottom) { if (spi->bbox.left <= spi->bbox.right && spi->bbox.top <= spi->bbox.bottom) {
if (spi->flags & kSFBlitDirectly) { if (spi->flags & kSFBlitDirectly) {
gdi.copyVirtScreenBuffers(spi->bbox); // XXX 0, 0x40000000); gdi.copyVirtScreenBuffers(spi->bbox, USAGE_BIT_RESTORED);
} else if (firstLoop) { } else if (firstLoop) {
xmin = spi->bbox.left; xmin = spi->bbox.left;
ymin = spi->bbox.top; ymin = spi->bbox.top;
@ -1090,7 +1091,7 @@ void ScummEngine_v90he::spritesBlitToScreen() {
} }
} }
if (refreshScreen) { 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++) { for (int i = 0; i < _numSpritesToProcess; i++) {
SpriteInfo *spi = _activeSpritesTable[i]; SpriteInfo *spi = _activeSpritesTable[i];
// HACK Sprite redraws aren't always been triggered if (!(spi->flags & kSFNeedRedraw))
// so leave disabled for now. continue;
//if (!(spi->flags & kSFNeedRedraw))
// continue;
spr_flags = spi->flags; spr_flags = spi->flags;

View file

@ -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) { 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); dstRect = Common::Rect(src_x, src_y, src_x + src_w, src_y + src_h);
Common::Rect r3; Common::Rect r3;
int diff; int diff;
if (rect) { if (rect) {
r3 = *rect; r3 = *rect;
Common::Rect r4(0, 0, dst_w, dst_h); Common::Rect r4(dst_w, dst_h);
if (r3.intersects(r4)) { if (r3.intersects(r4)) {
r3.clip(r4); r3.clip(r4);
} else { } else {
return false; return false;
} }
} else { } else {
r3 = Common::Rect(0, 0, dst_w, dst_h); r3 = Common::Rect(dst_w, dst_h);
} }
diff = dstRect.left - r3.left; diff = dstRect.left - r3.left;
if (diff < 0) { if (diff < 0) {
@ -782,7 +782,7 @@ void ScummEngine_v72he::captureWizImage(int resNum, const Common::Rect& r, bool
} else { } else {
src = pvs->getBackPixels(0, 0); 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)) { if (rCapt.intersects(r)) {
rCapt.clip(r); rCapt.clip(r);
const uint8 *palPtr = _currentPalette; const uint8 *palPtr = _currentPalette;