aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/resource.h
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-25 15:19:33 +0000
committerFilippos Karapetis2008-12-25 15:19:33 +0000
commitdd7ea11ac4b975f205df180d1af2efe5a99d7e84 (patch)
treedd2384469c50a9f1d8161c7d439150674048d349 /engines/saga/resource.h
parent52f464534cfa9e61bb5a3679f1b46e14d283adcb (diff)
downloadscummvm-rg350-dd7ea11ac4b975f205df180d1af2efe5a99d7e84.tar.gz
scummvm-rg350-dd7ea11ac4b975f205df180d1af2efe5a99d7e84.tar.bz2
scummvm-rg350-dd7ea11ac4b975f205df180d1af2efe5a99d7e84.zip
SAGA2 HRS resources should be loaded correctly now
svn-id: r35539
Diffstat (limited to 'engines/saga/resource.h')
-rw-r--r--engines/saga/resource.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/saga/resource.h b/engines/saga/resource.h
index 6067e0bd74..e6178407af 100644
--- a/engines/saga/resource.h
+++ b/engines/saga/resource.h
@@ -84,9 +84,7 @@ struct ResourceContext {
bool isBigEndian;
ResourceData *table;
size_t count;
- uint32 firstGroupOffset; // SAGA2
- ResourceData *base; // SAGA2
- ResourceData *groups; // SAGA2
+ ResourceData *categories; // SAGA2
Common::File *getFile(ResourceData *resourceData) const {
if (resourceData->patchData != NULL) {
@@ -109,6 +107,16 @@ struct ResourceContext {
return &table[resourceId];
}
+ // SAGA 2
+ int32 getEntryNum(uint32 id) {
+ for (int32 i = 0; i < (int32)count; i++) {
+ if (table[i].id == id) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
};
struct MetaResource {
@@ -146,8 +154,7 @@ public:
virtual void loadGlobalResources(int chapter, int actorsEntrance) = 0;
ResourceContext *getContext(uint16 fileType, int serial = 0) {
- int i;
- for (i = 0; i < _contextsCount; i++) {
+ for (int i = 0; i < _contextsCount; i++) {
if ((_contexts[i].fileType & fileType) && _contexts[i].serial == serial) {
return &_contexts[i];
}