aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/sprites.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-14 21:56:01 -0400
committerPaul Gilbert2014-03-14 21:56:01 -0400
commit12b79e817833fe17da717b88999da96e9bb1ec76 (patch)
tree34c2b79163b0c0d81c10ec01166a0684673f4c89 /engines/mads/sprites.cpp
parent3f0cd4771c94a83c72f09f74ba351a3905357d1c (diff)
downloadscummvm-rg350-12b79e817833fe17da717b88999da96e9bb1ec76.tar.gz
scummvm-rg350-12b79e817833fe17da717b88999da96e9bb1ec76.tar.bz2
scummvm-rg350-12b79e817833fe17da717b88999da96e9bb1ec76.zip
MADS: Fix for sprite slot cleanup post-frame draw
Diffstat (limited to 'engines/mads/sprites.cpp')
-rw-r--r--engines/mads/sprites.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index 6f227fa341..ff953ac21c 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -240,6 +240,7 @@ void SpriteSlots::drawBackground() {
DirtyArea &dirtyArea = scene._dirtyAreas[i];
if (spriteSlot._spriteType >= ST_NONE) {
+ // Foreground sprite, so we can ignore it
dirtyArea._active = false;
} else {
dirtyArea._active = true;
@@ -249,6 +250,7 @@ void SpriteSlots::drawBackground() {
MSprite *frame = asset->getFrame(spriteSlot._frameNumber);
if (spriteSlot._spriteType == ST_BACKGROUND) {
+ // Background object, so need to draw it
Common::Point pt = spriteSlot._position;
if (spriteSlot._scale != -1) {
// Adjust the drawing position
@@ -258,8 +260,7 @@ void SpriteSlots::drawBackground() {
if (spriteSlot._depth <= 1) {
asset->draw(&scene._backgroundSurface, spriteSlot._frameNumber, pt);
- }
- else if (scene._depthStyle == 0) {
+ } else if (scene._depthStyle == 0) {
asset->depthDraw(&scene._backgroundSurface, &scene._depthSurface, spriteSlot._frameNumber,
pt, spriteSlot._depth);
} else {
@@ -355,7 +356,7 @@ void SpriteSlots::drawForeground(MSurface *s) {
void SpriteSlots::cleanUp() {
for (int i = (int)size() - 1; i >= 0; --i) {
- if ((*this)[i]._spriteType >= ST_NONE)
+ if ((*this)[i]._spriteType < ST_NONE)
remove_at(i);
}
}