diff options
author | Filippos Karapetis | 2015-07-04 01:15:19 +0300 |
---|---|---|
committer | Filippos Karapetis | 2015-07-04 01:51:45 +0300 |
commit | a95d22a2cdd5bcc5c2483422be3194d1050e0fa4 (patch) | |
tree | 78dae1b22cbc039f1637596d025b7bc77f59902e | |
parent | 5311191687b678fda4a3379f5b79bc735329f35b (diff) | |
download | scummvm-rg350-a95d22a2cdd5bcc5c2483422be3194d1050e0fa4.tar.gz scummvm-rg350-a95d22a2cdd5bcc5c2483422be3194d1050e0fa4.tar.bz2 scummvm-rg350-a95d22a2cdd5bcc5c2483422be3194d1050e0fa4.zip |
SAGA: Initial work on the DOS ITE demo
-rw-r--r-- | engines/saga/detection_tables.h | 6 | ||||
-rw-r--r-- | engines/saga/introproc_ite.cpp | 70 | ||||
-rw-r--r-- | engines/saga/music.cpp | 6 | ||||
-rw-r--r-- | engines/saga/saga.h | 4 | ||||
-rw-r--r-- | engines/saga/scene.h | 2 | ||||
-rw-r--r-- | engines/saga/script.cpp | 6 |
6 files changed, 74 insertions, 20 deletions
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index 2f72e7a13c..e541f3a031 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -192,9 +192,9 @@ static const SAGAGameDescription gameDescriptions[] = { ADGF_DEMO, GUIO1(GUIO_NOSPEECH) }, - GID_ITE, // Game id - GF_OLD_ITE_DOS, // features - ITE_DEFAULT_SCENE, // Starting scene number + GID_ITE, + GF_ITE_DOS_DEMO, + ITE_DEFAULT_SCENE, &ITEDemo_Resources, ARRAYSIZE(ITEDEMO_GameFonts), ITEDEMO_GameFonts, diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp index 0b129dbcc0..3c10cbe1dd 100644 --- a/engines/saga/introproc_ite.cpp +++ b/engines/saga/introproc_ite.cpp @@ -59,6 +59,11 @@ namespace Saga { #define RID_ITE_FAIREPATH_SCENE 1564 #define RID_ITE_FAIRETENT_SCENE 1567 +// Intro scenes - DOS demo +#define RID_ITE_INTRO_ANIM_SCENE_DOS_DEMO 298 +#define RID_ITE_CAVE_SCENE_DOS_DEMO 302 +#define RID_ITE_VALLEY_SCENE_DOS_DEMO 310 + // ITE intro music #define MUSIC_INTRO 9 #define MUSIC_TITLE_THEME 10 @@ -75,22 +80,24 @@ LoadSceneParams ITE_IntroList[] = { {RID_ITE_FAIRETENT_SCENE, kLoadByResourceId, Scene::SC_ITEIntroFaireTentProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE} }; -int Scene::ITEStartProc() { - size_t scenesCount; - size_t i; +LoadSceneParams ITE_DOS_Demo_IntroList[] = { + {RID_ITE_INTRO_ANIM_SCENE_DOS_DEMO, kLoadByResourceId, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, + {RID_ITE_CAVE_SCENE_DOS_DEMO, kLoadByResourceId, Scene::SC_ITEIntroCaveDemoProc, false, kTransitionFade, 0, NO_CHAPTER_CHANGE}, + {RID_ITE_VALLEY_SCENE_DOS_DEMO, kLoadByResourceId, Scene::SC_ITEIntroValleyProc, false, kTransitionFade, 0, NO_CHAPTER_CHANGE}, +}; +int Scene::ITEStartProc() { LoadSceneParams firstScene; LoadSceneParams tempScene; + bool dosDemo = (_vm->getFeatures() & GF_ITE_DOS_DEMO); + int scenesCount = (!dosDemo) ? ARRAYSIZE(ITE_IntroList) : ARRAYSIZE(ITE_DOS_Demo_IntroList); - scenesCount = ARRAYSIZE(ITE_IntroList); - - for (i = 0; i < scenesCount; i++) { - tempScene = ITE_IntroList[i]; + for (int i = 0; i < scenesCount; i++) { + tempScene = (!dosDemo) ? ITE_IntroList[i] : ITE_DOS_Demo_IntroList[i]; tempScene.sceneDescriptor = _vm->_resource->convertResourceId(tempScene.sceneDescriptor); _vm->_scene->queueScene(tempScene); } - firstScene.loadFlag = kLoadBySceneNumber; firstScene.sceneDescriptor = _vm->getStartSceneNumber(); firstScene.sceneSkipTarget = true; @@ -437,6 +444,53 @@ int Scene::ITEIntroCaveCommonProc(int param, int caveScene) { return 0; } +int Scene::ITEIntroCaveDemoProc(int param) { + Event event; + EventColumns *eventColumns = NULL; + + switch (param) { + case SCENE_BEGIN: + // Begin palette cycling animation for candles + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; + event.time = 0; + eventColumns = _vm->_events->chain(eventColumns, event); + + // Queue narrator dialogue list + for (int i = 0; i < 11; i++) { + // Play voice + event.type = kEvTOneshot; + event.code = kVoiceEvent; + event.op = kEventPlay; + event.param = i; + event.time = _vm->_sndRes->getVoiceLength(i); + _vm->_events->chain(eventColumns, event); + } + + // End scene after last dialogue over + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; + event.time = INTRO_VOICE_PAD; + _vm->_events->chain(eventColumns, event); + + break; + case SCENE_END: + break; + + default: + warning("Illegal scene procedure parameter"); + break; + } + + return 0; +} + +int Scene::SC_ITEIntroCaveDemoProc(int param, void *refCon) { + return ((Scene *)refCon)->ITEIntroCaveDemoProc(param); +} + // Handles first introductory cave painting scene int Scene::SC_ITEIntroCave1Proc(int param, void *refCon) { return ((Scene *)refCon)->ITEIntroCaveCommonProc(param, 1); diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 71d061a0a0..5bff06d06c 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -273,7 +273,11 @@ void Music::play(uint32 resourceId, MusicFlags flags) { debug(2, "Music::play %d, %d", resourceId, flags); - if (isPlaying() && _trackNumber == resourceId) { + if (isPlaying() && _trackNumber == resourceId) + return; + + if (_vm->getFeatures() & GF_ITE_DOS_DEMO) { + warning("TODO: Music::play %d, %d for ITE DOS demo", resourceId, flags); return; } diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 6077e55094..9c7b2f5295 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -137,9 +137,7 @@ enum GameFileTypes { enum GameFeatures { GF_ITE_FLOPPY = 1 << 0, -#if 0 - GF_OLD_ITE_DOS = 1 << 1, // Currently unused -#endif + GF_ITE_DOS_DEMO = 1 << 1, GF_EXTRA_ITE_CREDITS = 1 << 2, GF_8BIT_UNSIGNED_PCM = 1 << 3 }; diff --git a/engines/saga/scene.h b/engines/saga/scene.h index 410713c5d5..1a710cfe9c 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -400,12 +400,14 @@ class Scene { static int SC_ITEIntroTreeHouseProc(int param, void *refCon); static int SC_ITEIntroFairePathProc(int param, void *refCon); static int SC_ITEIntroFaireTentProc(int param, void *refCon); + static int SC_ITEIntroCaveDemoProc(int param, void *refCon); private: EventColumns *queueIntroDialogue(EventColumns *eventColumns, int n_dialogues, const IntroDialogue dialogue[]); EventColumns *queueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]); int ITEIntroAnimProc(int param); int ITEIntroCaveCommonProc(int param, int caveScene); + int ITEIntroCaveDemoProc(int param); int ITEIntroValleyProc(int param); int ITEIntroTreeHouseProc(int param); int ITEIntroFairePathProc(int param); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 94b26c8da3..3cc6586432 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -977,19 +977,15 @@ void Script::opSpeak(SCRIPTOP_PARAMS) { // now data contains last string index -#if 0 - if (_vm->getFeatures() & GF_OLD_ITE_DOS) { // special ITE dos + if (_vm->getFeatures() & GF_ITE_DOS_DEMO) { if ((_vm->_scene->currentSceneNumber() == ITE_DEFAULT_SCENE) && (iparam1 >= 288) && (iparam1 <= (RID_SCENE1_VOICE_END - RID_SCENE1_VOICE_START + 288))) { sampleResourceId = RID_SCENE1_VOICE_START + iparam1 - 288; } } else { -#endif if (thread->_voiceLUT->size() > uint16(first)) sampleResourceId = (*thread->_voiceLUT)[uint16(first)]; -#if 0 } -#endif if (sampleResourceId < 0 || sampleResourceId > 4000) sampleResourceId = -1; |