[Scummvm-cvs-logs] SF.net SVN: scummvm:[39234] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Mar 8 16:39:19 CET 2009


Revision: 39234
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39234&view=rev
Author:   thebluegr
Date:     2009-03-08 15:39:19 +0000 (Sun, 08 Mar 2009)

Log Message:
-----------
- Reworked the different file types a bit
- Some initial work on Dinotopia's intro sequence

Modified Paths:
--------------
    scummvm/trunk/engines/saga/detection_tables.h
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/module.mk
    scummvm/trunk/engines/saga/music.cpp
    scummvm/trunk/engines/saga/resource.cpp
    scummvm/trunk/engines/saga/saga.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/scene.h

Added Paths:
-----------
    scummvm/trunk/engines/saga/introproc_saga2.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/saga/introproc_fta2.cpp

Modified: scummvm/trunk/engines/saga/detection_tables.h
===================================================================
--- scummvm/trunk/engines/saga/detection_tables.h	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/detection_tables.h	2009-03-08 15:39:19 UTC (rev 39234)
@@ -784,9 +784,32 @@
 #ifdef ENABLE_SAGA2
 
 	// Dinotopia Section //////////////////////////////////////////////////////////////////////////////////////
+	{
+		{
+			"dino",
+			"",
+			{
+	{"dino.hrs",     GAME_RESOURCEFILE,					"7cf3665887a4a18e2fff6938a954c050", 66018},
+	{"scripts.hrs",	 GAME_SCRIPTFILE,					"d405841a249a365cf92fc65dd52fb953", 164181},
+	{"dinosnd.hrs",  GAME_SOUNDFILE | GAME_VOICEFILE,	"dcf4ade416614b8a64f99dacfd3bd071", 199163997},
+	{"dinoimag.hrs", GAME_IMAGEFILE,					"d24d80676f7afcfaca0b61c95056044f", 42342931},
+	// TODO: dinodata.hrs
+	{ NULL, 0, NULL, 0}
+			},
+			Common::EN_ANY,
+			Common::kPlatformPC,
+			ADGF_NO_FLAGS
+		},
+		GID_DINO,
+		0,
+		// TODO: fill out the data below
+		-1,		// default scene
+		NULL,	// game resources
+		0,		// number of fonts
+		NULL,	// font array
+		NULL,
+	},
 
-	// TODO
-
 	// Faery Tale Adventure II: Halls of the Dead Section /////////////////////////////////////////////////////
 
 	// Faery Tale Adventure II: Halls of the Dead - English CD version
@@ -795,11 +818,11 @@
 			"fta2",
 			"",
 			{
-	// TODO: this is still quite incomplete
-	{"fta.hrs",	GAME_RESOURCEFILE,						"c34a5ee5f1a14a87712a35c4a209a033", 213376},
-	{"scripts.hrs",	GAME_SCRIPTFILE,					"95f33928f6c4f02ee04d2ec5c3314c30", 1041948},
+	{"fta.hrs",	     GAME_RESOURCEFILE,					"c34a5ee5f1a14a87712a35c4a209a033", 213376},
+	{"scripts.hrs",	 GAME_SCRIPTFILE,					"95f33928f6c4f02ee04d2ec5c3314c30", 1041948},
 	{"ftasound.hrs", GAME_SOUNDFILE,					"ce930cb38922e6a03461f55d51b4e165", 12403350},
 	{"ftaimage.hrs", GAME_IMAGEFILE,					"09bb003733b20f924e2e373d2ddcd394", 21127397},
+	// TODO: ftadata.hrs
 	{ NULL, 0, NULL, 0}
 			},
 			Common::EN_ANY,

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/interface.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -120,17 +120,42 @@
 	31	// Both
 };
 
+#define buttonRes0 0x42544E00
+#define buttonRes1 0x42544E01
+
 Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	byte *resource;
 	size_t resourceLength;
 	int i;
 
+#if 0
+	// FTA2 related test code
+
+	// TODO: this will probably have to be moved to a new class
+	// It's left here for now till the code differences are figured out
+	if (_vm->getGameId() == GID_FTA2) {
+		_interfaceContext = _vm->_resource->getContext(GAME_IMAGEFILE);
+		_vm->_resource->loadResource(_interfaceContext, 22, resource, resourceLength);	// Julian's portrait
+
+		_vm->decodeBGImage(resource, resourceLength, &_mainPanel.image,
+			&_mainPanel.imageLength, &_mainPanel.imageWidth, &_mainPanel.imageHeight);
+
+		free(resource);
+		return;
+	}
+#endif
+
 	// Load interface module resource file context
 	_interfaceContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
 	if (_interfaceContext == NULL) {
 		error("Interface::Interface() resource context not found");
 	}
 
+	// Do nothing for SAGA2 games for now
+	if (_vm->isSaga2()) {
+		return;
+	}
+
 	// Main panel
 	_mainPanel.buttons = _vm->getDisplayInfo().mainPanelButtons;
 	_mainPanel.buttonsCount = _vm->getDisplayInfo().mainPanelButtonsCount;
@@ -139,11 +164,6 @@
 		_verbTypeToPanelButton[i] = NULL;
 	}
 
-	// Do nothing for SAGA2 games for now
-	if (_vm->isSaga2()) {
-		return;
-	}
-
 	for (i = 0; i < _mainPanel.buttonsCount; i++) {
 		if (_mainPanel.buttons[i].type == kPanelButtonVerb) {
 			_verbTypeToPanelButton[_mainPanel.buttons[i].id] = &_mainPanel.buttons[i];

Deleted: scummvm/trunk/engines/saga/introproc_fta2.cpp
===================================================================
--- scummvm/trunk/engines/saga/introproc_fta2.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/introproc_fta2.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -1,119 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifdef ENABLE_SAGA2
-
-// "Faery Tale Adventure II: Halls of the Dead" Intro sequence scene procedures
-
-#include "saga/saga.h"
-#include "saga/scene.h"
-#include "saga/gfx.h"
-
-#include "sound/mixer.h"
-#include "graphics/surface.h"
-#include "graphics/video/smk_player.h"
-
-#include "common/events.h"
-#include "common/system.h"
-#include "common/list.h"
-
-namespace Saga {
-
-Common::List<Common::Event> stopEvents;
-
-int Scene::FTA2StartProc() {
-	_vm->_gfx->showCursor(false);
-
-	Common::Event stopEvent;
-	stopEvents.clear();
-	stopEvent.type = Common::EVENT_KEYDOWN;
-	stopEvent.kbd = Common::KEYCODE_ESCAPE;
-	stopEvents.push_back(stopEvent);
-
-	Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer);
-	Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder);
-	if (smkDecoder->loadFile("trimark.smk"))
-		player->playVideo(&stopEvents);      // Show Ignite logo
-	smkDecoder->closeFile();
-	if (smkDecoder->loadFile("intro.smk"))
-		player->playVideo(&stopEvents);        // Play introduction
-	smkDecoder->closeFile();
-	delete player;
-	delete smkDecoder;
-
-	// HACK: Forcibly quit here
-	_vm->quitGame();
-
-	return SUCCESS;
-}
-
-int Scene::FTA2EndProc(FTA2Endings whichEnding) {
-	char videoName[20];
-
-	switch (whichEnding) {
-	case kFta2BadEndingLaw:
-		strcpy(videoName, "end_1.smk");
-		break;
-	case kFta2BadEndingChaos:
-		strcpy(videoName, "end_2.smk");
-		break;
-	case kFta2GoodEnding1:
-		strcpy(videoName, "end_3a.smk");
-		break;
-	case kFta2GoodEnding2:
-		strcpy(videoName, "end_3b.smk");
-		break;
-	case kFta2BadEndingDeath:
-		strcpy(videoName, "end_4.smk");
-		break;
-	default:
-		error("Unknown FTA2 ending");
-	}
-
-	_vm->_gfx->showCursor(false);
-
-
-	Common::Event stopEvent;
-	stopEvents.clear();
-	stopEvent.type = Common::EVENT_KEYDOWN;
-	stopEvent.kbd = Common::KEYCODE_ESCAPE;
-	stopEvents.push_back(stopEvent);
-
-	// Play ending
-	Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer);
-	Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder);
-	if (smkDecoder->loadFile(videoName)) {
-		player->playVideo(&stopEvents);
-		smkDecoder->closeFile();
-	}
-	delete player;
-	delete smkDecoder;
-
-	return SUCCESS;
-}
-
-} // End of namespace Saga
-
-#endif

Copied: scummvm/trunk/engines/saga/introproc_saga2.cpp (from rev 39232, scummvm/trunk/engines/saga/introproc_fta2.cpp)
===================================================================
--- scummvm/trunk/engines/saga/introproc_saga2.cpp	                        (rev 0)
+++ scummvm/trunk/engines/saga/introproc_saga2.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -0,0 +1,142 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifdef ENABLE_SAGA2
+
+// "Dinotopia" and "Faery Tale Adventure II: Halls of the Dead" Intro sequence scene procedures
+
+#include "saga/saga.h"
+#include "saga/scene.h"
+#include "saga/gfx.h"
+
+#include "sound/mixer.h"
+#include "graphics/surface.h"
+#include "graphics/video/smk_player.h"
+
+#include "common/events.h"
+#include "common/system.h"
+#include "common/list.h"
+
+namespace Saga {
+
+Common::List<Common::Event> stopEvents;
+
+int Scene::DinoStartProc() {
+	_vm->_gfx->showCursor(false);
+
+	Common::Event stopEvent;
+	stopEvents.clear();
+	stopEvent.type = Common::EVENT_KEYDOWN;
+	stopEvent.kbd = Common::KEYCODE_ESCAPE;
+	stopEvents.push_back(stopEvent);
+
+	Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer);
+	Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder);
+	if (smkDecoder->loadFile("testvid.smk"))
+		player->playVideo(&stopEvents);        // Play introduction
+	smkDecoder->closeFile();
+	delete player;
+	delete smkDecoder;
+
+	// HACK: Forcibly quit here
+	_vm->quitGame();
+
+	return SUCCESS;
+}
+
+int Scene::FTA2StartProc() {
+	_vm->_gfx->showCursor(false);
+
+	Common::Event stopEvent;
+	stopEvents.clear();
+	stopEvent.type = Common::EVENT_KEYDOWN;
+	stopEvent.kbd = Common::KEYCODE_ESCAPE;
+	stopEvents.push_back(stopEvent);
+
+	Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer);
+	Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder);
+	if (smkDecoder->loadFile("trimark.smk"))
+		player->playVideo(&stopEvents);      // Show Ignite logo
+	smkDecoder->closeFile();
+	if (smkDecoder->loadFile("intro.smk"))
+		player->playVideo(&stopEvents);        // Play introduction
+	smkDecoder->closeFile();
+	delete player;
+	delete smkDecoder;
+
+	// HACK: Forcibly quit here
+	_vm->quitGame();
+
+	return SUCCESS;
+}
+
+int Scene::FTA2EndProc(FTA2Endings whichEnding) {
+	char videoName[20];
+
+	switch (whichEnding) {
+	case kFta2BadEndingLaw:
+		strcpy(videoName, "end_1.smk");
+		break;
+	case kFta2BadEndingChaos:
+		strcpy(videoName, "end_2.smk");
+		break;
+	case kFta2GoodEnding1:
+		strcpy(videoName, "end_3a.smk");
+		break;
+	case kFta2GoodEnding2:
+		strcpy(videoName, "end_3b.smk");
+		break;
+	case kFta2BadEndingDeath:
+		strcpy(videoName, "end_4.smk");
+		break;
+	default:
+		error("Unknown FTA2 ending");
+	}
+
+	_vm->_gfx->showCursor(false);
+
+
+	Common::Event stopEvent;
+	stopEvents.clear();
+	stopEvent.type = Common::EVENT_KEYDOWN;
+	stopEvent.kbd = Common::KEYCODE_ESCAPE;
+	stopEvents.push_back(stopEvent);
+
+	// Play ending
+	Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer);
+	Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder);
+	if (smkDecoder->loadFile(videoName)) {
+		player->playVideo(&stopEvents);
+		smkDecoder->closeFile();
+	}
+	delete player;
+	delete smkDecoder;
+
+	return SUCCESS;
+}
+
+} // End of namespace Saga
+
+#endif

Modified: scummvm/trunk/engines/saga/module.mk
===================================================================
--- scummvm/trunk/engines/saga/module.mk	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/module.mk	2009-03-08 15:39:19 UTC (rev 39234)
@@ -43,7 +43,7 @@
 
 ifdef ENABLE_SAGA2
 MODULE_OBJS += \
-	introproc_fta2.o \
+	introproc_saga2.o \
 	resource_hrs.o
 endif
 

Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/music.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -351,7 +351,7 @@
 	xmidiParser = MidiParser::createParser_XMIDI();
 	smfParser = MidiParser::createParser_SMF();
 
-	_digitalMusicContext = _vm->_resource->getContext(GAME_MUSICFILE);
+	_digitalMusicContext = _vm->_resource->getContext(GAME_DIGITALMUSICFILE);
 
 	_songTableLen = 0;
 	_songTable = 0;

Modified: scummvm/trunk/engines/saga/resource.cpp
===================================================================
--- scummvm/trunk/engines/saga/resource.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/resource.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -251,6 +251,10 @@
 	SoundFileInfo sfxFilesFTA2[] = {
 		{	"ftasound.hrs",		false	}
 	};
+
+	SoundFileInfo sfxFilesDino[] = {
+		{	"dinosnd.hrs",		false	},
+	};
 #endif
 
 	if (!soundFileInArray) {
@@ -270,9 +274,8 @@
 #endif
 #ifdef ENABLE_SAGA2
 			case GID_DINO:
-				// TODO
-				curSoundfiles = NULL;
-				maxFile = 0;
+				curSoundfiles = sfxFilesDino;
+				maxFile = 1;
 				break;
 			case GID_FTA2:
 				curSoundfiles = sfxFilesFTA2;
@@ -343,11 +346,13 @@
 			break;
 #endif
 #ifdef ENABLE_SAGA2
+		/*
 		case GID_DINO:
 			// TODO
 			curSoundfiles = NULL;
 			maxFile = 0;
 			break;
+		*/
 		case GID_FTA2:
 			curSoundfiles = voiceFilesFTA2;
 			maxFile = 1;
@@ -447,7 +452,7 @@
 		// For ITE, add the digital music file and sfx file information here
 		if (_vm->getGameId() == GID_ITE && digitalMusic && i == _contextsCount - 1) {
 			context->fileName = musicFileName;
-			context->fileType = GAME_MUSICFILE;
+			context->fileType = GAME_DIGITALMUSICFILE;
 			context->isCompressed = compressedMusic;
 		} else if (!soundFileInArray && i == soundFileIndex) {
 			context->fileName = soundFileName;

Modified: scummvm/trunk/engines/saga/saga.cpp
===================================================================
--- scummvm/trunk/engines/saga/saga.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/saga.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -107,6 +107,12 @@
 	// Mac CD Wyrmkeep
 	Common::File::addDefaultDirectory(_gameDataDir.getChild("patch"));
 
+	// Dinotopia
+	Common::File::addDefaultDirectory(_gameDataDir.getChild("smack"));
+
+	// FTA2
+	Common::File::addDefaultDirectory(_gameDataDir.getChild("video"));
+
 	_displayClip.left = _displayClip.top = 0;
 	syst->getEventManager()->registerRandomSource(_rnd, "saga");
 }

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/saga.h	2009-03-08 15:39:19 UTC (rev 39234)
@@ -99,18 +99,22 @@
 };
 
 enum GameFileTypes {
-	GAME_IMAGEFILE    = 1 << 0,
-	GAME_RESOURCEFILE = 1 << 1,
-	GAME_SCRIPTFILE   = 1 << 2,
-	GAME_SOUNDFILE    = 1 << 3,
-	GAME_VOICEFILE    = 1 << 4,
-	GAME_DEMOFILE     = 1 << 5,
-	GAME_MUSICFILE    = 1 << 6,
-	GAME_MUSICFILE_GM = 1 << 7,
-	GAME_MUSICFILE_FM = 1 << 8,
-	GAME_PATCHFILE    = 1 << 9,
-	GAME_MACBINARY    = 1 << 10,
-	GAME_SWAPENDIAN   = 1 << 11
+	// Common
+	GAME_RESOURCEFILE     = 1 << 0,    // Game resources
+	GAME_SCRIPTFILE       = 1 << 1,    // Game scripts
+	GAME_SOUNDFILE        = 1 << 2,    // SFX (also contains voices and MIDI music in SAGA 2 games)
+	GAME_VOICEFILE        = 1 << 3,    // Voices (also contains SFX in the ITE floppy version)
+	// ITE specific
+	GAME_DIGITALMUSICFILE = 1 << 4,    // ITE digital music, added by Wyrmkeep 
+	GAME_MACBINARY        = 1 << 5,    // ITE Mac CD Guild
+	GAME_DEMOFILE         = 1 << 6,    // Early ITE demo
+	GAME_SWAPENDIAN       = 1 << 7,    // Used to identify the BE voice file in the ITE combined version
+	// IHNM specific
+	GAME_MUSICFILE_FM     = 1 << 8,    // IHNM
+	GAME_MUSICFILE_GM     = 1 << 9,    // IHNM, ITE Mac CD Guild
+	GAME_PATCHFILE        = 1 << 10,   // IHNM patch file (patch.re_/patch.res)
+	// SAGA 2 (Dinotopia, FTA2)
+	GAME_IMAGEFILE        = 1 << 11
 };
 
 enum GameFeatures {

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/scene.cpp	2009-03-08 15:39:19 UTC (rev 39234)
@@ -297,7 +297,7 @@
 #endif
 #ifdef ENABLE_SAGA2
 	case GID_DINO:
-		// TODO
+		DinoStartProc();
 		break;
 	case GID_FTA2:
 		FTA2StartProc();

Modified: scummvm/trunk/engines/saga/scene.h
===================================================================
--- scummvm/trunk/engines/saga/scene.h	2009-03-08 14:39:04 UTC (rev 39233)
+++ scummvm/trunk/engines/saga/scene.h	2009-03-08 15:39:19 UTC (rev 39234)
@@ -422,6 +422,7 @@
 	int ITEStartProc();
 	int IHNMStartProc();
 	int IHNMCreditsProc();
+	int DinoStartProc();
 	int FTA2StartProc();
 	int FTA2EndProc(FTA2Endings whichEnding);
 


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