[Scummvm-cvs-logs] SF.net SVN: scummvm: [32278] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon May 26 09:20:25 CEST 2008


Revision: 32278
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32278&view=rev
Author:   john_doe
Date:     2008-05-26 00:20:23 -0700 (Mon, 26 May 2008)

Log Message:
-----------
Implemented visual effects 2 and 15

Modified Paths:
--------------
    scummvm/trunk/engines/made/screenfx.cpp
    scummvm/trunk/engines/made/screenfx.h

Modified: scummvm/trunk/engines/made/screenfx.cpp
===================================================================
--- scummvm/trunk/engines/made/screenfx.cpp	2008-05-26 07:18:06 UTC (rev 32277)
+++ scummvm/trunk/engines/made/screenfx.cpp	2008-05-26 07:20:23 UTC (rev 32278)
@@ -64,6 +64,10 @@
 		vfx00(surface, palette, newPalette, colorCount);
 		break;
 
+	case 2:
+		vfx02(surface, palette, newPalette, colorCount);
+		break;
+
 	case 9:		// "Checkerboard" effect
 		vfx09(surface, palette, newPalette, colorCount);
 		break;
@@ -80,6 +84,10 @@
 		vfx14(surface, palette, newPalette, colorCount);
 		break;
 
+	case 15:
+		vfx15(surface, palette, newPalette, colorCount);
+		break;
+
 	case 17:	// Palette fadeout/fadein
 		vfx17(surface, palette, newPalette, colorCount);
 		break;
@@ -121,7 +129,7 @@
 	}
 }
 
-void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) {
+void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) {
 
 	// TODO: Clean up
 
@@ -197,18 +205,41 @@
 
 }
 
+void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) {
+	Graphics::Surface *vgaScreen = _screen->lockScreen();
+	byte *source = (byte*)surface->getBasePtr(x1, y1);
+	byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1);
+	for (int y = 0; y < y2 - y1; y++) {
+		memcpy(dest, source, x2 - x1);
+		dest += 320;
+		source += 320;
+	}
+	_screen->unlockScreen();
+}
+
 // No effect
 void ScreenEffects::vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 	setPalette(palette);
 	_screen->showWorkScreen();
+	// FIXME: For Manhole; causes sluggish mouse
+	_screen->updateScreenAndWait(100);
 }
 
+void ScreenEffects::vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+	for (int x = 312; x >= 0; x -= 8) {
+		copyRect(surface, x, 0, x + 8, 200);
+		setBlendedPalette(palette, newPalette, colorCount, 312 - x, 312);
+		_screen->updateScreenAndWait(25);
+	}
+ 	setPalette(palette);
+}
+
 // "Checkerboard" effect
 void ScreenEffects::vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 	for (int i = 0; i < 8; i++) {
-		copyRect(surface, 0, 0, 320, 200);
+		copyFxRect(surface, 0, 0, 320, 200);
 		for (int j = 0; j < 4; j++) {
-			setBlendedPalette(palette, newPalette, colorCount, i * 4 + j, 32);
+			setBlendedPalette(palette, newPalette, colorCount, i * 4 + j, 36/*FIX?*/);
 			_screen->updateScreenAndWait(25);
 		}
 	}
@@ -218,7 +249,7 @@
 // "Screen wipe in", left to right
 void ScreenEffects::vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 	for (int x = -56; x < 312; x += 8) {
-		copyRect(surface, x, 0, x + 64, 200);
+		copyFxRect(surface, x, 0, x + 64, 200);
 		setBlendedPalette(palette, newPalette, colorCount, x + 56, 368);
 		_screen->updateScreenAndWait(25);
 	}
@@ -228,7 +259,7 @@
 // "Screen wipe in", top to bottom
 void ScreenEffects::vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 	for (int y = -70; y < 312; y += 10) {
-		copyRect(surface, 0, y, 320, y + 80);
+		copyFxRect(surface, 0, y, 320, y + 80);
 		setBlendedPalette(palette, newPalette, colorCount, y + 70, 260);
 		_screen->updateScreenAndWait(25);
 	}
@@ -239,7 +270,7 @@
 void ScreenEffects::vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 	int16 x = 8, y = 5;
 	for (int i = 0; i < 27; i++) {
-		copyRect(surface, 160 - x, 100 - y, 160 + x, 100 + y);
+		copyFxRect(surface, 160 - x, 100 - y, 160 + x, 100 + y);
 		x += 8;
 		y += 5;
 		setBlendedPalette(palette, newPalette, colorCount, i, 27);
@@ -248,6 +279,17 @@
  	setPalette(palette);
 }
 
+void ScreenEffects::vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+	int16 x = 8;
+	for (int i = 0; i < 27; i++) {
+		copyFxRect(surface, 160 - x, 0, 160 + x, 200);
+		x += 8;
+		setBlendedPalette(palette, newPalette, colorCount, i, 27);
+		_screen->updateScreenAndWait(25);
+	}
+ 	setPalette(palette);
+}
+
 // Palette fadeout/fadein
 void ScreenEffects::vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
 

Modified: scummvm/trunk/engines/made/screenfx.h
===================================================================
--- scummvm/trunk/engines/made/screenfx.h	2008-05-26 07:18:06 UTC (rev 32277)
+++ scummvm/trunk/engines/made/screenfx.h	2008-05-26 07:20:23 UTC (rev 32278)
@@ -51,12 +51,15 @@
 	int16 vfxX1, vfxY1, vfxWidth, vfxHeight;
 	void setPalette(byte *palette);
 	void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue);
+	void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2);
 	void copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2);
 	void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+	void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 	void vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 	void vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 	void vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 	void vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+	void vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 	void vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
 };
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list