[Scummvm-git-logs] scummvm master -> 06d6e118eb7d6bace91837f155429e55bd425e76

WinterGrascph bendeguz.nagy.rf at gmail.com
Mon Sep 12 15:51:51 CEST 2016


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:
06d6e118eb DM: Add partial fix to drawing explosions


Commit: 06d6e118eb7d6bace91837f155429e55bd425e76
    https://github.com/scummvm/scummvm/commit/06d6e118eb7d6bace91837f155429e55bd425e76
Author: Bendegúz Nagy (bendeguz.nagy.rf at gmail.com)
Date: 2016-09-12T15:49:25+02:00

Commit Message:
DM: Add partial fix to drawing explosions

Changed paths:
    engines/dm/TODOs/todo.txt
    engines/dm/gfx.cpp



diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt
index 4309c98..def2956 100644
--- a/engines/dm/TODOs/todo.txt
+++ b/engines/dm/TODOs/todo.txt
@@ -2,6 +2,7 @@ Bugs:
 	Display:
 		Spellcasting tabs are displayed inproperly, switching between them is possible tho
 		Cursor icons are drawn twice
+		DisplayMan::blitBoxFilledWithMaskedBitmap does not produce the same effect as the original
 
 	Logic:
 		Items thrown on the right side end up on the left side 
@@ -15,7 +16,7 @@ Todo:
 	I forgot to add a bunch of warning for show/hide mouse pointer and other mouse functions
 
 Code stuff todo:
-	Complete stub methods(blitShrink, blitmask)
+	Complete stub methods(blitShrink)
 	Add proper save header, add error handling to it
 	Add translations to f433_processCommand140_saveGame 'LOAD'
 	
\ No newline at end of file
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 8aa3aa5..2ad9a60 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -866,10 +866,30 @@ void DisplayMan::fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 by
 }
 
 void DisplayMan::blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box& box,
-													int16 lastUnitIndex, int16 firstUnitIndex, int16 destByteWidth, Color transparent,
-													int16 xPos, int16 yPos, int16 destHeight, int16 height2) {
-	// make sure to take care of inclusive boundaries, color can have 0x8000 flag to not use mask
-	warning("STUB: blitBoxFilledWithMaskedBitmap");
+											   int16 lastUnitIndex, int16 firstUnitIndex, int16 destByteWidth, Color transparent,
+											   int16 xPos, int16 yPos, int16 destHeight, int16 height2) {
+	
+	// FIXME: does not produce the same effect as the original
+
+	byte nextUnitIndex = firstUnitIndex;
+	bool useMask = !(transparent & k0x0080_BlitDoNotUseMask);
+	transparent = (Color)(transparent & ~(k0x0080_BlitDoNotUseMask)); // clear flag 0x0080
+	for (byte next_y = box._y1; next_y <= box._y2; next_y++) { // '<=' for inclusive boundaries
+		for (byte next_x = box._x1; next_x <= box._x2; next_x++) { // '<=' for inclusive boundaries
+			byte *nextDestPixel = dest + next_y * destByteWidth * 2 + next_x;
+			byte nextSrcPixel = src[nextUnitIndex];
+
+			if (nextSrcPixel != transparent) {
+				if (useMask && mask && *mask++) {
+					*nextDestPixel = *mask & nextSrcPixel;
+				} else
+					*nextDestPixel = nextSrcPixel;
+			}
+
+			if (++nextUnitIndex >= lastUnitIndex)
+				nextUnitIndex = 0; // 0 is not an error
+		}
+	}
 }
 
 void DisplayMan::flipBitmapHorizontal(byte *bitmap, uint16 byteWidth, uint16 height) {





More information about the Scummvm-git-logs mailing list