[Scummvm-cvs-logs] scummvm master -> 0a07cf1481cf00d872f65040963ee70e084aac5a

sev- sev at scummvm.org
Thu Jun 19 09:26:42 CEST 2014


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:
0a07cf1481 FULLPIPE: Draw transparent surfaces


Commit: 0a07cf1481cf00d872f65040963ee70e084aac5a
    https://github.com/scummvm/scummvm/commit/0a07cf1481cf00d872f65040963ee70e084aac5a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-19T10:25:24+03:00

Commit Message:
FULLPIPE: Draw transparent surfaces

Changed paths:
    engines/fullpipe/gfx.cpp
    engines/fullpipe/gfx.h
    engines/fullpipe/statics.cpp



diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 2615648..5e68adc 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -636,12 +636,12 @@ void Picture::draw(int x, int y, int style, int angle) {
 	case 1:
 		//flip
 		getDimensions(&point);
-		_bitmap->flipVertical()->drawShaded(1, x1, y1 + 30 + point.y, pal);
+		_bitmap->flipVertical()->drawShaded(1, x1, y1 + 30 + point.y, pal, _alpha);
 		break;
 	case 2:
 		//vrtSetFadeRatio(g_vrtDrawHandle, 0.34999999);
 		//vrtSetFadeTable(g_vrtDrawHandle, &unk_477F88, 1.0, 1000.0, 0, 0);
-		_bitmap->drawShaded(2, x1, y1, pal);
+		_bitmap->drawShaded(2, x1, y1, pal, _alpha);
 		//vrtSetFadeRatio(g_vrtDrawHandle, 0.0);
 		//vrtSetFadeTable(g_vrtDrawHandle, &unk_477F90, 1.0, 1000.0, 0, 0);
 		break;
@@ -649,7 +649,7 @@ void Picture::draw(int x, int y, int style, int angle) {
 		if (angle)
 			drawRotated(x1, y1, angle);
 		else {
-			_bitmap->putDib(x1, y1, (int32 *)pal);
+			_bitmap->putDib(x1, y1, (int32 *)pal, _alpha);
 		}
 	}
 }
@@ -820,7 +820,7 @@ void Bitmap::decode(int32 *palette) {
 		putDibCB(palette);
 }
 
-void Bitmap::putDib(int x, int y, int32 *palette) {
+void Bitmap::putDib(int x, int y, int32 *palette, int alpha) {
 	debug(7, "Bitmap::putDib(%d, %d)", x, y);
 
 	int x1 = x - g_fp->_sceneRect.left;
@@ -850,7 +850,9 @@ void Bitmap::putDib(int x, int y, int32 *palette) {
 	if (sub.width() <= 0 || sub.height() <= 0)
 		return;
 
-	_surface->blit(g_fp->_backgroundSurface, x1, y1, _flipping, &sub);
+	int alphac = TS_ARGB(0xff, alpha, 0xff, 0xff);
+
+	_surface->blit(g_fp->_backgroundSurface, x1, y1, _flipping, &sub, alphac);
 	g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(x1, y1), g_fp->_backgroundSurface.pitch, x1, y1, sub.width(), sub.height());
 }
 
@@ -1136,16 +1138,16 @@ Bitmap *Bitmap::flipVertical() {
 	return this;
 }
 
-void Bitmap::drawShaded(int type, int x, int y, byte *palette) {
+void Bitmap::drawShaded(int type, int x, int y, byte *palette, int alpha) {
 	warning("STUB: Bitmap::drawShaded(%d, %d, %d)", type, x, y);
 
-	putDib(x, y, (int32 *)palette);
+	putDib(x, y, (int32 *)palette, alpha);
 }
 
-	void Bitmap::drawRotated(int x, int y, int angle, byte *palette) {
+void Bitmap::drawRotated(int x, int y, int angle, byte *palette, int alpha) {
 	warning("STUB: Bitmap::drawShaded(%d, %d, %d)", x, y, angle);
 
-	putDib(x, y, (int32 *)palette);
+	putDib(x, y, (int32 *)palette, alpha);
 }
 
 bool BigPicture::load(MfcArchive &file) {
@@ -1175,7 +1177,7 @@ void BigPicture::draw(int x, int y, int style, int angle) {
 			//vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, v9);
 		}
 
-		_bitmap->putDib(nx, ny, 0);
+		_bitmap->putDib(nx, ny, 0, 0xff);
 
 		if (_alpha < 0xFF) {
 			//vrtSetAlphaBlendMode(g_vrtDrawHandle, 0, 255);
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index d4d70fc..d94dd40 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -47,7 +47,7 @@ struct Bitmap {
 
 	void load(Common::ReadStream *s);
 	void decode(int32 *palette);
-	void putDib(int x, int y, int32 *palette);
+	void putDib(int x, int y, int32 *palette, int alpha);
 	bool putDibRB(int32 *palette);
 	void putDibCB(int32 *palette);
 
@@ -59,8 +59,8 @@ struct Bitmap {
 	Bitmap *reverseImage(bool flip = true);
 	Bitmap *flipVertical();
 
-	void drawShaded(int type, int x, int y, byte *palette);
-	void drawRotated(int x, int y, int angle, byte *palette);
+	void drawShaded(int type, int x, int y, byte *palette, int alpha);
+	void drawRotated(int x, int y, int angle, byte *palette, int alpha);
 
 	bool isPixelHitAtPos(int x, int y);
 };
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 322ef54..717de84 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -532,11 +532,11 @@ void Movement::draw(bool flipFlag, int angle) {
 	}
 
 	if (flipFlag) {
-		bmp->flipVertical()->drawShaded(1, x, y + 30 + _currDynamicPhase->_rect->bottom, _currDynamicPhase->_paletteData);
+		bmp->flipVertical()->drawShaded(1, x, y + 30 + _currDynamicPhase->_rect->bottom, _currDynamicPhase->_paletteData, _currDynamicPhase->_alpha);
 	} if (angle) {
-		bmp->drawRotated(x, y, angle, _currDynamicPhase->_paletteData);
+		bmp->drawRotated(x, y, angle, _currDynamicPhase->_paletteData, _currDynamicPhase->_alpha);
 	} else {
-		bmp->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData);
+		bmp->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData, _currDynamicPhase->_alpha);
 	}
 
 	if (_currDynamicPhase->_rect->top) {
@@ -549,11 +549,11 @@ void Movement::draw(bool flipFlag, int angle) {
 		if (_currDynamicPhase->_convertedBitmap) {
 			if (_currMovement) {
 				//vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, LOBYTE(_currDynamicPhase->rect.top));
-				_currDynamicPhase->_convertedBitmap->reverseImage()->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData);
+				_currDynamicPhase->_convertedBitmap->reverseImage()->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData, _currDynamicPhase->_alpha);
 				//vrtSetAlphaBlendMode(g_vrtDrawHandle, 0, 255);
 			} else {
 				//vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, LOBYTE(_currDynamicPhase->rect.top));
-				_currDynamicPhase->_convertedBitmap->reverseImage(false)->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData);
+				_currDynamicPhase->_convertedBitmap->reverseImage(false)->putDib(x, y, (int32 *)_currDynamicPhase->_paletteData, _currDynamicPhase->_alpha);
 				//vrtSetAlphaBlendMode(g_vrtDrawHandle, 0, 255);
 			}
 		}






More information about the Scummvm-git-logs mailing list