aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-20 20:30:31 +0000
committerFilippos Karapetis2009-11-20 20:30:31 +0000
commit57c87745e11224c8b93d92ac5d286b803f5d6212 (patch)
tree3e48211f471ec950df50890cac0481aa68564cfd /engines/sci/engine
parent16145c431a87a977db68617da08391d8b5685643 (diff)
downloadscummvm-rg350-57c87745e11224c8b93d92ac5d286b803f5d6212.tar.gz
scummvm-rg350-57c87745e11224c8b93d92ac5d286b803f5d6212.tar.bz2
scummvm-rg350-57c87745e11224c8b93d92ac5d286b803f5d6212.zip
Removed the syncTime and syncCue selectors from the list of static selectors, along with their relevant FIXMEs. These selectors are used for lip syncing in CD talkie games, which always got a selector vocabulary, so we don't need to hardcode them. Did some further simplification/rewrite of the static selector tables
svn-id: r46019
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/static_selectors.cpp59
-rw-r--r--engines/sci/engine/vm.h3
2 files changed, 24 insertions, 38 deletions
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index c047bdd3b0..4c213afc3c 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -31,6 +31,8 @@
namespace Sci {
struct SelectorRemap {
+ SciVersion minVersion;
+ SciVersion maxVersion;
const char *name;
uint32 slot;
};
@@ -61,39 +63,24 @@ static const char * const sci1Selectors[] = {
"frame", "vol", "pri", "perform", "moveDone" // 93 - 97
};
-// Taken from Codename: Iceman (Full Game)
-static const SelectorRemap sci0SelectorRemap[] = {
- { "moveDone", 170 }, { "points", 316 }, { "flags", 368 },
- { 0, 0 }
-};
-
-// Taken from Leisure Suit Larry 1 VGA (Full Game)
-static const SelectorRemap sci1SelectorRemap[] = {
- { "nodePtr", 44 }, { "cantBeHere", 57 }, { "topString", 101 },
- { "flags", 102 },
- // FIXME: These two selectors differ for each game. We need to find a reliable
- // way to detect them, or apply them on a per-game basis for games which are
- // missing them
- { "syncTime", 247 }, { "syncCue", 248 },
- { 0, 0 }
-};
-
-// Taken from KQ6 floppy (Full Game)
-static const SelectorRemap sci11SelectorRemap[] = {
- { "nodePtr", 41 }, { "cantBeHere", 54 }, { "topString", 98 },
- { "flags", 99 }, { "scaleX", 104 }, { "scaleY", 105 },
- // FIXME: These two selectors differ for each game. We need to find a reliable
- // way to detect them, or apply them on a per-game basis for games which are
- // missing them
- { "syncTime", 279 }, { "syncCue", 280 },
- { 0, 0 }
+static const SelectorRemap sciSelectorRemap[] = {
+ { SCI_VERSION_0_EARLY, SCI_VERSION_0_LATE, "moveDone", 170 },
+ { SCI_VERSION_0_EARLY, SCI_VERSION_0_LATE, "points", 316 },
+ { SCI_VERSION_0_EARLY, SCI_VERSION_0_LATE, "flags", 368 },
+ { SCI_VERSION_1_EARLY, SCI_VERSION_1_1, "nodePtr", 44 },
+ { SCI_VERSION_1_EARLY, SCI_VERSION_1_1, "cantBeHere", 57 },
+ { SCI_VERSION_1_EARLY, SCI_VERSION_1_1, "topString", 101 },
+ { SCI_VERSION_1_EARLY, SCI_VERSION_1_1, "flags", 102 },
+ { SCI_VERSION_1_1, SCI_VERSION_1_1, "scaleX", 104 },
+ { SCI_VERSION_1_1, SCI_VERSION_1_1, "scaleY", 105 },
+ { SCI_VERSION_AUTODETECT, SCI_VERSION_AUTODETECT, 0, 0 }
};
Common::StringList Kernel::checkStaticSelectorNames() {
Common::StringList names;
const int offset = (getSciVersion() < SCI_VERSION_1_1) ? 3 : 0;
const int count = ARRAYSIZE(sci0Selectors) + offset;
- const SelectorRemap *selectorRemap = sci0SelectorRemap;
+ const SelectorRemap *selectorRemap = sciSelectorRemap;
int i;
// Resize the list of selector names and fill in the SCI 0 names.
@@ -103,26 +90,24 @@ Common::StringList Kernel::checkStaticSelectorNames() {
for (i = offset; i < count; i++)
names[i] = sci0Selectors[i - offset];
- if (getSciVersion() <= SCI_VERSION_01) {
- selectorRemap = sci0SelectorRemap;
- } else {
+ if (getSciVersion() > SCI_VERSION_01) {
// Several new selectors were added in SCI 1 and later.
int count2 = ARRAYSIZE(sci1Selectors);
names.resize(count + count2);
for (i = count; i < count + count2; i++)
names[i] = sci1Selectors[i - count];
-
- if (getSciVersion() < SCI_VERSION_1_1) {
- selectorRemap = sci1SelectorRemap;
- } else {
- selectorRemap = sci11SelectorRemap;
- }
}
for (; selectorRemap->slot; ++selectorRemap) {
+ uint32 slot = selectorRemap->slot;
if (selectorRemap->slot >= names.size())
names.resize(selectorRemap->slot + 1);
- names[selectorRemap->slot] = selectorRemap->name;
+ if (getSciVersion() >= selectorRemap->minVersion && getSciVersion() <= selectorRemap->maxVersion) {
+ // The SCI1 selectors we use exist in SCI1.1 too, offset by 3
+ if (selectorRemap->minVersion == SCI_VERSION_1_EARLY && getSciVersion() == SCI_VERSION_1_1)
+ slot -= 3;
+ names[slot] = selectorRemap->name;
+ }
}
return names;
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index ed1d978b56..b0afddf3cd 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -184,7 +184,8 @@ struct SelectorCache {
Selector topString; // SCI1 scroll lists use this instead of lsTop
Selector flags;
- // SCI1+ music-related selectors, not static
+ // SCI1+ audio sync related selectors, not static. They're used for lip syncing in
+ // CD talkie games
Selector syncCue; // Used by DoSync()
Selector syncTime;