[Scummvm-cvs-logs] SF.net SVN: scummvm: [30811] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Feb 6 16:38:33 CET 2008


Revision: 30811
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30811&view=rev
Author:   peres001
Date:     2008-02-06 07:38:33 -0800 (Wed, 06 Feb 2008)

Log Message:
-----------
Enabled moving projector in Nippon Safes. This should fix long standing bug #1729309.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-02-06 14:56:10 UTC (rev 30810)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-02-06 15:38:33 UTC (rev 30811)
@@ -617,51 +617,30 @@
 
 }
 
-void Parallaction_ns::_c_projector(void*) {
-	static int dword_16032 = 0;
+int16 projectorProgram[] = {
+	0, 50, 1, 50, 2, 49, 3, 49, 4, 48, 5, 48, 6, 47, 7, 47, 8, 46, 9, 46, 10, 45, 11, 45,
+   12, 44, 13, 44, 14, 43, 15, 43, 16, 42, 17, 42, 18, 41, 19, 41, 20, 40, 21, 40, 22, 39,
+   23, 39, 24, 38, 25, 38, 26, 37, 27, 37, 28, 36, 29, 36, 30, 35, 31, 35, 32, 34, 33, 34,
+   34, 33, 35, 33, 36, 32, 37, 32, 38, 31, 39, 31, 40, 30, 41, 30, 42, 29, 43, 29, 44, 28,
+   45, 28, 46, 27, 47, 27, 48, 26, 49, 26, 50, 25, 51, 25, 52, 24, 53, 24, 54, 23, 55, 23,
+   56, 22, 57, 22, 58, 21, 59, 21, 60, 20, 61, 20, 62, 19, 63, 19, 64, 18, 65, 18, 66, 17,
+   67, 17, 68, 16, 69, 16, 70, 15, 71, 15, 72, 14, 73, 14, 74, 13, 75, 13, 76, 12, 77, 12,
+   78, 11, 79, 11, 80, 10, 81, 10, 82, 9, 83, 9, 84, 8, 85, 8, 86, 7, 87, 7, 88, 6, 89, 6,
+   90, 5, 91, 5, 92, 4, 93, 4, 94, 3, 95, 3, 96, 2, 97, 2, 98, 1, 99, 1, 100, 0, 101, 0,
+   102, 1, 103, 1, 104, 2, 105, 2, 106, 3, 107, 3, 108, 4, 109, 4, 110, 5, 111, 5, 112, 6,
+   113, 6, 114, 7, 115, 7, 116, 8, 117, 8, 118, 9, 119, 9, 120, 10, 121, 10, 122, 11, 123,
+   11, 124, 12, 125, 12, 126, 13, 127, 13, 128, 14, 129, 14, 130, 15, 131, 15, 132, 16, 133,
+   16, 134, 17, 135, 17, 136, 18, 137, 18, 138, 19, 139, 19, 140, 20, 141, 20, 142, 21, 143,
+   21, 144, 22, 145, 22, 146, 23, 147, 23, 148, 24, 149, 24, 150, 25, 149, 25, 148, 25, 147,
+   25, 146, 25, 145, 25, 144, 25, 143, 25, 142, 25, 141, 25, 140, 25, 139, 25, 138, 25, 137,
+   25, 136, 25, 135, 25, 134, 25, 133, 25, 132, 25, 131, 25, 130, 25, 129, 25, 128, 25, 127,
+   25, 126, 25, 125, 25, 124, 25, 123, 25, 122, 25, 121, 25, 120, 25, 119, 25, 118, 25, 117,
+   25, 116, 25, 115, 25, 114, 25, 113, 25, 112, 25, 111, 25, 110, 25, -1, -1
+};
 
+void Parallaction_ns::_c_projector(void*) {
 	_gfx->setHalfbriteMode(true);
-
-//	if (dword_16032 != 0) {
-		// keep drawing spotlight in its final place
-		_gfx->setProjectorPos(110, 25);
-		return;
-//	}
-#ifdef HALFBRITE
-	// move spot light around the stage
-	int d7, d6;
-	for (d7 = 0; d7 < 150; d7++) {
-
-		if (d7 < 100) {
-			int d1 = d7;
-			if (d1 < 0)
-				d1++;
-
-			d1 >>= 1;
-			d6 = 50 - d1;
-		} else {
-			int d1 = d7 % 100;
-			if (d1 < 0)
-				d1++;
-
-			d1 >>= 1;
-			d6 = d1;
-		}
-
-		printf("%i, %i, ", d7+20, d6);
-//		BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+20, d6, a3->??, a3->??, 0x20, 0x20);
-	}
-
-	for (d7 = 50; d7 > -10; d7--) {
-		printf("%i, %i, ", d7+120, d6);
-//		BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+120, d6, a3->??, a3->??, 0x20, 0x20);
-	}
-
-	printf("%i, %i\n", d7+120, d6);
-//	BltBitMap(&bm, 0, 0, &_screen._bitMap, d7+120, d6, a3->??, a3->??, 0x20, 0x20);
-#endif
-	dword_16032 = 1;
-	return;
+	_gfx->setProjectorProgram(projectorProgram);
 }
 
 void Parallaction_ns::_c_HBOff(void*) {

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2008-02-06 14:56:10 UTC (rev 30810)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2008-02-06 15:38:33 UTC (rev 30811)
@@ -325,10 +325,7 @@
 	if (enable == _halfbrite) return;
 
 	_halfbrite = !_halfbrite;
-
-	if (!enable) {
-		_hbCircleRadius = 0;
-	}
+	_hbCircleRadius = 0;
 }
 
 #define HALFBRITE_CIRCLE_RADIUS		48
@@ -338,6 +335,9 @@
 	_hbCirclePos.y = y + _hbCircleRadius;
 }
 
+void Gfx::setProjectorProgram(int16 *data) {
+	_nextProjectorPos = data;
+}
 
 void Gfx::drawInventory() {
 
@@ -439,6 +439,15 @@
 		for (int i = 0; i < surf->w*surf->h; i++) {
 			*buf++ |= 0x20;
 		}
+		if (_nextProjectorPos) {
+			int16 x = *_nextProjectorPos++;
+			int16 y = *_nextProjectorPos++;
+			if (x == -1 && y == -1) {
+				_nextProjectorPos = 0;
+			} else {
+				setProjectorPos(x, y);
+			}
+		}
 		if (_hbCircleRadius > 0) {
 			drawCircle(_hbCirclePos.x, _hbCirclePos.y, _hbCircleRadius, 0, &halfbritePixel, surf->pixels);
 		}

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2008-02-06 14:56:10 UTC (rev 30810)
+++ scummvm/trunk/engines/parallaction/graphics.h	2008-02-06 15:38:33 UTC (rev 30811)
@@ -507,7 +507,10 @@
 	// amiga specific
 	void setHalfbriteMode(bool enable);
 	void setProjectorPos(int x, int y);
+	void setProjectorProgram(int16 *data);
+	int16 *_nextProjectorPos;
 
+
 	// init
 	Gfx(Parallaction* vm);
 	virtual ~Gfx();


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