[Scummvm-cvs-logs] SF.net SVN: scummvm: [24385] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Oct 19 07:21:13 CEST 2006


Revision: 24385
          http://svn.sourceforge.net/scummvm/?rev=24385&view=rev
Author:   kirben
Date:     2006-10-18 22:21:07 -0700 (Wed, 18 Oct 2006)

Log Message:
-----------
Add support for arrows keys in WW

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/script.cpp

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2006-10-19 00:26:55 UTC (rev 24384)
+++ scummvm/trunk/engines/agos/agos.cpp	2006-10-19 05:21:07 UTC (rev 24385)
@@ -34,6 +34,7 @@
 #include "agos/vga.h"
 
 #include "sound/mididrv.h"
+#include "sound/mod.h"
 
 #ifdef PALMOS_68K
 #include "globals.h"
@@ -1352,13 +1353,9 @@
 		for (;;) {
 			if (getGameType() != GType_FF && getGameType() != GType_PP && _keyPressed == 35)
 				displayBoxStars();
-			if (getGameType() == GType_PP) {
-				if (processSpecialKeys() != 0) {
-					_needHitAreaRecalc++;
-					return;
-				}
-			} else {
-				processSpecialKeys();
+			if (processSpecialKeys() != 0) {
+				_needHitAreaRecalc++;
+				return;
 			}
 			if (_lastHitArea3 == (HitArea *) -1)
 				goto startOver;
@@ -2075,18 +2072,26 @@
 	case 17: // Up
 		if (getGameType() == GType_PP)
 			_verbHitArea = 302;
+		else if (getGameType() == GType_WW)
+			_verbHitArea = 239;
 		break;
 	case 18: // Down
 		if (getGameType() == GType_PP)
 			_verbHitArea = 304;
+		else if (getGameType() == GType_WW)
+			_verbHitArea = 241;
 		break;
 	case 19: // Right
 		if (getGameType() == GType_PP)
 			_verbHitArea = 303;
+		else if (getGameType() == GType_WW)
+			_verbHitArea = 240;
 		break;
 	case 20: // Left
 		if (getGameType() == GType_PP)
 			_verbHitArea = 301;
+		else if (getGameType() == GType_WW)
+			_verbHitArea = 242;
 		break;
 	case 27: // escape
 		_exitCutscene = true;
@@ -2430,18 +2435,40 @@
 	if (getPlatform() == Common::kPlatformAtariST) {
 		// TODO: Add support for music format used by Elvira 2
 	} else if (getPlatform() == Common::kPlatformAmiga) {
-		// TODO: Add Protracker mod support for Amiga versions
+		Audio::AudioStream *modStream;
 		char filename[15];
+		File f;
 
 		if (getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO)
 			sprintf(filename, "elvira2");
 		else
 			sprintf(filename, "%dtune", music);
 
-		if (getFeatures() & GF_CRUNCHED) {
-			debug(5,"loadMusic - Decrunch %s attempt", filename);
+		f.open(filename);
+		if (f.isOpen() == false) {
+			error("loadMusic: Can't load music from '%s'", filename);
 		}
-		debug(5,"playMusic - Play %s attempt", filename);
+
+		if (!(getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) &&
+			getFeatures() & GF_CRUNCHED) {
+			uint srcSize = f.size();
+			byte *srcBuf = (byte *)malloc(srcSize);
+			if (f.read(srcBuf, srcSize) != srcSize)
+				error("loadMusic: Read failed");
+
+			uint dstSize = READ_BE_UINT32(srcBuf + srcSize - 4);
+			byte *dstBuf = (byte *)malloc(dstSize);
+			decrunchFile(srcBuf, dstBuf, srcSize);
+			free(srcBuf);
+
+			Common::MemoryReadStream stream(dstBuf, dstSize);
+			modStream = Audio::makeMODStream(&stream);
+		} else {
+			modStream = Audio::makeMODStream(&f);
+ 		}
+
+		_mixer->stopAll();
+		_mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, modStream);
 	} else if (getGameType() == GType_SIMON2) {
 		midi.stop();
 		_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2006-10-19 00:26:55 UTC (rev 24384)
+++ scummvm/trunk/engines/agos/agos.h	2006-10-19 05:21:07 UTC (rev 24385)
@@ -1098,7 +1098,7 @@
 	void oe1_moveDirn();
 	void oe1_score();
 	void oe1_doClass();
-	void oe1_pobj();
+	void oe1_pObj();
 	void oe1_pName();
 	void oe1_pcName();
 	void oe1_cFlag();

Modified: scummvm/trunk/engines/agos/script.cpp
===================================================================
--- scummvm/trunk/engines/agos/script.cpp	2006-10-19 00:26:55 UTC (rev 24384)
+++ scummvm/trunk/engines/agos/script.cpp	2006-10-19 05:21:07 UTC (rev 24385)
@@ -250,6 +250,8 @@
 	op[105] = &AGOSEngine::o_process;
 	op[106] = &AGOSEngine::oe1_doClass;
 
+	op[112] = &AGOSEngine::oe1_pObj;
+
 	op[114] = &AGOSEngine::oe1_pName;
 	op[115] = &AGOSEngine::oe1_pcName;
 
@@ -355,7 +357,7 @@
 	op[35] = &AGOSEngine::oe1_copyfo;
 	op[37] = &AGOSEngine::oe1_whatO;
 	op[54] = &AGOSEngine::oe2_moveDirn;
-	op[73] = &AGOSEngine::oe1_pobj;
+	op[73] = &AGOSEngine::oe1_pObj;
 	op[74] = &AGOSEngine::oe1_pName;
 	op[75] = &AGOSEngine::oe1_pcName;
 	op[83] = &AGOSEngine::o1_rescan;
@@ -419,7 +421,7 @@
 	op[54] = &AGOSEngine::oww_moveDirn;
 	op[55] = &AGOSEngine::oww_goto;
 	op[70] = &AGOSEngine::o1_printLongText;
-	op[73] = &AGOSEngine::oe1_pobj;
+	op[73] = &AGOSEngine::oe1_pObj;
 	op[74] = &AGOSEngine::oe1_pName;
 	op[75] = &AGOSEngine::oe1_pcName;
 	op[83] = &AGOSEngine::o1_rescan;
@@ -1938,7 +1940,7 @@
 	}
 }
 
-void AGOSEngine::oe1_pobj() {
+void AGOSEngine::oe1_pObj() {
 	// 112: print object
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2);
 	getVarOrWord();


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