aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorGregory Montoir2005-05-09 18:26:36 +0000
committerGregory Montoir2005-05-09 18:26:36 +0000
commitc0ec310a43ba2e321c2e267485bc9a78077bc4a4 (patch)
treef6375c6b39d0c578d2aba8d45459eeff594eded5 /scumm
parentda06fe93a97193cfa3c077d144422c5bc47b46ff (diff)
downloadscummvm-rg350-c0ec310a43ba2e321c2e267485bc9a78077bc4a4.tar.gz
scummvm-rg350-c0ec310a43ba2e321c2e267485bc9a78077bc4a4.tar.bz2
scummvm-rg350-c0ec310a43ba2e321c2e267485bc9a78077bc4a4.zip
fixed spritesMarkDirty
svn-id: r18008
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp4
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/sprite_he.cpp21
3 files changed, 17 insertions, 10 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 09163b4481..fbf4c309d6 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1022,7 +1022,7 @@ void ScummEngine_v71he::processActors() {
void ScummEngine_v90he::processActors() {
preProcessAuxQueue();
- spritesMarkDirty(0);
+ spritesMarkDirty(false);
spritesProcessWiz(true);
if (!_skipProcessActors)
@@ -1030,7 +1030,7 @@ void ScummEngine_v90he::processActors() {
postProcessAuxQueue();
- spritesMarkDirty(1);
+ spritesMarkDirty(true);
spritesProcessWiz(false);
}
diff --git a/scumm/intern.h b/scumm/intern.h
index 879e5f9f01..56be6123c4 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -1190,7 +1190,7 @@ protected:
public:
void saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion);
void spritesBlitToScreen();
- void spritesMarkDirty(bool unkFlag);
+ void spritesMarkDirty(bool checkZOrder);
void spritesSortActiveSprites();
void spritesProcessWiz(bool arg);
void spritesUpdateImages();
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp
index d2d2e12713..0d3c1b7074 100644
--- a/scumm/sprite_he.cpp
+++ b/scumm/sprite_he.cpp
@@ -1125,17 +1125,24 @@ void ScummEngine_v90he::spritesBlitToScreen() {
}
}
-void ScummEngine_v90he::spritesMarkDirty(bool unkFlag) {
+void ScummEngine_v90he::spritesMarkDirty(bool checkZOrder) {
VirtScreen *vs = &virtscr[kMainVirtScreen];
for (int i = 0; i < _numSpritesToProcess; ++i) {
SpriteInfo *spi = _activeSpritesTable[i];
if (!(spi->flags & (kSFNeedRedraw | kSF30))) {
- if ((!unkFlag || spi->zorderPriority >= 0) && (spi->flags & kSFMarkDirty)) {
- int lp, rp;
- lp = MAX(0, spi->bbox.left / 8);
- lp = MIN(79, spi->bbox.left / 8);
- rp = MAX(0, (spi->bbox.right + 7) / 8);
- rp = MIN(79, (spi->bbox.right + 7) / 8);
+ if ((!checkZOrder || spi->zorderPriority >= 0) && (spi->flags & kSFMarkDirty)) {
+ int lp = spi->bbox.left / 8;
+ if (lp < 0) {
+ lp = 0;
+ } else if (lp > 79) {
+ lp = 79;
+ }
+ int rp = spi->bbox.right + 7 / 8;
+ if (rp < 0) {
+ rp = 0;
+ } else {
+ rp = 79;
+ }
for (; lp <= rp; ++lp) {
if (vs->tdirty[lp] < vs->h && spi->bbox.bottom >= vs->tdirty[lp] && spi->bbox.top <= vs->bdirty[lp]) {
spi->flags |= kSFNeedRedraw;