aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-08 15:39:19 +0000
committerFilippos Karapetis2009-03-08 15:39:19 +0000
commit9d7111006dcdbbe0465b95d5c5adb2c5affe790c (patch)
tree7eea3dfdc642ab314831794c3eee635ae11a0259 /engines/saga
parent468f9c43b7e0fee68edc796213639648877a738f (diff)
downloadscummvm-rg350-9d7111006dcdbbe0465b95d5c5adb2c5affe790c.tar.gz
scummvm-rg350-9d7111006dcdbbe0465b95d5c5adb2c5affe790c.tar.bz2
scummvm-rg350-9d7111006dcdbbe0465b95d5c5adb2c5affe790c.zip
- Reworked the different file types a bit
- Some initial work on Dinotopia's intro sequence svn-id: r39234
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/detection_tables.h33
-rw-r--r--engines/saga/interface.cpp30
-rw-r--r--engines/saga/introproc_saga2.cpp (renamed from engines/saga/introproc_fta2.cpp)25
-rw-r--r--engines/saga/module.mk2
-rw-r--r--engines/saga/music.cpp2
-rw-r--r--engines/saga/resource.cpp13
-rw-r--r--engines/saga/saga.cpp6
-rw-r--r--engines/saga/saga.h28
-rw-r--r--engines/saga/scene.cpp2
-rw-r--r--engines/saga/scene.h1
10 files changed, 112 insertions, 30 deletions
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index d52ab34ff0..aa2a2871dd 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -784,8 +784,31 @@ static const SAGAGameDescription gameDescriptions[] = {
#ifdef ENABLE_SAGA2
// Dinotopia Section //////////////////////////////////////////////////////////////////////////////////////
-
- // TODO
+ {
+ {
+ "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,
+ },
// Faery Tale Adventure II: Halls of the Dead Section /////////////////////////////////////////////////////
@@ -795,11 +818,11 @@ static const SAGAGameDescription gameDescriptions[] = {
"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,
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 7a08a0e6c9..ded7faa260 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -120,17 +120,42 @@ static const int IHNMTextStringIdsLUT[56] = {
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 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_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];
diff --git a/engines/saga/introproc_fta2.cpp b/engines/saga/introproc_saga2.cpp
index f8c61a8568..99e0c2cddd 100644
--- a/engines/saga/introproc_fta2.cpp
+++ b/engines/saga/introproc_saga2.cpp
@@ -25,7 +25,7 @@
#ifdef ENABLE_SAGA2
-// "Faery Tale Adventure II: Halls of the Dead" Intro sequence scene procedures
+// "Dinotopia" and "Faery Tale Adventure II: Halls of the Dead" Intro sequence scene procedures
#include "saga/saga.h"
#include "saga/scene.h"
@@ -43,6 +43,29 @@ 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);
diff --git a/engines/saga/module.mk b/engines/saga/module.mk
index 0c9c219621..c1c29d2a79 100644
--- a/engines/saga/module.mk
+++ b/engines/saga/module.mk
@@ -43,7 +43,7 @@ endif
ifdef ENABLE_SAGA2
MODULE_OBJS += \
- introproc_fta2.o \
+ introproc_saga2.o \
resource_hrs.o
endif
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 09d7f8fd2e..27566de2c3 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -351,7 +351,7 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : _vm(vm),
xmidiParser = MidiParser::createParser_XMIDI();
smfParser = MidiParser::createParser_SMF();
- _digitalMusicContext = _vm->_resource->getContext(GAME_MUSICFILE);
+ _digitalMusicContext = _vm->_resource->getContext(GAME_DIGITALMUSICFILE);
_songTableLen = 0;
_songTable = 0;
diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp
index 981238d3a3..6ab4fc878e 100644
--- a/engines/saga/resource.cpp
+++ b/engines/saga/resource.cpp
@@ -251,6 +251,10 @@ bool Resource::createContexts() {
SoundFileInfo sfxFilesFTA2[] = {
{ "ftasound.hrs", false }
};
+
+ SoundFileInfo sfxFilesDino[] = {
+ { "dinosnd.hrs", false },
+ };
#endif
if (!soundFileInArray) {
@@ -270,9 +274,8 @@ bool Resource::createContexts() {
#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 @@ bool Resource::createContexts() {
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 @@ bool Resource::createContexts() {
// 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;
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 1fede4b662..4acf93d030 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -107,6 +107,12 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
// 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");
}
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index f37e4a59f4..946ce69995 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -99,18 +99,22 @@ enum GameIds {
};
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 {
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index b5b9aaa2ea..86500467d0 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -297,7 +297,7 @@ void Scene::startScene() {
#endif
#ifdef ENABLE_SAGA2
case GID_DINO:
- // TODO
+ DinoStartProc();
break;
case GID_FTA2:
FTA2StartProc();
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 169af0bb0c..90be245437 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -422,6 +422,7 @@ class Scene {
int ITEStartProc();
int IHNMStartProc();
int IHNMCreditsProc();
+ int DinoStartProc();
int FTA2StartProc();
int FTA2EndProc(FTA2Endings whichEnding);