aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/sprite.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/saga/sprite.cpp b/saga/sprite.cpp
index 01fd989b80..5e55782327 100644
--- a/saga/sprite.cpp
+++ b/saga/sprite.cpp
@@ -332,7 +332,14 @@ void Sprite::drawOccluded(Surface *ds, const Rect &clipRect, SpriteList &spriteL
// Finally, draw the occluded sprite
sourceRowPointer = spriteBuffer + clipData.drawSource.x + (clipData.drawSource.y * width);
- destRowPointer = (byte *)ds->pixels + clipData.drawDest.x + (clipData.drawDest.y * ds->pitch);
+ int traverseSign;
+ if (_vm->getGameType() == GType_IHNM) {
+ traverseSign = -1;
+ destRowPointer = (byte *)ds->pixels + clipData.drawDest.x + ((clipData.drawDest.y + clipData.drawHeight) * ds->pitch);
+ } else {
+ traverseSign = 1;
+ destRowPointer = (byte *)ds->pixels + clipData.drawDest.x + (clipData.drawDest.y * ds->pitch);
+ }
maskRowPointer = maskBuffer + clipData.drawDest.x + (clipData.drawDest.y * maskWidth);
for (y = 0; y < clipData.drawHeight; y++) {
@@ -350,7 +357,7 @@ void Sprite::drawOccluded(Surface *ds, const Rect &clipRect, SpriteList &spriteL
destPointer++;
maskPointer++;
}
- destRowPointer += ds->pitch;
+ destRowPointer += ds->pitch * traverseSign;
maskRowPointer += maskWidth;
sourceRowPointer += width;
}