[Scummvm-cvs-logs] CVS: scummvm/scumm/insane insane.cpp,1.16,1.17 insane.h,1.10,1.11 insane_iact.cpp,1.11,1.12 insane_scenes.cpp,1.12,1.13

Eugene Sandulenko sev at users.sourceforge.net
Fri Feb 6 15:01:01 CET 2004


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

Modified Files:
	insane.cpp insane.h insane_iact.cpp insane_scenes.cpp 
Log Message:
o Now Long TRS messages get wrapped
o Approaching enemy animation fixed
o Renames some vars and struct members
o Fixed dosdemo. It didn't run
o Correct Mac demo INSANE skipping behaviour


Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- insane.cpp	2 Feb 2004 22:40:19 -0000	1.16
+++ insane.cpp	6 Feb 2004 21:05:58 -0000	1.17
@@ -39,8 +39,6 @@
 #include "scumm/insane/insane.h"
 
 // TODO (in no particular order):
-// 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
 
@@ -53,30 +51,33 @@
 Insane::Insane(ScummEngine_v6 *scumm) {
 	_vm = scumm;
 	
-	// Demo has different insane, so disable it now
-	if (_vm->_features & GF_DEMO)
+#ifndef FTDOSDEMO
+	if ((_vm->_features & GF_DEMO) && (_vm->_features & GF_PC))
 		return;
+#endif
 
 	initvars();
 
-	readFileToMem("roadrash.rip", &_smush_roadrashRip);
-	readFileToMem("roadrsh2.rip", &_smush_roadrsh2Rip);
-	readFileToMem("roadrsh3.rip", &_smush_roadrsh3Rip);
-	readFileToMem("goglpalt.rip", &_smush_goglpaltRip);
-	readFileToMem("tovista1.flu", &_smush_tovista1Flu);
-	readFileToMem("tovista2.flu", &_smush_tovista2Flu);
-	readFileToMem("toranch.flu", &_smush_toranchFlu);
-	readFileToMem("minedriv.flu", &_smush_minedrivFlu);
-	readFileToMem("minefite.flu", &_smush_minefiteFlu);
+	if (!((_vm->_features & GF_DEMO) && (_vm->_features & GF_PC))) {
+		readFileToMem("roadrash.rip", &_smush_roadrashRip);
+		readFileToMem("roadrsh2.rip", &_smush_roadrsh2Rip);
+		readFileToMem("roadrsh3.rip", &_smush_roadrsh3Rip);
+		readFileToMem("goglpalt.rip", &_smush_goglpaltRip);
+		readFileToMem("tovista1.flu", &_smush_tovista1Flu);
+		readFileToMem("tovista2.flu", &_smush_tovista2Flu);
+		readFileToMem("toranch.flu", &_smush_toranchFlu);
+		readFileToMem("minedriv.flu", &_smush_minedrivFlu);
+		readFileToMem("minefite.flu", &_smush_minefiteFlu);
+		_smush_bensgoggNut = new NutRenderer(_vm);
+		_smush_bensgoggNut->loadFont("bensgogg.nut", _vm->getGameDataPath());
+		_smush_bencutNut = new NutRenderer(_vm);
+		_smush_bencutNut->loadFont("bencut.nut", _vm->getGameDataPath());
+	}
 
 	_smush_iconsNut = new NutRenderer(_vm);
 	_smush_iconsNut->loadFont("icons.nut", _vm->getGameDataPath());
 	_smush_icons2Nut = new NutRenderer(_vm);
 	_smush_icons2Nut->loadFont("icons2.nut", _vm->getGameDataPath());
-	_smush_bensgoggNut = new NutRenderer(_vm);
-	_smush_bensgoggNut->loadFont("bensgogg.nut", _vm->getGameDataPath());
-	_smush_bencutNut = new NutRenderer(_vm);
-	_smush_bencutNut->loadFont("bencut.nut", _vm->getGameDataPath());
 }
 
 Insane::~Insane(void) {
@@ -154,7 +155,7 @@
 	_benHasGoggles = false;
 	_mineCaveIsNear = false;
 	_objectDetected = false;
-	_val32d = -1;
+	_approachAnim = -1;
 	_val54d = 0;
 	_val57d = 0;
 	_val115_ = false;
@@ -453,7 +454,7 @@
 								   int16 occurences, int32 maxdamage, int32 field_10,
 								   int32 weapon, int32 sound, const char *filename,
 								   int32 costume4, int32 costume6, int32 costume5,
-								   int16 costumevar, int32 maxframe, int32 field_34) {
+								   int16 costumevar, int32 maxframe, int32 apprAnim) {
 	assert(strlen(filename) < 20);
 
 	_enemy[n].handler = handler;
@@ -469,7 +470,7 @@
 	_enemy[n].costume5 = costume5;
 	_enemy[n].costumevar = costumevar;
 	_enemy[n].maxframe = maxframe;
-	_enemy[n].field_34 = field_34;
+	_enemy[n].apprAnim = apprAnim;
 }
 
 void Insane::init_fluConfStruct(int n, int sceneId, byte **fluPtr, 
@@ -597,11 +598,6 @@
 
 void Insane::startVideo(const char *filename, int num, int argC, int frameRate, 
 						 int doMainLoop, byte *fluPtr, int32 numFrames) {
-
-	// Demo has different insane, so disable it now
-	if (_vm->_features & GF_DEMO)
-		return;
-
 	_smush_curFrame = 0;
 	_smush_isSanFileSetup = 0;
 	_smush_setupsan4 = 0;
@@ -680,7 +676,7 @@
 	_actor[0].cursorX = 0;
 	_actor[0].lost = false;
 	_currEnemy = -1;
-	_val32d = -1;
+	_approachAnim = -1;
 	smush_warpMouse(160, 100, -1);
 }
 
@@ -947,8 +943,7 @@
 void Insane::escapeKeyHandler(void) {
 	struct fluConf *flu;
 
-	//if (!_ptrMainLoop) { } // We don't need it
- 	// Demo has different insane, so disable it now
+	// Demos have just one scene
 	if (!_insaneIsRunning || _vm->_features & GF_DEMO) {
 		smush_setToFinish();
 		return;
@@ -1275,13 +1270,16 @@
 	// bit 1 - not used     2
 	// bit 2 - ???          4
 	// bit 3 - wrap around  8
-	switch (flags & 9) {
+	switch (flags) {
 	case 0: 
 		sf->drawStringAbsolute(str, renderBitmap, _player->_width, pos_x, pos_y);
 		break;
 	case 1:
 		sf->drawStringCentered(str, renderBitmap, _player->_width, _player->_height, pos_x, MAX(pos_y, top));
 		break;
+	case 5:
+		sf->drawStringWrapCentered(str, renderBitmap, _player->_width, _player->_height, pos_x, pos_y, 10, 300);
+		break;
 	default:
 		warning("Insane::smlayer_showStatusMsg. Not handled flags: %d", flags);
 	}
@@ -1295,6 +1293,8 @@
 	par1 = b.getWord();
 	par2 = b.getWord();
 
+	_player->_skipNext = false;
+
 	if (!par2) {
 		if (isBitSet(par1))
 			_player->_skipNext = true;
@@ -1308,24 +1308,21 @@
 }
 
 bool Insane::isBitSet(int n) {
-	if (n >= 0x80 * 8)
-		return false;
+	assert (n < 0x80);
 
-	return ((_iactBits[n / 8] & (0x80 >> (n % 8))) != 0);
+	return (_iactBits[n] != 0);
 }
 
 void Insane::setBit(int n) {
-	if (n >= 0x80 * 8)
-		return;
+	assert (n < 0x80);
 
-	_iactBits[n / 8] |= 0x80 >> (n % 8);
+	_iactBits[n] = 1;
 }
 
 void Insane::clearBit(int n) {
-	if (n >= 0x80 * 8)
-		return;
+	assert (n < 0x80);
 
-	_iactBits[n / 8] &= ~(0x80 >> (n % 8));
+	_iactBits[n] = 0;
 }
 
 void Insane::smlayer_setActorFacing(int actornum, int actnum, int frame, int direction) {

Index: insane.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- insane.h	2 Feb 2004 22:40:19 -0000	1.10
+++ insane.h	6 Feb 2004 21:05:58 -0000	1.11
@@ -53,6 +53,8 @@
 
 #define INSANE_DBG 5
 
+#undef FTDOSDEMO
+
 class Insane {
  public:
 	Insane(ScummEngine_v6 *scumm);
@@ -172,7 +174,7 @@
 	bool _mineCaveIsNear;
 	bool _objectDetected;
 	bool _roadBumps;
-	int32 _val32d;
+	int32 _approachAnim;
 	int32 _val54d;
 	int32 _val57d;
 	bool _val115_;
@@ -195,7 +197,7 @@
 		int32 costume5;
 		int16 costumevar;
 		int32 maxframe;
-		int32 field_34;
+		int32 apprAnim;
 	};
   
 	struct enemy _enemy[9];

Index: insane_iact.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane_iact.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- insane_iact.cpp	2 Feb 2004 22:40:19 -0000	1.11
+++ insane_iact.cpp	6 Feb 2004 21:05:58 -0000	1.12
@@ -85,12 +85,13 @@
 			break;
 		}
 
-		if (_val32d == -1) {
+		if (_approachAnim == -1) {
 			proc62(); //PATCH
-			_val32d = _enemy[_currEnemy].field_34;
+			_currEnemy = EN_VULTM2;
+			_approachAnim = _enemy[_currEnemy].apprAnim;
 		}
 
-		if (_val32d == par4)
+		if (_approachAnim == par4)
 			clearBit(par5);
 		else
 			setBit(par5);
@@ -98,11 +99,11 @@
 	case 3:
 		if (par3 == 1) {
 			setBit(b.getWord());
-			_val32d = -1;
+			_approachAnim = -1;
 		}
 		break;
 	case 4:
-		if (par3 == 1 && (_val32d < 0 || _val32d > 4))
+		if (par3 == 1 && (_approachAnim < 0 || _approachAnim > 4))
 			setBit(b.getWord());
 		break;
 	case 5:
@@ -138,29 +139,12 @@
 			_roadBranch = true;
 			_iactSceneId = par4;
 			break;
-		case 7:
-			if (readArray(4) != 0)
-				return;
-
-			smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, // QW
-								  _smush_icons2Nut, 8, 0, 0);
-			_roadStop = true;
-			break;
-		case 8:
-			if (readArray(4) == 0 || readArray(6) == 0)
-				return;
-
-			writeArray(1, _posBrokenTruck);
-			writeArray(3, _val57d);
-			smush_setToFinish();
-
-			break;
 		case 25:				
 			_roadBumps = true;
 			_actor[0].y1 = -_actor[0].y1;
 			break;
 		case 11:
-			if (_val32d >= 1 && _val32d <= 4 && !_needSceneSwitch)
+			if (_approachAnim >= 1 && _approachAnim <= 4 && !_needSceneSwitch)
 				queueSceneSwitch(13, _smush_minefiteFlu, "minefite.san", 64, 0,
 								 _continueFrame1, 1300);
 			break;
@@ -192,7 +176,7 @@
 		break;
 	}
 
-	if (_val32d < 0 || _val32d > 4)
+	if (_approachAnim < 0 || _approachAnim > 4)
 		if (readArray(8)) {
 			smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-18, 3, 
 								  _smush_iconsNut, 20, 0, 0);
@@ -581,7 +565,7 @@
 	case 4:
 		if (par3 == 1) {
 			setBit(b.getWord());
-			_val32d = -1;
+			_approachAnim = -1;
 		}
 		break;
 	case 6:

Index: insane_scenes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane_scenes.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- insane_scenes.cpp	5 Feb 2004 19:26:00 -0000	1.12
+++ insane_scenes.cpp	6 Feb 2004 21:05:58 -0000	1.13
@@ -34,6 +34,11 @@
 namespace Scumm {
 
 void Insane::runScene(int arraynum) {
+#ifndef FTDOSDEMO
+	if ((_vm->_features & GF_DEMO) && (_vm->_features & GF_PC))
+		return;
+#endif
+
 	_insaneIsRunning = true;
 	_player = new SmushPlayer(_vm, _speed);
 	_player->insanity(true);





More information about the Scummvm-git-logs mailing list