aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/scene.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-02 16:52:38 +0000
committerFilippos Karapetis2009-01-02 16:52:38 +0000
commitd5b6996c4521d4d02b2caae3802f5b120c632783 (patch)
treec1690def198ed98dba013de57dd447b81440ec0e /engines/saga/scene.cpp
parenta09a7678f4c4af4aadd1e0b58fd62becc1a6125e (diff)
downloadscummvm-rg350-d5b6996c4521d4d02b2caae3802f5b120c632783.tar.gz
scummvm-rg350-d5b6996c4521d4d02b2caae3802f5b120c632783.tar.bz2
scummvm-rg350-d5b6996c4521d4d02b2caae3802f5b120c632783.zip
- Split the IHNM script functions into a different file
- Added two new defines, ENABLE_IHNM and ENABLE_SAGA2 (enabled by default), which can be used to remove the parts of the SAGA engine which are specific to IHNM and SAGA 2 games. Hopefully, this will reduce the size of the engine even more for platforms with little memory (e.g. the Nintendo DS) svn-id: r35672
Diffstat (limited to 'engines/saga/scene.cpp')
-rw-r--r--engines/saga/scene.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 40d0ddcc90..b5b9aaa2ea 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -82,6 +82,7 @@ SAGA_UNKNOWN,
SAGA_PALETTE
};
+#ifdef ENABLE_IHNM
static SAGAResourceTypes IHNMSceneResourceTypes[28] = {
SAGA_ACTOR,
SAGA_UNKNOWN,
@@ -112,6 +113,7 @@ SAGA_UNKNOWN,
SAGA_FACES,
SAGA_PALETTE
};
+#endif
const char *SAGAResourceTypesString[] = {
"SAGA_UNKNOWN",
@@ -238,12 +240,14 @@ Scene::~Scene() {
}
void Scene::getResourceTypes(SAGAResourceTypes *&types, int &typesCount) {
- if (_vm->getGameId() == GID_IHNM) {
- typesCount = ARRAYSIZE(IHNMSceneResourceTypes);
- types = IHNMSceneResourceTypes;
- } else {
+ if (_vm->getGameId() == GID_ITE) {
typesCount = ARRAYSIZE(ITESceneResourceTypes);
types = ITESceneResourceTypes;
+#ifdef ENABLE_IHNM
+ } else if (_vm->getGameId() == GID_IHNM) {
+ typesCount = ARRAYSIZE(IHNMSceneResourceTypes);
+ types = IHNMSceneResourceTypes;
+#endif
}
}
@@ -286,15 +290,19 @@ void Scene::startScene() {
case GID_ITE:
ITEStartProc();
break;
+#ifdef ENABLE_IHNM
case GID_IHNM:
IHNMStartProc();
break;
+#endif
+#ifdef ENABLE_SAGA2
case GID_DINO:
// TODO
break;
case GID_FTA2:
FTA2StartProc();
break;
+#endif
default:
error("Scene::start(): Error: Can't start game... gametype not supported");
break;
@@ -314,6 +322,8 @@ void Scene::startScene() {
loadScene(sceneQueue);
}
+#ifdef ENABLE_IHNM
+
void Scene::creditsScene() {
// End the last game ending scene
_vm->_scene->endScene();
@@ -339,6 +349,8 @@ void Scene::creditsScene() {
return;
}
+#endif
+
void Scene::nextScene() {
SceneQueueList::iterator queueIterator;
LoadSceneParams *sceneQueue;
@@ -619,6 +631,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
_chapterPointsChanged = false;
+#ifdef ENABLE_IHNM
if ((_vm->getGameId() == GID_IHNM) && (loadSceneParams->chapter != NO_CHAPTER_CHANGE)) {
if (loadSceneParams->loadFlag != kLoadBySceneNumber) {
error("loadScene wrong usage");
@@ -657,6 +670,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
return;
}
}
+#endif
if (_sceneLoaded) {
error("Scene::loadScene(): Error, a scene is already loaded");
@@ -664,11 +678,13 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
_loadDescription = true;
+#ifdef ENABLE_IHNM
if (_vm->getGameId() == GID_IHNM) {
if (loadSceneParams->loadFlag == kLoadBySceneNumber) // When will we get rid of it?
if (loadSceneParams->sceneDescriptor <= 0)
loadSceneParams->sceneDescriptor = _vm->_resource->getMetaResource()->sceneIndex;
}
+#endif
switch (loadSceneParams->loadFlag) {
case kLoadByResourceId:
@@ -1365,6 +1381,7 @@ void Scene::clearPlacard() {
event.duration = 0;
q_event = _vm->_events->chain(q_event, &event);
+#ifdef ENABLE_IHNM
if (_vm->getGameId() == GID_IHNM) {
// set mode to main
event.type = kEvTImmediate;
@@ -1375,6 +1392,7 @@ void Scene::clearPlacard() {
event.duration = 0;
q_event = _vm->_events->chain(q_event, &event);
}
+#endif
// Display scene background, but stay with black palette
event.type = kEvTImmediate;