[Scummvm-cvs-logs] CVS: scummvm/scumm/insane insane.cpp,1.15,1.16 insane.h,1.9,1.10 insane_ben.cpp,1.8,1.9 insane_iact.cpp,1.10,1.11 insane_scenes.cpp,1.10,1.11

Eugene Sandulenko sev at users.sourceforge.net
Mon Feb 2 14:43:08 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm/insane
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22922/scumm/insane

Modified Files:
	insane.cpp insane.h insane_ben.cpp insane_iact.cpp 
	insane_scenes.cpp 
Log Message:
Fixed most bugs, so only cosmetic visual things left.

o Support transparency for characters. Needed for cockpit rendering
o Fixed bug in NUT renderer which drawed transparent characters garbled 
o Fixed long-standing (and outstanding) bug with SAUD error
o Previous fix fixed music in some cases (scene transitions)
o Fixed bug with palette being reset when smush video is rewind
o Made debug level for insane adjustable at compile time (maybe I will remove it later)


Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- insane.cpp	1 Feb 2004 05:56:34 -0000	1.15
+++ insane.cpp	2 Feb 2004 22:40:19 -0000	1.16
@@ -39,9 +39,8 @@
 #include "scumm/insane/insane.h"
 
 // TODO (in no particular order):
-// o SAUD complaining again
-// o Insane::postCase16() has workaround. Cockpit is not transparent so it is
-//   disabled now
+// o Long TRS messages get rendered just in one line, so text overlaps
+// o Approaching enemy animation is wrong sometimes
 // o Code review/cleanup
 // o DOS demo INSANE
 
@@ -149,8 +148,8 @@
 	_posFatherTorque = 0;
 	_posCave = 0;
 	_posVista = 0;
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_carIsBroken = false;
 	_benHasGoggles = false;
 	_mineCaveIsNear = false;
@@ -756,7 +755,7 @@
 }
 
 void Insane::smush_setToFinish(void) {
-	debug(5, "Video is set to finish");
+	debug(INSANE_DBG, "Video is set to finish");
 	_vm->_videoFinished = 1;
 }
 
@@ -800,7 +799,7 @@
 
 	int tmp, idx = scenePropIdx[scenePropNum];
 
-	debug(5, "Insane::prepareScenePropScene(%d, %d, %d)", scenePropNum, arg_4, arg_8);
+	debug(INSANE_DBG, "Insane::prepareScenePropScene(%d, %d, %d)", scenePropNum, arg_4, arg_8);
 
 	if (!loadScenePropSounds(idx))
 		return;
@@ -842,7 +841,7 @@
 							  int32 arg_C, int32 arg_10, int32 startFrame, int32 numFrames) {
 	int32 tmp;
 	
-	debug(5, "queueSceneSwitch(%d, *, %s, %d, %d, %d, %d)", sceneId, filename, arg_C, arg_10,
+	debug(INSANE_DBG, "queueSceneSwitch(%d, *, %s, %d, %d, %d, %d)", sceneId, filename, arg_C, arg_10,
 		  startFrame, numFrames);
 	if (_needSceneSwitch || _sceneData1Loaded)
 		return;
@@ -861,7 +860,7 @@
 }
 
 void Insane::smush_rewindCurrentSan(int arg_0, int arg_4, int arg_8) {
-	debug(5, "smush_rewindCurrentSan(%d, %d, %d)", arg_0, arg_4, arg_8);
+	debug(INSANE_DBG, "smush_rewindCurrentSan(%d, %d, %d)", arg_0, arg_4, arg_8);
 	_smush_setupsan2 = arg_0;
 	
 	smush_setupSanFile(0, 8, 0);
@@ -958,7 +957,7 @@
 	if (_needSceneSwitch || _keyboardDisable)
 		return;
 
-	debug(5, "scene: %d", _currSceneId);
+	debug(INSANE_DBG, "scene: %d", _currSceneId);
 	switch (_currSceneId) {
 	case 1:
 		queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0, _continueFrame1, 1300);
@@ -1184,7 +1183,6 @@
 }
 
 void Insane::smlayer_setFluPalette(byte *pal, int shut_flag) {
-	// FIXME. We can't run it without SmushPlayer object
 	//	  if (shut_flag)
 	//		// FIXME: shut colors and make picture appear smoothly
 	//		SmushPlayer::setPalette(pal);
@@ -1340,7 +1338,7 @@
 }
 
 const char *Insane::handleTrsTag(int32 trsId) {
-	debug(5, "Insane::handleTrsTag(%d)", trsId);
+	debug(INSANE_DBG, "Insane::handleTrsTag(%d)", trsId);
 	return _player->getString(trsId);
 }
 
@@ -1392,7 +1390,7 @@
 	byte *tmp = fluPtr;
 	int32 offset;
 	
-	debug(5, "smush_setupSanWithFlu(%s, %d, %d, %d, %d, %lx, %d)", filename, setupsan2,
+	debug(INSANE_DBG, "smush_setupSanWithFlu(%s, %d, %d, %d, %d, %lx, %d)", filename, setupsan2,
 		  step1, step2, setupsan1, fluPtr, numFrames);
 
 	_smush_setupsan1 = setupsan1;
@@ -1428,6 +1426,7 @@
 
 void Insane::smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1, 
 									 int32 step2, int32 setupsan1) {
+	debug(INSANE_DBG, "Insane::smush_setupFromStart(%s)", filename);
 	_smush_setupsan1 = setupsan1;
 	_smush_setupsan2 = setupsan2;
 	smush_setupSanFile(filename, 8, 0);
@@ -1443,7 +1442,7 @@
 }
 
 void Insane::smush_setupSanFile(const char *filename, int32 offset, int32 contFrame) {
-	debug(5, "smush_setupSanFile(%s, %x, %d)", filename, offset, contFrame);
+	debug(INSANE_DBG, "Insane::smush_setupSanFile(%s, %x, %d)", filename, offset, contFrame);
 
 	_player->seekSan(filename, _vm->getGameDataPath(), offset, contFrame);
 

Index: insane.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- insane.h	1 Feb 2004 05:44:18 -0000	1.9
+++ insane.h	2 Feb 2004 22:40:19 -0000	1.10
@@ -51,6 +51,8 @@
 #define EN_TORQUE    8 // Father Torque
 #define EN_BEN       9 // used only with handler
 
+#define INSANE_DBG 5
+
 class Insane {
  public:
 	Insane(ScummEngine_v6 *scumm);
@@ -163,8 +165,8 @@
 	int16 _posFatherTorque;
 	int16 _posCave;
 	int16 _posVista;
-	bool _roadLeftBranch;
-	bool _roadRightBranch;
+	bool _roadBranch;
+	bool _roadStop;
 	bool _carIsBroken;
 	bool _benHasGoggles;
 	bool _mineCaveIsNear;
@@ -268,9 +270,6 @@
 	void readFileToMem(const char *name, byte **buf);
 	void startVideo(const char *filename, int num, int argC, int frameRate, 
 					 int doMainLoop, byte *fluPtr = 0, int32 numFrames = 0);
-	void smush_proc39(void);
-	void smush_proc40(void);
-	void smush_proc41(void);
 	void smush_warpMouse(int x, int y, int buttons);
 	void putActors(void);
 	void readState(void);

Index: insane_ben.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane_ben.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- insane_ben.cpp	1 Feb 2004 05:44:18 -0000	1.8
+++ insane_ben.cpp	2 Feb 2004 22:40:19 -0000	1.9
@@ -254,7 +254,7 @@
 					smush_setToFinish();
 				}
 
-				if (_roadLeftBranch && !_needSceneSwitch) {
+				if (_roadBranch && !_needSceneSwitch) {
 					_iactSceneId2 = _iactSceneId;
 					queueSceneSwitch(2, 0, "mineexit.san", 64, 0, 0, 0);
 				}
@@ -275,7 +275,7 @@
 
 			drawSpeedyActor(buttons);
 
-			if ((buttons & 1) && _currSceneId == 1 && _roadLeftBranch && !_needSceneSwitch) {
+			if ((buttons & 1) && _currSceneId == 1 && _roadBranch && !_needSceneSwitch) {
 				_iactSceneId2 = _iactSceneId;
 				queueSceneSwitch(2, 0, "mineexit.san", 64, 0, 0, 0);
 			}
@@ -301,7 +301,7 @@
 			if ((buttons & 1) == 0)
 				return;
 
-			if (_roadLeftBranch && !_needSceneSwitch) {
+			if (_roadBranch && !_needSceneSwitch) {
 				_iactSceneId2 = _iactSceneId;
 
 				if (readArray(4) && _val211d < 3) {
@@ -312,7 +312,7 @@
 				}
 			}
 			
-			if (_roadRightBranch) {
+			if (_roadStop) {
 				writeArray(1, _posBrokenTruck);
 				writeArray(3, _val57d);
 				smush_setToFinish();
@@ -338,7 +338,7 @@
 			if ((buttons & 1) == 0)
 				return;
 
-			if (_roadLeftBranch && !_needSceneSwitch) {
+			if (_roadBranch && !_needSceneSwitch) {
 				_iactSceneId2 = _iactSceneId;
 
 				if (readArray(4) && _val211d < 3) {
@@ -349,7 +349,7 @@
 				}
 			}
 			
-			if (_roadRightBranch) {
+			if (_roadStop) {
 				writeArray(1, _posBrokenTruck);
 				writeArray(3, _posVista);
 				smush_setToFinish();

Index: insane_iact.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane_iact.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- insane_iact.cpp	1 Feb 2004 05:44:18 -0000	1.10
+++ insane_iact.cpp	2 Feb 2004 22:40:19 -0000	1.11
@@ -133,20 +133,18 @@
 	case 6:
 		switch (par2) {
 		case 38:
-			// left branch sign
 			smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3, 
 								  _smush_iconsNut, 7, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
 		case 7:
 			if (readArray(4) != 0)
 				return;
 
-			// right branch sign
-			smlayer_drawSomething(renderBitmap, codecparam, 160-19, 20-13, 3, 
+			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, // QW
 								  _smush_icons2Nut, 8, 0, 0);
-			_roadRightBranch = true;
+			_roadStop = true;
 			break;
 		case 8:
 			if (readArray(4) == 0 || readArray(6) == 0)
@@ -437,16 +435,16 @@
 			
 			smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3, 
 								  _smush_icons2Nut, 10, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
 		case 7:
 			if (readArray(4) != 0)
 				return;
 
-			smlayer_drawSomething(renderBitmap, codecparam, 160-19, 20-13, 3, 
+			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, // QW
 								  _smush_icons2Nut, 8, 0, 0);
-			_roadRightBranch = true;
+			_roadStop = true;
 			break;
 		case 8:
 			if (readArray(4) == 0 || readArray(6) == 0)
@@ -462,13 +460,13 @@
 				return;
 			
 			_carIsBroken = true;
-			smlayer_drawSomething(renderBitmap, codecparam, 160-12, 20-10, 3, 
+			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, // QW
 								  _smush_icons2Nut, 8, 0, 0);
 			break;
 		case 11:
 			smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3, 
 								  _smush_icons2Nut, 9, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
 		}
@@ -528,15 +526,15 @@
 		case 38:
 			smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3, 
 								  _smush_icons2Nut, 10, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
 		case 7:
 			if (readArray(4) != 0)
 				return;
 
-			_roadRightBranch = true;
-			smlayer_drawSomething(renderBitmap, codecparam, 160-19, 20-13, 3, 
+			_roadStop = true;
+			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, //QW
 								  _smush_icons2Nut, 8, 0, 0);
 			break;
 		case 8:
@@ -553,13 +551,13 @@
 				return;
 			
 			_carIsBroken = true;
-			smlayer_drawSomething(renderBitmap, codecparam, 160-12, 20-10, 3, 
+			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, //QW
 								  _smush_icons2Nut, 8, 0, 0);
 			break;
 		case 11:
 			smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3, 
 								  _smush_icons2Nut, 9, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
 		}
@@ -591,7 +589,7 @@
 		case 38:
 			smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1, 
 								  _smush_iconsNut, 6, 0, 0);
-			_roadLeftBranch = true;
+			_roadBranch = true;
 			_iactSceneId = par4;
 			if (_counter1 <= 4) {
 				if (_counter1 == 4)
@@ -602,7 +600,7 @@
 			}
 			_objectDetected = true;
 			break;
-		case 11:
+		case 10:
 			smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1, 
 								  _smush_iconsNut, 6, 0, 0);
 			if (_counter1 <= 4) {

Index: insane_scenes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane_scenes.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- insane_scenes.cpp	1 Feb 2004 05:44:18 -0000	1.10
+++ insane_scenes.cpp	2 Feb 2004 22:40:19 -0000	1.11
@@ -55,7 +55,7 @@
 	putActors();
 	readState();
 
-	debug(5, "INSANE Arg: %d", readArray(0));
+	debug(INSANE_DBG, "INSANE Arg: %d", readArray(0));
 
 	switch (readArray(0)) {
 	case 1:
@@ -164,7 +164,7 @@
 }
 
 int Insane::initScene(int sceneId) {
-	debug(5, "initScene(%d)", sceneId);
+	debug(INSANE_DBG, "initScene(%d)", sceneId);
 
 	if (_needSceneSwitch)
 		return 1;
@@ -186,7 +186,7 @@
 void Insane::stopSceneSounds(int sceneId) {
 	int flag = 0;
 
-	debug(5, "stopSceneSounds(%d)", sceneId);
+	debug(INSANE_DBG, "stopSceneSounds(%d)", sceneId);
 
 	switch (sceneId) {
 	case 1:
@@ -278,7 +278,7 @@
 }
 
 void Insane::shutCurrentScene(void) {
-	debug(5, "shutCurrentScene()");
+	debug(INSANE_DBG, "shutCurrentScene()");
 
 	_currScenePropIdx = 0;
 	_currTrsMsg = 0;
@@ -307,7 +307,7 @@
 int Insane::loadSceneData(int scene, int flag, int phase) {
 	int retvalue = 1;
 
-	debug(5, "Insane::loadSceneData(%d, %d, %d)", scene, flag, phase);
+	debug(INSANE_DBG, "Insane::loadSceneData(%d, %d, %d)", scene, flag, phase);
 	//if (phase == 1) /// FIXME
 	//	insane_unlock();
 	switch (scene) {
@@ -601,7 +601,7 @@
 }
 
 void Insane::setSceneCostumes(int sceneId) {
-	debug(5, "Insane::setSceneCostumes(%d)", sceneId);
+	debug(INSANE_DBG, "Insane::setSceneCostumes(%d)", sceneId);
 
 	switch (sceneId) {
 	case 1:
@@ -651,7 +651,7 @@
 void Insane::setEnemyCostumes(void) {
 	int i;
 
-	debug(5, "setEnemyCostumes(%d)", _currEnemy);
+	debug(INSANE_DBG, "setEnemyCostumes(%d)", _currEnemy);
 
 	smlayer_setActorCostume(0, 2, readArray(12));
 	smlayer_setActorCostume(0, 0, readArray(14));
@@ -987,8 +987,8 @@
 							 _continueFrame, 1300);
 		}
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase0(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1002,8 +1002,8 @@
 		smush_rewindCurrentSan(1088, -1, -1);
 	
 	_roadBumps = false;
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_benHasGoggles = false;
 	_mineCaveIsNear = false;
 	_continueFrame1 = curFrame;
@@ -1022,8 +1022,8 @@
 			writeArray(9, 0);
 		}
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase16(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1043,11 +1043,10 @@
 	smlayer_showStatusMsg(-1, renderBitmap, codecparam, 202, 168, 1, 2, 0, "%s", buf);
 	
 	sprintf(buf, "^f01%02o", curFrame & 0xff);
-	smlayer_showStatusMsg(-1, renderBitmap, codecparam, 140, 168, 1, 2, 0, "%s", buf);
+	smlayer_showStatusMsg(-1, renderBitmap, codecparam, 240, 168, 1, 2, 0, "%s", buf);
 	smlayer_showStatusMsg(-1, renderBitmap, codecparam, 170, 43, 1, 2, 0, "%s", buf);
 
-	// FIXME: it should be transparent, so now it is disabled
-	//smlayer_drawSomething(renderBitmap, codecparam, 0, 0, 1, _smush_bensgoggNut, 0, 0, 0);
+	smlayer_drawSomething(renderBitmap, codecparam, 0, 0, 1, _smush_bensgoggNut, 0, 0, 0);
 	
 	if (!_objectDetected)
 		smlayer_drawSomething(renderBitmap, codecparam, 24, 170, 1, 
@@ -1062,8 +1061,8 @@
 	}
 	_roadBumps = false;
 	_mineCaveIsNear = false;
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_objectDetected = false;
 	_counter1++;
 	_continueFrame1 = curFrame;
@@ -1080,8 +1079,8 @@
 		queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0, 
 						 flu->startFrame, flu->numFrames);
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase2(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1096,8 +1095,8 @@
 		smush_rewindCurrentSan(1088, -1, -1);
 
 	_roadBumps = false;
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_continueFrame = curFrame;
 }
 
@@ -1110,8 +1109,8 @@
 		smush_rewindCurrentSan(1088, -1, -1);
 	
 	_roadBumps = false;
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_continueFrame = curFrame;
 }
 
@@ -1154,8 +1153,8 @@
 	}
 
 	_carIsBroken = false;
-	_roadRightBranch = false;
-	_roadLeftBranch = false;
+	_roadStop = false;
+	_roadBranch = false;
 	_iactSceneId = 0;
 }
 
@@ -1186,8 +1185,8 @@
 	}
 	
 	_carIsBroken = false;
-	_roadRightBranch = false;
-	_roadLeftBranch = false;
+	_roadStop = false;
+	_roadBranch = false;
 	_iactSceneId = 0;
 }
 
@@ -1204,8 +1203,8 @@
 		queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0, 
 						 flu->startFrame, flu->numFrames);
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase8(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1226,8 +1225,8 @@
 		}
  	}
 	
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase9(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1237,8 +1236,8 @@
 		queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
 						 _continueFrame1, 1300);
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase10(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1287,8 +1286,8 @@
 		}
  	}
 	
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1373,8 +1372,8 @@
 	if (curFrame >= maxFrame)
 		smush_rewindCurrentSan(1088, -1, -1);
 
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_continueFrame = curFrame;
 }
 
@@ -1390,8 +1389,8 @@
 				queueSceneSwitch(5, 0, "tovista2.san", 64, 0, 0, 290);
 		}
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCase14(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1415,8 +1414,8 @@
 		}
 	}
 
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 }
 
 void Insane::postCaseAll(byte *renderBitmap, int32 codecparam, int32 setupsan12,
@@ -1462,8 +1461,8 @@
 			}
 		}
 	}
-	_roadLeftBranch = false;
-	_roadRightBranch = false;
+	_roadBranch = false;
+	_roadStop = false;
 	_continueFrame = curFrame;
 }
 





More information about the Scummvm-git-logs mailing list