[Scummvm-cvs-logs] CVS: scummvm/sword1 control.cpp,1.40,1.41 logic.cpp,1.41,1.42 sound.cpp,1.35,1.36 sword1.cpp,1.59,1.60

Robert Göffringmann lavosspawn at users.sourceforge.net
Mon Nov 15 00:24:07 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32422/sword1

Modified Files:
	control.cpp logic.cpp sound.cpp sword1.cpp 
Log Message:
BS1 demo is basically fully supported now.
only some SFX are flipped.

Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/control.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- control.cpp	9 Nov 2004 10:26:33 -0000	1.40
+++ control.cpp	15 Nov 2004 08:23:08 -0000	1.41
@@ -981,6 +981,8 @@
 	Logic::_scriptVars[CHANGE_STANCE] = STAND;
 	Logic::_scriptVars[CHANGE_PLACE] = cpt->o_place;
 	SwordEngine::_systemVars.justRestoredGame = 1;
+	if (SwordEngine::_systemVars.isDemo)
+		Logic::_scriptVars[PLAYINGDEMO] = 1;
 }
 
 void Control::delay(uint32 msecs) {

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/logic.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- logic.cpp	15 Nov 2004 02:48:30 -0000	1.41
+++ logic.cpp	15 Nov 2004 08:23:09 -0000	1.42
@@ -37,6 +37,8 @@
 
 #include "sword1/debug.h"
 
+#include "gui/message.h"
+
 namespace Sword1 {
 
 #define MAX_STACK_SIZE 10
@@ -1630,7 +1632,12 @@
 }
 
 int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
-	error("fnQuitGame() called");
+	if (SwordEngine::_systemVars.isDemo) {
+		GUI::MessageDialog dialog("This is the end of the Broken Sword 1 Demo", "OK", NULL);
+		dialog.runModal();
+		SwordEngine::_systemVars.engineQuit = true;
+	} else
+		error("fnQuitGame() called");
 	return SCRIPT_STOP;
 }
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sound.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- sound.cpp	15 Nov 2004 02:48:30 -0000	1.35
+++ sound.cpp	15 Nov 2004 08:23:09 -0000	1.36
@@ -61,6 +61,10 @@
 			warning("Sound queue overflow");
 			return 0;
 		}
+		if ((fxNo == 168) && (SwordEngine::_systemVars.isDemo)) {
+			// this sound doesn't exist in demo
+			return 0;
+		}
 		_resMan->resOpen(_fxList[fxNo].sampleId);
 		_fxQueue[_endOfQueue].id = fxNo;
 		if (_fxList[fxNo].type == FX_SPOT)
@@ -140,6 +144,8 @@
 }
 
 void Sound::playSample(QueueElement *elem) {
+	//if (((elem->id == 11) || (elem->id == 12) || (elem->id == 224)) && SwordEngine::_systemVars.isDemo)
+	//	return;
 	uint8 *sampleData = (uint8*)_resMan->fetchRes(_fxList[elem->id].sampleId);
 	for (uint16 cnt = 0; cnt < MAX_ROOMS_PER_FX; cnt++) {
 		if (_fxList[elem->id].roomVolList[cnt].roomNo) {

Index: sword1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- sword1.cpp	15 Nov 2004 02:48:30 -0000	1.59
+++ sword1.cpp	15 Nov 2004 08:23:09 -0000	1.60
@@ -1116,6 +1116,7 @@
 	} else { // speech1 & speech2 not present. are we running from cd?
 		if (test.open("cows.mad")) {
 			_systemVars.isDemo = true;
+			Logic::_scriptVars[PLAYINGDEMO] = 1;
 			test.close();
 		}
 		if (test.open("cd1.id")) {





More information about the Scummvm-git-logs mailing list