[Scummvm-cvs-logs] CVS: scummvm/scumm/smush insane.cpp,1.12,1.13 insane.h,1.8,1.9

Eugene Sandulenko sev at users.sourceforge.net
Sun Dec 14 01:13:02 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv13531

Modified Files:
	insane.cpp insane.h 
Log Message:
 o Mouse support added
 o Fix bug with enemy not approaching Ben


Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/insane.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- insane.cpp	13 Dec 2003 07:30:58 -0000	1.12
+++ insane.cpp	14 Dec 2003 06:29:09 -0000	1.13
@@ -46,13 +46,16 @@
 // tovista1.san
 // tovista2.san
 
-// TODO:
+// TODO (in no particular order):
+// o After third crash Ben disappears
 // o Check why ftmacdemo doesn't finish insane scene
 // o Proper SAN seeking/switching. Now it just crashes
 // o TRS file support. Everything is in place, I just need to figure out function parameters
 // o FLU files support
+// o IACT
 // o Kill bugs
 // o Code review/cleanup
+// o DOS demo INSANE
 
 namespace Scumm {
 
@@ -93,7 +96,7 @@
 	_smush_bencutNut = new NutRenderer(_scumm);
 	_smush_bencutNut->loadFont("bencut.nut", _scumm->getGameDataPath());
 
-	// FIXME: implement things
+	// FIXME: implement
 	//openManyResource(0, 4, "specfnt.nut", "titlfnt.nut", "techfnt.nut", "scummfnt.nut");
 }
 
@@ -872,7 +875,7 @@
 					}
 				}
 			} else {
-				if (weaponMaxRange(actor2) < dist) {
+				if (weaponMaxRange(actor2) >= dist) {
 					if (act2x < act1x)
 						_actor[1].field_14 = 101;
 					else
@@ -1101,7 +1104,7 @@
 	int32 retval;
 	int32 tmp;
 
-	retval = func75();
+	retval = processMouse();
 	
 	// Joystick support
 	// if (func77())
@@ -1123,9 +1126,16 @@
 	return retval & 3;
 }
 
-int32 Insane::func75(void) {
-	// FIXME: implement
-	return 0;
+int32 Insane::processMouse(void) {
+	int32 buttons = 0;
+
+	_enemyState[EN_BEN][0] = _scumm->_mouse.x;
+	_enemyState[EN_BEN][1] = _scumm->_mouse.y;
+
+	buttons = _scumm->_mouseButStat & MBS_LEFT_CLICK ? 1 : 0;
+	buttons |= _scumm->_mouseButStat & MBS_RIGHT_CLICK ? 2 : 0;
+
+	return buttons;
 }
 
 int32 Insane::processKeyboard(void) {
@@ -1473,8 +1483,8 @@
 	warning("stub Insane::smush_proc41");
 }
 
-void Insane::smush_setupSomething(int x, int y, int flag) {
-	// FIXME: implement
+void Insane::smush_setupSomething(int x, int y, int buttons) {
+	_scumm->_system->warp_mouse(x, y);
 }
 
 void Insane::putActors(void) {
@@ -3073,6 +3083,7 @@
 		queueSceneSwitch(18, 0, "fishgogg.san", 64, 0, 0, 0);
 	} else if (_actor[0].field_8 == 1) {
 		tmp = _actor[0].field_14 / 22;
+
 		switch (_currSceneId) {
 		case 17:
 			if (arg_0 != 1) {
@@ -4223,7 +4234,7 @@
 		if (!smlayer_actorNeedRedraw(0, 2)) {
 			setBenState();
 			_actor[0].act[2].tilt = 0;
-			// heh, for some reason there is no break at this
+			// for some reason there is no break at this
 			// place, so tilt gets overriden on next line
 		}
 		_actor[0].act[2].tilt = calcTilt(_actor[0].speed);
@@ -6372,6 +6383,8 @@
 		if (!smlayer_actorNeedRedraw(1, 2)) {
 			setEnemyState();
 			_actor[1].act[2].tilt = 0;
+			// for some reason there is no break at this
+			// place, so tilt gets overriden on next line
 		}
 		_actor[1].act[2].tilt = calcTilt(_actor[1].speed);
 		break;

Index: insane.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/insane.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- insane.h	13 Dec 2003 07:30:58 -0000	1.8
+++ insane.h	14 Dec 2003 06:29:09 -0000	1.9
@@ -490,7 +490,7 @@
 	void actor10Reaction(int32 buttons);
 	int32 actionEnemy(void);
 	int32 processKeyboard(void);
-	int32 func75(void);
+	int32 processMouse(void);
 	void setEnemyAnimation(int32 actornum, int anim);
 	void chooseEnemyWeaponAnim(int32 buttons);
 	void switchEnemyWeapon(void);





More information about the Scummvm-git-logs mailing list