[Scummvm-cvs-logs] CVS: scummvm/sword1 logic.h,1.3,1.4 sword1.cpp,1.7,1.8 sword1.h,1.2,1.3 sworddefs.h,1.3,1.4

Jonathan Gray khalek at users.sourceforge.net
Wed Dec 17 03:55:00 CET 2003


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv24954

Modified Files:
	logic.h sword1.cpp sword1.h sworddefs.h 
Log Message:
initial boot param support, will do the rest of the bootparams next

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/logic.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- logic.h	16 Dec 2003 18:23:15 -0000	1.3
+++ logic.h	17 Dec 2003 11:54:48 -0000	1.4
@@ -52,6 +52,12 @@
 	void runMouseScript(BsObject *cpt, int32 scriptId);
 
 	static uint32 _scriptVars[NUM_SCRIPT_VARS];
+// public for startPositions()
+	int fnAddObject		(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+	int fnEnterSection	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+	int fnPlaySequence	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+
+
 private:
 	ObjectMan *_objMan;
 	ResMan *_resMan;
@@ -101,7 +107,6 @@
 	int fnSetFadeTargetPalette(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnSetPaletteToFade(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnSetPaletteToCut(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
-	int fnPlaySequence	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 
 	int fnIdle			(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnPause			(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
@@ -154,9 +159,7 @@
 	int cfnReleaseMenu	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	
 	int fnAddSubject	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
-	int fnAddObject		(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnRemoveObject	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
-	int fnEnterSection	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnLeaveSection	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnChangeFloor	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnWalk			(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);

Index: sword1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sword1.cpp	17 Dec 2003 07:33:00 -0000	1.7
+++ sword1.cpp	17 Dec 2003 11:54:48 -0000	1.8
@@ -140,20 +140,84 @@
 	}
 	
 	_systemVars.playSpeech = 1;
-	//- start.c:
-	// todo: move these to somewhere else
+	startPositions(ConfMan.getInt("boot_param"));
+	_mouseState = 0;
+}
+
+void SwordEngine::startPositions(int32 startNumber) {
+	// int32 sect;
+	BsObject *compact;
+
+	SwordLogic::_scriptVars[CHANGE_STANCE] = STAND;
 	SwordLogic::_scriptVars[GEORGE_CDT_FLAG] = GEO_TLK_TABLE;
-	SwordLogic::_scriptVars[CHANGE_X] = 481;
-	SwordLogic::_scriptVars[CHANGE_Y] = 413;
-	SwordLogic::_scriptVars[CHANGE_DIR] = DOWN;
-	SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_1;
+
+	//-------------------------------------------------------------------------------------------------------
+	// START 0==intro; 1==without
+
+	if ((startNumber==0)||(startNumber==1))
+	{
+		if (startNumber==0)
+		{
+			// Tdebug("Calling fn check cd");
+			// FN_check_CD(0,0,1,0,0,0,0,0);	// request CD for sc1 (which happens to be CD-1)
+			// Tdebug("Calling fn play sequence");
+			_logic->fnPlaySequence(0,0,4,0,0,0,0,0);	// intro
+			debug(1, "Setting start number to 1");
+			startNumber=1;
+		}
 	
-	SwordLogic::_scriptVars[NEW_SCREEN] = 1;
-	_objectMan->fetchObject(PLAYER)->o_screen = 1;
-	_objectMan->megaEntering(1);
+	
+		SwordLogic::_scriptVars[CHANGE_X] = 481;
+		SwordLogic::_scriptVars[CHANGE_Y] = 413;
+		SwordLogic::_scriptVars[CHANGE_DIR] = DOWN;
+		SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_1;
+	} 
+	//-------------------------------------------------------------------------------------------------------
+	else if (startNumber==2)	// blind_alley
+	{
+		SwordLogic::_scriptVars[CHANGE_X] = 480;
+		SwordLogic::_scriptVars[CHANGE_Y] = 388;
+		SwordLogic::_scriptVars[CHANGE_DIR] = DOWN_LEFT;
+		SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_2;
 
-	SwordLogic::_scriptVars[CHANGE_STANCE] = STAND;
-	_mouseState = 0;
+		_logic->fnAddObject(0,0,LIFTING_KEYS,0,0,0,0,0);
+		_logic->fnAddObject(0,0,ROSSO_CARD,0,0,0,0,0);
+
+		SwordLogic::_scriptVars[POCKET_1] = 1;
+		SwordLogic::_scriptVars[POCKET_2] = 1;
+		SwordLogic::_scriptVars[POCKET_3] = 1;
+		SwordLogic::_scriptVars[POCKET_4] = 1;
+		SwordLogic::_scriptVars[POCKET_5] = 1;
+		SwordLogic::_scriptVars[POCKET_6] = 1;
+		SwordLogic::_scriptVars[POCKET_7] = 1;
+		SwordLogic::_scriptVars[POCKET_8] = 1;
+		SwordLogic::_scriptVars[POCKET_9] = 1;
+
+		SwordLogic::_scriptVars[POCKET_10] = 1;
+		SwordLogic::_scriptVars[POCKET_11] = 1;
+		SwordLogic::_scriptVars[POCKET_12] = 1;
+		SwordLogic::_scriptVars[POCKET_13] = 1;
+		SwordLogic::_scriptVars[POCKET_14] = 1;
+		SwordLogic::_scriptVars[POCKET_15] = 1;
+		SwordLogic::_scriptVars[POCKET_16] = 1;
+		SwordLogic::_scriptVars[POCKET_17] = 1;
+		SwordLogic::_scriptVars[POCKET_18] = 1;
+		SwordLogic::_scriptVars[POCKET_19] = 1;
+
+		SwordLogic::_scriptVars[POCKET_20] = 1;
+		SwordLogic::_scriptVars[POCKET_21] = 1;
+		SwordLogic::_scriptVars[POCKET_22] = 1;
+		SwordLogic::_scriptVars[POCKET_23] = 1;
+		SwordLogic::_scriptVars[POCKET_24] = 1;
+		SwordLogic::_scriptVars[POCKET_25] = 1;
+		SwordLogic::_scriptVars[POCKET_26] = 1;
+		SwordLogic::_scriptVars[POCKET_27] = 1;
+		SwordLogic::_scriptVars[POCKET_28] = 1;
+		SwordLogic::_scriptVars[POCKET_29] = 1;
+	}
+
+	compact = (BsObject*)_objectMan->fetchObject(PLAYER);
+	_logic->fnEnterSection(compact, PLAYER, startNumber, 0, 0, 0, 0, 0);	// (automatically opens the compact resource for that section)
 }
 
 void SwordEngine::go(void) {

Index: sword1.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sword1.h	16 Dec 2003 02:27:53 -0000	1.2
+++ sword1.h	17 Dec 2003 11:54:48 -0000	1.3
@@ -75,6 +75,7 @@
 	void initialize(void);
 	void mainLoop(void);
 	void fnCheckCd(uint32 newScreen);
+	void startPositions(int32 startNumber);
 
 	uint16 _mouseX, _mouseY, _mouseState;
 

Index: sworddefs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sworddefs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sworddefs.h	17 Dec 2003 01:47:47 -0000	1.3
+++ sworddefs.h	17 Dec 2003 11:54:48 -0000	1.4
@@ -132,13 +132,28 @@
 #define PLAYER 8388608
 #define NICO 8454144
 #define GEORGE 8388608
+#define UP 0
+#define UP_RIGHT 1
+#define U_R 1
+#define RIGHT 2
+#define DOWN_RIGHT 3
+#define D_R 3
 #define DOWN 4
+#define DOWN_LEFT 5
+#define D_L 5
+#define LEFT 6
+#define UP_LEFT 7
+#define U_L 7
 #define FLOOR_1 65536
 #define BENOIR 8585216
 #define ROSSO 8716288
 #define MOUE 9502720
 #define ALBERT 9568256
 #define DUANE 8781824
+#define FLOOR_2 131072
+#define LIFTING_KEYS 18
+#define ROSSO_CARD 27
+
 
 #define menu_bible 69
 #define menu_newspaper 1





More information about the Scummvm-git-logs mailing list