diff options
Diffstat (limited to 'engines/sci/vocabulary.cpp')
-rw-r--r-- | engines/sci/vocabulary.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/sci/vocabulary.cpp b/engines/sci/vocabulary.cpp index 69b7bc3393..517413db4b 100644 --- a/engines/sci/vocabulary.cpp +++ b/engines/sci/vocabulary.cpp @@ -57,12 +57,12 @@ const char *class_names[] = {"", "" }; -int *vocab_get_classes(ResourceManager *resmgr, int* count) { +int *vocab_get_classes(ResourceManager *resourceManager, int* count) { Resource* r; int *c; unsigned int i; - if ((r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == NULL) + if ((r = resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == NULL) return 0; c = (int *)malloc(sizeof(int) * r->size / 2); @@ -74,10 +74,10 @@ int *vocab_get_classes(ResourceManager *resmgr, int* count) { return c; } -int vocab_get_class_count(ResourceManager *resmgr) { +int vocab_get_class_count(ResourceManager *resourceManager) { Resource* r; - if ((r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == 0) + if ((r = resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == 0) return 0; return r->size / 4; @@ -85,13 +85,13 @@ int vocab_get_class_count(ResourceManager *resmgr) { #endif -Vocabulary::Vocabulary(ResourceManager *resmgr) : _resmgr(resmgr) { +Vocabulary::Vocabulary(ResourceManager *resourceManager) : _resourceManager(resourceManager) { _parserRules = NULL; _vocabVersion = kVocabularySCI0; debug(2, "Initializing vocabulary"); - if (_resmgr->sciVersion() <= SCI_VERSION_1_EGA && loadParserWords()) { + if (_resourceManager->sciVersion() <= SCI_VERSION_1_EGA && loadParserWords()) { loadSuffixes(); if (loadBranches()) // Now build a GNF grammar out of this @@ -115,11 +115,11 @@ bool Vocabulary::loadParserWords() { int currentwordpos = 0; // First try to load the SCI0 vocab resource. - Resource *resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_MAIN_VOCAB), 0); + Resource *resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_MAIN_VOCAB), 0); if (!resource) { warning("SCI0: Could not find a main vocabulary, trying SCI01"); - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_MAIN_VOCAB), 0); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_MAIN_VOCAB), 0); _vocabVersion = kVocabularySCI1; } @@ -198,9 +198,9 @@ bool Vocabulary::loadSuffixes() { Resource* resource = NULL; if (_vocabVersion == kVocabularySCI0) - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 1); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 1); else - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 1); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 1); if (!resource) return false; // No vocabulary found @@ -237,12 +237,12 @@ void Vocabulary::freeSuffixes() { Resource* resource = NULL; if (_vocabVersion == kVocabularySCI0) - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 0); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 0); else - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 0); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 0); if (resource) - _resmgr->unlockResource(resource); + _resourceManager->unlockResource(resource); _parserSuffixes.clear(); } @@ -251,9 +251,9 @@ bool Vocabulary::loadBranches() { Resource *resource = NULL; if (_vocabVersion == kVocabularySCI0) - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_PARSE_TREE_BRANCHES), 0); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_PARSE_TREE_BRANCHES), 0); else - resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES), 0); + resource = _resourceManager->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES), 0); _parserBranches.clear(); |