[Scummvm-cvs-logs] SF.net SVN: scummvm: [24710] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Nov 13 21:12:52 CET 2006


Revision: 24710
          http://svn.sourceforge.net/scummvm/?rev=24710&view=rev
Author:   fingolfin
Date:     2006-11-13 12:12:52 -0800 (Mon, 13 Nov 2006)

Log Message:
-----------
Moved more SMUSH/Insane code from ScummEngine_v6 to ScummEngine_v7

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/intern.h
    scummvm/trunk/engines/scumm/script_v6.cpp

Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h	2006-11-13 19:46:52 UTC (rev 24709)
+++ scummvm/trunk/engines/scumm/intern.h	2006-11-13 20:12:52 UTC (rev 24710)
@@ -584,31 +584,11 @@
 	} _akosQueue[32];
 	int16 _akosQueuePos;
 
-
-	int _smushFrameRate;
-
-	/**
-	 * Flag which signals that the SMUSH video playback should end now
-	 * (e.g. because it was aborted by the user or it's simply finished).
-	 */
-	bool _smushVideoShouldFinish;
-
-	bool _smushActive;
-
-	Insane *_insane;
-
 	byte _curActor;
 	int _curVerb;
 	int _curVerbSlot;
 
 public:
-	/** This flag tells IMuseDigital that INSANE is running. */
-	bool _insaneRunning;	// Used by IMuseDigital::flushTracks()
-
-	SmushMixer *_smixer;
-	SmushPlayer *_splayer;
-
-public:
 	ScummEngine_v6(OSystem *syst, const DetectorResult &dr);
 
 	virtual void resetScumm();
@@ -817,7 +797,7 @@
 	void o6_distObjectObject();
 	void o6_distObjectPt();
 	void o6_distPtPt();
-	void o6_kernelSetFunctions();
+	virtual void o6_kernelSetFunctions();
 	void o6_delayFrames();
 	void o6_pickOneOf();
 	void o6_pickOneOfDefault();
@@ -858,11 +838,34 @@
 	ScummEngine_v7(OSystem *syst, const DetectorResult &dr);
 	~ScummEngine_v7();
 
+
+protected:
+	int _smushFrameRate;
+
+	/**
+	 * Flag which signals that the SMUSH video playback should end now
+	 * (e.g. because it was aborted by the user or it's simply finished).
+	 */
+	bool _smushVideoShouldFinish;
+
+	bool _smushActive;
+
+	Insane *_insane;
+
+public:
+	/** This flag tells IMuseDigital that INSANE is running. */
+	bool _insaneRunning;	// Used by IMuseDigital::flushTracks()
+
+	SmushMixer *_smixer;
+	SmushPlayer *_splayer;
+
+
 	struct LangIndexNode {
 		char tag[12+1];
 		int32 offset;
 	};
 	
+protected:
 	int _verbCharset, _verbLineSpacing;
 	bool _existLanguageFile;
 	char *_languageBuffer;
@@ -887,6 +890,7 @@
 	int _subtitleQueuePos;
 	SubtitleText _subtitleQueue[20];
 
+public:
 	void processSubtitleQueue();
 	void addSubtitleToQueue(const byte *text, const Common::Point &pos, byte color, byte charset);
 	void clearSubtitleQueue();
@@ -924,6 +928,9 @@
 	void playSpeech(const byte *ptr);
 
 	virtual void drawVerb(int verb, int mode);
+
+
+	virtual void o6_kernelSetFunctions();
 };
 
 class ScummEngine_v8 : public ScummEngine_v7 {

Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp	2006-11-13 19:46:52 UTC (rev 24709)
+++ scummvm/trunk/engines/scumm/script_v6.cpp	2006-11-13 20:12:52 UTC (rev 24710)
@@ -2506,197 +2506,203 @@
 	// So, we just handle this as no-op opcode.
 }
 
-void ScummEngine_v6::o6_kernelSetFunctions() {
+#ifndef DISABLE_SCUMM_7_8
+void ScummEngine_v7::o6_kernelSetFunctions() {
 	int args[30];
 	int num;
 	Actor *a;
 
 	num = getStackList(args, ARRAYSIZE(args));
 
-	if (_game.version >= 7) {
-		switch (args[0]) {
-		case 4:
-			grabCursor(args[1], args[2], args[3], args[4]);
-			break;
-#ifndef DISABLE_SCUMM_7_8
-		case 6: {
-				if (_smushFrameRate == 0)
+	switch (args[0]) {
+	case 4:
+		grabCursor(args[1], args[2], args[3], args[4]);
+		break;
+	case 6: {
+			if (_smushFrameRate == 0)
+				_smushFrameRate = 14;
+
+			// SMUSH movie playback
+			if (args[1] == 0) {
+				assert(getStringAddressVar(VAR_VIDEONAME));
+				if (strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "sq3.san") == 0)
 					_smushFrameRate = 14;
 
-				// SMUSH movie playback
-				if (args[1] == 0) {
-					assert(getStringAddressVar(VAR_VIDEONAME));
-					if (strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "sq3.san") == 0)
-						_smushFrameRate = 14;
+				// Correct incorrect smush filename in Macintosh FT demo
+				if ((_game.id == GID_FT) && (_game.features & GF_DEMO) && (_game.platform == Common::kPlatformMacintosh) &&
+					(strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "jumpgorge.san") == 0))
+					_splayer->play("jumpgorg.san", _smushFrameRate);
+				else
+					_splayer->play((char *)getStringAddressVar(VAR_VIDEONAME), _smushFrameRate);
 
-					// Correct incorrect smush filename in Macintosh FT demo
-					if ((_game.id == GID_FT) && (_game.features & GF_DEMO) && (_game.platform == Common::kPlatformMacintosh) &&
-					    (strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "jumpgorge.san") == 0))
-						_splayer->play("jumpgorg.san", _smushFrameRate);
-					else
-						_splayer->play((char *)getStringAddressVar(VAR_VIDEONAME), _smushFrameRate);
+				if (_game.id == GID_DIG) {
+					_disableFadeInEffect = true;
+				}
+			} else if (_game.id == GID_FT) {
+				const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC))
+					? 232 : 233;
 
-					if (_game.id == GID_DIG) {
-						_disableFadeInEffect = true;
-					}
-				} else if (_game.id == GID_FT) {
-					const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC))
-						? 232 : 233;
-
-					_insaneRunning = true;
-					_insane->setSmushParams(_smushFrameRate);
-					_insane->runScene(insaneVarNum);
-					_insaneRunning = false;
-				}
+				_insaneRunning = true;
+				_insane->setSmushParams(_smushFrameRate);
+				_insane->runScene(insaneVarNum);
+				_insaneRunning = false;
 			}
-			break;
+		}
+		break;
+	case 12:
+		setCursorFromImg(args[1], (uint) - 1, args[2]);
+		break;
+	case 13:
+		derefActor(args[1], "o6_kernelSetFunctions:13")->remapActorPalette(args[2], args[3], args[4], -1);
+		break;
+	case 14:
+		derefActor(args[1], "o6_kernelSetFunctions:14")->remapActorPalette(args[2], args[3], args[4], args[5]);
+		break;
+	case 15:
+		_smushFrameRate = args[1];
+		break;
+	case 16:
+	case 17:
+		enqueueText(getStringAddressVar(VAR_STRING2DRAW), args[3], args[4], args[2], args[1], (args[0] == 16));
+		break;
+	case 20:
+		// it's used for turn on/off 'RadioChatter' effect for voice in the dig, but i's not needed
+		break;
+	case 107:
+		a = derefActor(args[1], "o6_kernelSetFunctions: 107");
+		a->setScale((unsigned char)args[2], -1);
+		break;
+	case 108:
+		setShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]);
+		break;
+	case 109:
+		setShadowPalette(0, args[1], args[2], args[3], args[4], args[5]);
+		break;
+	case 114:
+		error("o6_kernelSetFunctions: stub114()");
+		break;
+	case 117:
+		freezeScripts(2);
+		break;
+	case 118:
+		enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 3);
+		break;
+	case 119:
+		enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0);
+		break;
+	case 124:
+		_saveSound = args[1];
+		break;
+	case 215:
+		ConfMan.setBool("subtitles", args[1] != 0);
+		break;
+	default:
+		error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
+		break;
+	}
+}
 #endif
-		case 12:
-			setCursorFromImg(args[1], (uint) - 1, args[2]);
-			break;
-		case 13:
-			derefActor(args[1], "o6_kernelSetFunctions:13")->remapActorPalette(args[2], args[3], args[4], -1);
-			break;
-		case 14:
-			derefActor(args[1], "o6_kernelSetFunctions:14")->remapActorPalette(args[2], args[3], args[4], args[5]);
-			break;
-		case 15:
-			_smushFrameRate = args[1];
-			break;
-		case 16:
-		case 17:
-			enqueueText(getStringAddressVar(VAR_STRING2DRAW), args[3], args[4], args[2], args[1], (args[0] == 16));
-			break;
-		case 20:
-			// it's used for turn on/off 'RadioChatter' effect for voice in the dig, but i's not needed
-			break;
-		case 107:
-			a = derefActor(args[1], "o6_kernelSetFunctions: 107");
-			a->setScale((unsigned char)args[2], -1);
-			break;
-		case 108:
-			setShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]);
-			break;
-		case 109:
-			setShadowPalette(0, args[1], args[2], args[3], args[4], args[5]);
-			break;
-		case 114:
-			error("o6_kernelSetFunctions: stub114()");
-			break;
-		case 117:
-			freezeScripts(2);
-			break;
-		case 118:
-			enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 3);
-			break;
-		case 119:
-			enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0);
-			break;
-		case 124:
-			_saveSound = args[1];
-			break;
-		case 215:
-			ConfMan.setBool("subtitles", args[1] != 0);
-			break;
-		default:
-			error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
-			break;
-		}
-	} else {
-		switch (args[0]) {
-		case 3:
-			// Dummy case
-			break;
-		case 4:
-			grabCursor(args[1], args[2], args[3], args[4]);
-			break;
-		case 5:
-			fadeOut(args[1]);
-			break;
-		case 6:
-			_fullRedraw = true;
-			redrawBGAreas();
-			setActorRedrawFlags();
-			processActors();
-			fadeIn(args[1]);
-			break;
-		case 8:
-			startManiac();
-			break;
-		case 9:
-			killAllScriptsExceptCurrent();
-			break;
-		case 104:									/* samnmax */
-			nukeFlObjects(args[2], args[3]);
-			break;
-		case 107:									/* set actor scale */
-			a = derefActor(args[1], "o6_kernelSetFunctions: 107");
-			a->setScale((unsigned char)args[2], -1);
-			break;
-		case 108:									/* create proc_special_palette */
-		case 109:
-			// Case 108 and 109 share the same function
-			if (num != 6)
-				error("o6_kernelSetFunctions sub op %d: expected 6 params but got %d", args[0], num);
-			setShadowPalette(args[3], args[4], args[5], args[1], args[2], 0, 256);
-			break;
-		case 110:
-			_charset->clearCharsetMask();
-			break;
-		case 111:
-			a = derefActor(args[1], "o6_kernelSetFunctions: 111");
-			a->_shadowMode = args[2] + args[3];
-			break;
-		case 112:									/* palette shift? */
-			setShadowPalette(args[3], args[4], args[5], args[1], args[2], args[6], args[7]);
-			break;
-		case 114:
-			// Sam & Max film noir mode
-			if (_game.id == GID_SAMNMAX) {
-				// At this point ScummVM will already have set
-				// variable 0x8000 to indicate that the game is
-				// in film noir mode. All we have to do here is
-				// to mark the palette as "dirty", because
-				// updatePalette() will desaturate the colors
-				// as they are uploaded to the backend.
-				//
-				// This actually works better than the original
-				// interpreter, where actors would sometimes
-				// still be drawn in color.
-				setDirtyColors(0, 255);
-			} else
-				error("stub o6_kernelSetFunctions_114()");
-			break;
-		case 117:
-			// Sam & Max uses this opcode in script-43, right
-			// before a screensaver is selected.
+
+void ScummEngine_v6::o6_kernelSetFunctions() {
+	int args[30];
+	int num;
+	Actor *a;
+
+	num = getStackList(args, ARRAYSIZE(args));
+
+	switch (args[0]) {
+	case 3:
+		// Dummy case
+		break;
+	case 4:
+		grabCursor(args[1], args[2], args[3], args[4]);
+		break;
+	case 5:
+		fadeOut(args[1]);
+		break;
+	case 6:
+		_fullRedraw = true;
+		redrawBGAreas();
+		setActorRedrawFlags();
+		processActors();
+		fadeIn(args[1]);
+		break;
+	case 8:
+		startManiac();
+		break;
+	case 9:
+		killAllScriptsExceptCurrent();
+		break;
+	case 104:									/* samnmax */
+		nukeFlObjects(args[2], args[3]);
+		break;
+	case 107:									/* set actor scale */
+		a = derefActor(args[1], "o6_kernelSetFunctions: 107");
+		a->setScale((unsigned char)args[2], -1);
+		break;
+	case 108:									/* create proc_special_palette */
+	case 109:
+		// Case 108 and 109 share the same function
+		if (num != 6)
+			error("o6_kernelSetFunctions sub op %d: expected 6 params but got %d", args[0], num);
+		setShadowPalette(args[3], args[4], args[5], args[1], args[2], 0, 256);
+		break;
+	case 110:
+		_charset->clearCharsetMask();
+		break;
+	case 111:
+		a = derefActor(args[1], "o6_kernelSetFunctions: 111");
+		a->_shadowMode = args[2] + args[3];
+		break;
+	case 112:									/* palette shift? */
+		setShadowPalette(args[3], args[4], args[5], args[1], args[2], args[6], args[7]);
+		break;
+	case 114:
+		// Sam & Max film noir mode
+		if (_game.id == GID_SAMNMAX) {
+			// At this point ScummVM will already have set
+			// variable 0x8000 to indicate that the game is
+			// in film noir mode. All we have to do here is
+			// to mark the palette as "dirty", because
+			// updatePalette() will desaturate the colors
+			// as they are uploaded to the backend.
 			//
-			// Sam & Max uses variable 132 to specify the number of
-			// minutes of inactivity (no mouse movements) before
-			// starting the screensaver, so setting it to 0 will
-			// help in debugging.
-			freezeScripts(0x80);
-			break;
-		case 119:
-			enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0);
-			break;
-		case 120:
-			swapPalColors(args[1], args[2]);
-			break;
-		case 122:
-			VAR(VAR_SOUNDRESULT) =
-				(short)_imuse->doCommand (num - 1, &args[1]);
-			break;
-		case 123:
-			copyPalColor(args[2], args[1]);
-			break;
-		case 124:
-			_saveSound = args[1];
-			break;
-		default:
-			error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
-			break;
-		}
+			// This actually works better than the original
+			// interpreter, where actors would sometimes
+			// still be drawn in color.
+			setDirtyColors(0, 255);
+		} else
+			error("stub o6_kernelSetFunctions_114()");
+		break;
+	case 117:
+		// Sam & Max uses this opcode in script-43, right
+		// before a screensaver is selected.
+		//
+		// Sam & Max uses variable 132 to specify the number of
+		// minutes of inactivity (no mouse movements) before
+		// starting the screensaver, so setting it to 0 will
+		// help in debugging.
+		freezeScripts(0x80);
+		break;
+	case 119:
+		enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0);
+		break;
+	case 120:
+		swapPalColors(args[1], args[2]);
+		break;
+	case 122:
+		VAR(VAR_SOUNDRESULT) =
+			(short)_imuse->doCommand (num - 1, &args[1]);
+		break;
+	case 123:
+		copyPalColor(args[2], args[1]);
+		break;
+	case 124:
+		_saveSound = args[1];
+		break;
+	default:
+		error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
+		break;
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list