aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-25 22:37:08 +0000
committerFilippos Karapetis2009-03-25 22:37:08 +0000
commit58a66cb3cd7f3582343ea5771cfc6fecdf87b05a (patch)
tree599b621b862d331502c46556b76d76bdedf974fc /engines/sci
parent1a5f531d23d454d953a76e805c7f3d3289ed4d8a (diff)
downloadscummvm-rg350-58a66cb3cd7f3582343ea5771cfc6fecdf87b05a.tar.gz
scummvm-rg350-58a66cb3cd7f3582343ea5771cfc6fecdf87b05a.tar.bz2
scummvm-rg350-58a66cb3cd7f3582343ea5771cfc6fecdf87b05a.zip
Use the default kernel vocabulary names for SCI1 games, instead of reading the unreliable (in SCI1 games) 999.voc resource. KQ5 and EcoQuest 1 now work properly, and all other SCI1 games seem to be unaffected and working with this change. If there's any SCI1 game with different kernel vocabulary names, we can add special flags to it to our detector, so this change fixes more than it breaks :)
svn-id: r39694
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/scicore/vocab_debug.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/sci/scicore/vocab_debug.cpp b/engines/sci/scicore/vocab_debug.cpp
index 603c2cdf07..189024770d 100644
--- a/engines/sci/scicore/vocab_debug.cpp
+++ b/engines/sci/scicore/vocab_debug.cpp
@@ -471,12 +471,31 @@ static char **vocabulary_get_knames0(ResourceManager *resmgr, int* names) {
return t;
}
-//NOTE: Untested
static char **vocabulary_get_knames1(ResourceManager *resmgr, int *count) {
char **t = NULL;
+ // vocab.999/999.voc is notoriously unreliable in SCI1 games, and should not be used
+ // We hardcode the default SCI1 kernel names here (i.e. the ones inside the "special"
+ // 999.voc file from FreeSCI). All SCI1 games seem to be working with this change, but
+ // if any SCI1 game has different kernel vocabulary names, it might not work. It seems
+ // that all SCI1 games use the same kernel vocabulary names though, so this seems to be
+ // a safe change. If there's any SCI1 game with different kernel vocabulary names, we can
+ // add special flags to it to our detector
+ t = (char **)sci_malloc((SCI1_KNAMES_DEFAULT_ENTRIES_NR + 1) * sizeof(char*));
+ *count = SCI1_KNAMES_DEFAULT_ENTRIES_NR - 1; // index of last element
+
+ for (int i = 0; i < SCI1_KNAMES_DEFAULT_ENTRIES_NR; i++)
+ t[i] = sci_strdup(sci1_default_knames[i]);
+
+ t[SCI1_KNAMES_DEFAULT_ENTRIES_NR] = NULL; // Terminate list
+
+ return t;
+
+// Previous code, which used the unreliable 999.voc resource
+#if 0
unsigned int size = 64, used = 0, pos = 0;
Resource *r = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_KNAMES, 0);
- if(r == NULL) {// failed to open vocab.999 (happens with SCI1 demos)
+
+ if (r == NULL) {// failed to open vocab.999 (happens with SCI1 demos)
t = (char **)sci_malloc((SCI1_KNAMES_DEFAULT_ENTRIES_NR + 1) * sizeof(char*));
*count = SCI1_KNAMES_DEFAULT_ENTRIES_NR - 1; // index of last element
@@ -504,6 +523,7 @@ static char **vocabulary_get_knames1(ResourceManager *resmgr, int *count) {
t[used] = NULL;
return t;
+#endif
}
//
static char **vocabulary_get_knames11(ResourceManager *resmgr, int *count) {