[Scummvm-git-logs] scummvm master -> c84720885a5c48ee9c6a2c7b276c51feac5f1392

yinsimei roseline.yin at gmail.com
Sat Aug 12 07:25:51 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c84720885a SLUDGE: Fix sprite depth error


Commit: c84720885a5c48ee9c6a2c7b276c51feac5f1392
    https://github.com/scummvm/scummvm/commit/c84720885a5c48ee9c6a2c7b276c51feac5f1392
Author: Simei Yin (roseline.yin at gmail.com)
Date: 2017-08-12T07:25:29+02:00

Commit Message:
SLUDGE: Fix sprite depth error

Changed paths:
    engines/sludge/sprites.cpp


diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index e51a204..644d87d 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -333,6 +333,7 @@ bool GraphicsManager::scaleSprite(Sprite &single, const SpritePalette &fontPal,
 	float y = thisPerson->y;
 
 	float scale = thisPerson->scale;
+	bool useZB = !(thisPerson->extra & EXTRA_NOZB);
 	bool light = !(thisPerson->extra & EXTRA_NOLITE);
 
 	if (scale <= 0.05)
@@ -365,7 +366,7 @@ bool GraphicsManager::scaleSprite(Sprite &single, const SpritePalette &fontPal,
 		y2 = y1 + diffY;
 	}
 
-	Graphics::Surface *ptr = nullptr;;
+	Graphics::Surface *ptr = nullptr;
 	Graphics::Surface *blitted = &single.surface;
 
 	// set light map color
@@ -409,7 +410,7 @@ bool GraphicsManager::scaleSprite(Sprite &single, const SpritePalette &fontPal,
 			ptr = nullptr;
 		}
 	} else {
-		int d = ((!(thisPerson->extra & EXTRA_NOZB)) && _zBuffer->numPanels) ? y + _cameraY : 0;
+		int d = useZB ? y + _cameraY : (y + _cameraY > _sceneHeight * 0.6 ? _sceneHeight + 1 : 0);
 		addSpriteDepth(blitted, d, x1, y1, (mirror ? Graphics::FLIP_H : Graphics::FLIP_NONE), diffX, diffY, spriteColor, ptr);
 	}
 
@@ -505,7 +506,7 @@ void GraphicsManager::fixScaleSprite(int x, int y, Sprite &single, const SpriteP
 		x1 = x - (int)((mirror ? (float)(single.surface.w - (single.xhot + 1)) : (float)single.xhot) * scale);
 	int y1 = y - (int)((single.yhot - thisPerson->floaty) * scale);
 
-	Graphics::Surface *ptr = nullptr;;
+	Graphics::Surface *ptr = nullptr;
 	Graphics::Surface *blitted = &single.surface;
 
 	// set light map color
@@ -557,7 +558,7 @@ void GraphicsManager::fixScaleSprite(int x, int y, Sprite &single, const SpriteP
 			ptr = nullptr;
 		}
 	} else {
-		int d = useZB ? y + _cameraY : _sceneHeight + 1;
+		int d = useZB ? y + _cameraY : (y + _cameraY > _sceneHeight * 0.6 ? _sceneHeight + 1 : 0);
 		addSpriteDepth(&single.surface, d, x1, y1, (mirror ? Graphics::FLIP_H : Graphics::FLIP_NONE), diffX, diffY, spriteColor, ptr);
 	}
 





More information about the Scummvm-git-logs mailing list