aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorAndrew Kurushin2005-08-06 12:20:10 +0000
committerAndrew Kurushin2005-08-06 12:20:10 +0000
commit5b4ecd206d0012fcf96e3df4eceafb69609ce3b3 (patch)
tree1f19c6eb7793c81b466bcbc7a3ea942debd82322 /saga
parent005843e55bf7dc8b326d802e75e0caa35816f0de (diff)
downloadscummvm-rg350-5b4ecd206d0012fcf96e3df4eceafb69609ce3b3.tar.gz
scummvm-rg350-5b4ecd206d0012fcf96e3df4eceafb69609ce3b3.tar.bz2
scummvm-rg350-5b4ecd206d0012fcf96e3df4eceafb69609ce3b3.zip
changeChapter -> changeScene with chapter
svn-id: r18619
Diffstat (limited to 'saga')
-rw-r--r--saga/game.cpp2
-rw-r--r--saga/ihnm_introproc.cpp9
-rw-r--r--saga/ite_introproc.cpp19
-rw-r--r--saga/scene.cpp64
-rw-r--r--saga/scene.h5
5 files changed, 54 insertions, 45 deletions
diff --git a/saga/game.cpp b/saga/game.cpp
index 2f9f46cfdf..6af7907aef 100644
--- a/saga/game.cpp
+++ b/saga/game.cpp
@@ -548,7 +548,7 @@ static GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
-1, -1, // right portrait x, y offset
-1, -1, // inventory Up & Down button indexies
- 0, 0, // inventory rows, columns
+ 2, 4, // inventory rows, columns
0, 149, // main panel offsets
ARRAYSIZE(IHNM_MainPanelButtons),
diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp
index 49378e7b78..19f892e4b0 100644
--- a/saga/ihnm_introproc.cpp
+++ b/saga/ihnm_introproc.cpp
@@ -80,10 +80,10 @@ SceneDescription IHNM_IntroMovie4Desc = {
};
LoadSceneParams IHNM_IntroList[] = {
- {0, kLoadByDescription, &IHNM_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, false},
- {0, kLoadByDescription, &IHNM_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc2, false, kTransitionNoFade, 0, false},
- {0, kLoadByDescription, &IHNM_IntroMovie3Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, false},
- {0, kLoadByDescription, &IHNM_IntroMovie4Desc, Scene::SC_IHNMHateProc, false, kTransitionNoFade, 0, false}
+ {0, kLoadByDescription, &IHNM_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, -1},
+ {0, kLoadByDescription, &IHNM_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc2, false, kTransitionNoFade, 0, -1},
+ {0, kLoadByDescription, &IHNM_IntroMovie3Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, -1},
+ {0, kLoadByDescription, &IHNM_IntroMovie4Desc, Scene::SC_IHNMHateProc, false, kTransitionNoFade, 0, -1}
};
int Scene::IHNMStartProc() {
@@ -105,6 +105,7 @@ int Scene::IHNMStartProc() {
firstScene.sceneProc = NULL;
firstScene.transitionType = kTransitionFade;
firstScene.actorsEntrance = 0;
+ firstScene.chapter = 0;
_vm->_scene->queueScene(&firstScene);
diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp
index b82d654630..ba5a1fa594 100644
--- a/saga/ite_introproc.cpp
+++ b/saga/ite_introproc.cpp
@@ -45,15 +45,15 @@ using Common::EN_USA;
using Common::DE_DEU;
LoadSceneParams ITE_IntroList[] = {
- {RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, false},
- {RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0, false},
- {RID_ITE_CAVE_SCENE_2, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave2Proc, false, kTransitionNoFade, 0, false},
- {RID_ITE_CAVE_SCENE_3, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave3Proc, false, kTransitionNoFade, 0, false},
- {RID_ITE_CAVE_SCENE_4, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave4Proc, false, kTransitionNoFade, 0, false},
- {RID_ITE_VALLEY_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroValleyProc, false, kTransitionFade, 0, false},
- {RID_ITE_TREEHOUSE_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroTreeHouseProc, false, kTransitionNoFade, 0, false},
- {RID_ITE_FAIREPATH_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFairePathProc, false, kTransitionNoFade, 0, false},
- {RID_ITE_FAIRETENT_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFaireTentProc, false, kTransitionNoFade, 0, false}
+ {RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0, -1},
+ {RID_ITE_CAVE_SCENE_2, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave2Proc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_CAVE_SCENE_3, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave3Proc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_CAVE_SCENE_4, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave4Proc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_VALLEY_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroValleyProc, false, kTransitionFade, 0, -1},
+ {RID_ITE_TREEHOUSE_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroTreeHouseProc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_FAIREPATH_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFairePathProc, false, kTransitionNoFade, 0, -1},
+ {RID_ITE_FAIRETENT_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFaireTentProc, false, kTransitionNoFade, 0, -1}
};
int Scene::ITEStartProc() {
@@ -79,6 +79,7 @@ int Scene::ITEStartProc() {
firstScene.sceneProc = NULL;
firstScene.transitionType = kTransitionFade;
firstScene.actorsEntrance = 0;
+ firstScene.chapter = -1;
_vm->_scene->queueScene(&firstScene);
diff --git a/saga/scene.cpp b/saga/scene.cpp
index d13a9aa87b..cbf91a52f4 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -417,7 +417,7 @@ static struct SceneSubstitutes {
}
};
-void Scene::changeScene(uint16 sceneNumber, int actorsEntrance, SceneTransitionType transitionType) {
+void Scene::changeScene(uint16 sceneNumber, int actorsEntrance, SceneTransitionType transitionType, int chapter) {
// This is used for latter demos where all places on world map except
// Tent Faire are substituted with LBM picture and short description
if (_vm->getFeatures() & GF_SCENE_SUBSTITUTES) {
@@ -467,37 +467,14 @@ void Scene::changeScene(uint16 sceneNumber, int actorsEntrance, SceneTransitionT
sceneParams.transitionType = transitionType;
sceneParams.sceneProc = NULL;
sceneParams.sceneSkipTarget = false;
+ sceneParams.chapter = chapter;
- endScene();
+ if (sceneNumber != -2) {
+ endScene();
+ }
loadScene(&sceneParams);
}
-void Scene::changeChapter(int chapter, int16 sceneNumber, int actorsEntrance) {
- if (chapter == 6)
- _vm->_interface->setLeftPortrait(0);
-
- freeCutawayList();
- _vm->_script->freeModules();
- // deleteAllScenes();
-
- // installSomeAlarm()
-
- _vm->_interface->clearInventory();
- _vm->_resource->loadGlobalResources(chapter, actorsEntrance);
- _vm->_interface->addToInventory(IHNM_OBJ_PROFILE);
- _vm->_interface->activate();
-
- if (chapter == 8 || chapter == -1)
- _vm->_interface->setMode(kPanelUnknown);
- else
- _vm->_interface->setMode(kPanelMain);
-
- _vm->_script->setVerb(kVerbIHNMWalkTo);
-
- if (sceneNumber != -2)
- changeScene(sceneNumber, actorsEntrance, kTransitionFade);
-}
-
void Scene::freeCutawayList() {
// TODO
// It has to be in different class
@@ -620,6 +597,37 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
EVENT *q_event;
static PalEntry current_pal[PAL_ENTRIES];
+ if (loadSceneParams->chapter != -1) {
+ if (loadSceneParams->loadFlag != kLoadBySceneNumber) {
+ error("loadScene wrong usage");
+ }
+
+ if (loadSceneParams->chapter == 6)
+ _vm->_interface->setLeftPortrait(0);
+
+ freeCutawayList();
+ _vm->_script->freeModules();
+ // deleteAllScenes();
+
+ // installSomeAlarm()
+
+ _vm->_interface->clearInventory();
+ _vm->_resource->loadGlobalResources(loadSceneParams->chapter, loadSceneParams->actorsEntrance);
+ _vm->_interface->addToInventory(IHNM_OBJ_PROFILE);
+ _vm->_interface->activate();
+
+ if (loadSceneParams->chapter == 8 || loadSceneParams->chapter == -1)
+ _vm->_interface->setMode(kPanelUnknown);
+ else
+ _vm->_interface->setMode(kPanelMain);
+
+ //_vm->_script->setVerb(kVerbIHNMWalkTo); uncomment then panel will be done
+
+ if (loadSceneParams->sceneDescriptor == -2) {
+ return;
+ }
+ }
+//
if (_sceneLoaded) {
error("Scene::loadScene(): Error, a scene is already loaded");
}
diff --git a/saga/scene.h b/saga/scene.h
index 5805a44d89..adc9fe39db 100644
--- a/saga/scene.h
+++ b/saga/scene.h
@@ -163,7 +163,7 @@ struct LoadSceneParams {
bool sceneSkipTarget;
SceneTransitionType transitionType;
int actorsEntrance;
- bool extended; // IHNM GotoScene_ analog
+ int chapter;
};
typedef Common::List<LoadSceneParams> SceneQueueList;
@@ -248,8 +248,7 @@ class Scene {
void clearSceneQueue(void) {
_sceneQueue.clear();
}
- void changeScene(uint16 sceneNumber, int actorsEntrance, SceneTransitionType transitionType);
- void changeChapter(int chapter, int16 sceneNumber, int actorsEntrance);
+ void changeScene(uint16 sceneNumber, int actorsEntrance, SceneTransitionType transitionType, int chapter = -1);
void freeCutawayList();
bool isSceneLoaded() const { return _sceneLoaded; }