aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/vocabulary.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2009-06-07 19:15:55 +0000
committerWalter van Niftrik2009-06-07 19:15:55 +0000
commita6ed05740f1f46639f38ccf0afb9c444564cc84f (patch)
tree310b79a435f54f2d8e22555234ccb33f62848969 /engines/sci/vocabulary.cpp
parent4dd29a5985a4190f99446865209850a40f12e2e4 (diff)
downloadscummvm-rg350-a6ed05740f1f46639f38ccf0afb9c444564cc84f.tar.gz
scummvm-rg350-a6ed05740f1f46639f38ccf0afb9c444564cc84f.tar.bz2
scummvm-rg350-a6ed05740f1f46639f38ccf0afb9c444564cc84f.zip
SCI: Moved resource36 handling into resource manager.
svn-id: r41349
Diffstat (limited to 'engines/sci/vocabulary.cpp')
-rw-r--r--engines/sci/vocabulary.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/vocabulary.cpp b/engines/sci/vocabulary.cpp
index 40b5be3da9..c877053060 100644
--- a/engines/sci/vocabulary.cpp
+++ b/engines/sci/vocabulary.cpp
@@ -62,7 +62,7 @@ int *vocab_get_classes(ResourceManager *resmgr, int* count) {
int *c;
unsigned int i;
- if ((r = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES, 0)) == NULL)
+ if ((r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == NULL)
return 0;
c = (int *)malloc(sizeof(int) * r->size / 2);
@@ -77,7 +77,7 @@ int *vocab_get_classes(ResourceManager *resmgr, int* count) {
int vocab_get_class_count(ResourceManager *resmgr) {
Resource* r;
- if ((r = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES, 0)) == 0)
+ if ((r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_CLASSES), 0)) == 0)
return 0;
return r->size / 4;
@@ -115,11 +115,11 @@ bool Vocabulary::loadParserWords() {
int currentwordpos = 0;
// First try to load the SCI0 vocab resource.
- Resource *resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_MAIN_VOCAB, 0);
+ Resource *resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_MAIN_VOCAB), 0);
if (!resource) {
warning("SCI0: Could not find a main vocabulary, trying SCI01");
- resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_MAIN_VOCAB, 0);
+ resource = _resmgr->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(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB, 1);
+ resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 1);
else
- resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB, 1);
+ resource = _resmgr->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(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB, 0);
+ resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 0);
else
- resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB, 0);
+ resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 0);
if (resource)
- _resmgr->unlockResource(resource, resource->id.number, kResourceTypeVocab);
+ _resmgr->unlockResource(resource);
_parserSuffixes.clear();
}
@@ -251,9 +251,9 @@ bool Vocabulary::loadBranches() {
Resource *resource = NULL;
if (_vocabVersion == kVocabularySCI0)
- resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_PARSE_TREE_BRANCHES, 0);
+ resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_PARSE_TREE_BRANCHES), 0);
else
- resource = _resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES, 0);
+ resource = _resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES), 0);
_parserBranches.clear();