[Scummvm-git-logs] scummvm master -> 36e5374c8b305cd0db4706ba2659fc27e56c0926

bonki bonki at users.noreply.github.com
Sun Mar 25 22:23:35 CEST 2018


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:
36e5374c8b DM: Fix drawSquareD0L() to match original rebuilt sources


Commit: 36e5374c8b305cd0db4706ba2659fc27e56c0926
    https://github.com/scummvm/scummvm/commit/36e5374c8b305cd0db4706ba2659fc27e56c0926
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-03-25T22:22:43+02:00

Commit Message:
DM: Fix drawSquareD0L() to match original rebuilt sources

The current implementation is shite ((c) Strangerke), so here is one
which matches the rebuilt sources :-)
Given that drawSquareD0R() is identical to the rebuilt sources already
it's safe to assume that no refactoring has been done which could
explain why drawSquareD0L() looks different.

While we're at it, mark that (now correct) fallthrough as intentional
to silence the current gcc7 warning.

Changed paths:
    engines/dm/gfx.cpp


diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index ba28e25..f75e7eb 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -2162,22 +2162,20 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) {
 	uint16 squareAspect[5];
 	_vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY);
 	switch (squareAspect[kDMSquareAspectElement]) {
-	case kDMElementTypeWall:
-		drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[kDMViewSquareD0L]);
-		break;
+	case kDMElementTypeStairsSide:
+		drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0L);
+		return;
+	case kDMElementTypePit:
+		drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0L : kDMGraphicIdxFloorPitD0L, frameFloorPitD0L);
+		// fall through
 	case kDMElementTypeCorridor:
-	case kDMElementTypeTeleporter:
 	case kDMElementTypeDoorSide:
+	case kDMElementTypeTeleporter:
 		drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0L, kDMCellOrderBackRight);
 		break;
-	case kDMElementTypePit:
-		drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0L : kDMGraphicIdxFloorPitD0L, frameFloorPitD0L);
-	case kDMElementTypeStairsSide:
-		if (squareAspect[kDMSquareAspectStairsUp])
-			drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0L);
-		break;
-	default:
-		break;
+	case kDMElementTypeWall:
+		drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[kDMViewSquareD0L]);
+		return;
 	}
 
 	drawCeilingPit(kDMGraphicIdxCeilingPitD0L, &frameCeilingPitD0L, posX, posY, false);





More information about the Scummvm-git-logs mailing list