aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-16 10:23:44 +0000
committerFilippos Karapetis2010-05-16 10:23:44 +0000
commitb57bab8e3ba0909a253c439296f7f5e9c2bb2150 (patch)
treed0bf86b99ef00c678f9fcea136ad5f19ad8f14f7 /engines
parent43e61ec60f804b2540d1188801ba44cf37727782 (diff)
downloadscummvm-rg350-b57bab8e3ba0909a253c439296f7f5e9c2bb2150.tar.gz
scummvm-rg350-b57bab8e3ba0909a253c439296f7f5e9c2bb2150.tar.bz2
scummvm-rg350-b57bab8e3ba0909a253c439296f7f5e9c2bb2150.zip
Added automatic detection for the non-interactive ITE demos
svn-id: r49046
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/detection_tables.h4
-rw-r--r--engines/saga/interface.cpp4
-rw-r--r--engines/saga/resource.h4
-rw-r--r--engines/saga/saga.h13
-rw-r--r--engines/saga/script.cpp6
-rw-r--r--engines/saga/script.h2
-rw-r--r--engines/saga/sfuncs.cpp2
7 files changed, 23 insertions, 12 deletions
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 86fc2e8499..7a346b78e9 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -250,7 +250,7 @@ static const SAGAGameDescription gameDescriptions[] = {
GUIO_NOSPEECH
},
GID_ITE,
- GF_WYRMKEEP | GF_NON_INTERACTIVE | GF_LE_VOICES,
+ GF_WYRMKEEP | GF_LE_VOICES,
ITE_DEFAULT_SCENE,
&ITE_Resources,
ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -302,7 +302,7 @@ static const SAGAGameDescription gameDescriptions[] = {
GUIO_NONE
},
GID_ITE,
- GF_WYRMKEEP | GF_NON_INTERACTIVE | GF_8BIT_UNSIGNED_PCM,
+ GF_WYRMKEEP | GF_8BIT_UNSIGNED_PCM,
ITE_DEFAULT_SCENE,
&ITE_Resources,
ARRAYSIZE(ITEWINDEMO_GameFonts),
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index eb132e3831..2cb61e21cc 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -186,7 +186,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
free(resource);
// Option panel
- if (!(_vm->getFeatures() & GF_NON_INTERACTIVE)) {
+ if (!_vm->_script->isNonInteractiveDemo()) {
_optionPanel.buttons = _vm->getDisplayInfo().optionPanelButtons;
_optionPanel.buttonsCount = _vm->getDisplayInfo().optionPanelButtonsCount;
@@ -237,7 +237,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
// Main panel sprites
_vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites);
- if (!(_vm->getFeatures() & GF_NON_INTERACTIVE)) {
+ if (!_vm->_script->isNonInteractiveDemo()) {
// Option panel sprites
_vm->_sprite->loadList(_vm->getResourceDescription()->optionPanelSpritesResourceId, _optionPanel.sprites);
// Save panel sprites
diff --git a/engines/saga/resource.h b/engines/saga/resource.h
index 2e473ae41d..e32d16c469 100644
--- a/engines/saga/resource.h
+++ b/engines/saga/resource.h
@@ -119,6 +119,10 @@ public:
return _fileType;
}
+ int32 fileSize() const {
+ return _fileSize;
+ }
+
int serial() const {
return _serial;
}
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 795b499ad8..a667a09d30 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -145,15 +145,14 @@ enum GameFeatures {
GF_WYRMKEEP = 1 << 0,
GF_ITE_FLOPPY = 1 << 1,
GF_SCENE_SUBSTITUTES = 1 << 2,
- GF_NON_INTERACTIVE = 1 << 3,
#if 0
- GF_OLD_ITE_DOS = 1 << 4, // Currently unused
+ GF_OLD_ITE_DOS = 1 << 3, // Currently unused
#endif
- GF_MONO_MUSIC = 1 << 5,
- GF_EXTRA_ITE_CREDITS = 1 << 6,
- GF_IHNM_DEMO = 1 << 7,
- GF_LE_VOICES = 1 << 8,
- GF_8BIT_UNSIGNED_PCM = 1 << 9
+ GF_MONO_MUSIC = 1 << 4,
+ GF_EXTRA_ITE_CREDITS = 1 << 5,
+ GF_IHNM_DEMO = 1 << 6,
+ GF_LE_VOICES = 1 << 7,
+ GF_8BIT_UNSIGNED_PCM = 1 << 8
};
enum VerbTypeIds {
diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp
index cac3cec373..18bbca2425 100644
--- a/engines/saga/script.cpp
+++ b/engines/saga/script.cpp
@@ -1321,6 +1321,12 @@ void Script::setVerb(int verb) {
showVerb();
}
+bool Script::isNonInteractiveDemo() {
+ // This detection only works in ITE. The early non-interactive demos had
+ // a very small script file
+ return _vm->getGameId() == GID_ITE && _scriptContext->fileSize() < 50000;
+}
+
void Script::setLeftButtonVerb(int verb) {
int oldVerb = _currentVerb;
diff --git a/engines/saga/script.h b/engines/saga/script.h
index 1ff1809e04..f31af7b2ea 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -341,6 +341,8 @@ public:
int getVerbType(VerbTypes verbType);
TextListEntry *getPlacardTextEntry() { return _placardTextEntry; }
+ bool isNonInteractiveDemo();
+
protected:
// When reading or writing data to the common buffer, we have to use a
// well-defined byte order since it's stored in savegames. Otherwise,
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 4c44aa2bdd..f98a80acd8 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -226,7 +226,7 @@ void Script::sfMainMode(SCRIPTFUNC_PARAMS) {
// exit the game. Therefore, once this opcode is called in the older ITE demos,
// exit the game. Known non-interactive demos are GID_ITE_MACDEMO1 and
// GID_ITE_WINDEMO1
- if (_vm->getFeatures() & GF_NON_INTERACTIVE)
+ if (_vm->_script->isNonInteractiveDemo())
_vm->quitGame();
}