aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 20:50:11 +0000
committerBastien Bouclet2010-11-29 20:50:11 +0000
commit4e420ef6fcc7b2d13f74704a14fe97ef9dc7fdee (patch)
treef1b7fa426679a3e279df13a4173392f9f5584480 /engines
parent117f46a884e25753ba48d923f2c2f748d7428699 (diff)
downloadscummvm-rg350-4e420ef6fcc7b2d13f74704a14fe97ef9dc7fdee.tar.gz
scummvm-rg350-4e420ef6fcc7b2d13f74704a14fe97ef9dc7fdee.tar.bz2
scummvm-rg350-4e420ef6fcc7b2d13f74704a14fe97ef9dc7fdee.zip
MOHAWK: Keep resource type around
svn-id: r54595
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/myst.cpp32
-rw-r--r--engines/mohawk/myst.h1
2 files changed, 24 insertions, 9 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index d8460e6201..3bd909938f 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -890,6 +890,7 @@ void MohawkEngine_Myst::drawResourceImages() {
}
static MystResource *loadResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) {
+ MystResource *resource = 0;
uint16 type = rlstStream->readUint16LE();
debugC(kDebugResource, "\tType: %d", type);
@@ -902,26 +903,39 @@ static MystResource *loadResource(MohawkEngine_Myst *vm, Common::SeekableReadStr
case kMystDownResource:
case kMystUpResource:
case 14: // TODO: kMystBackwardResource?
- return new MystResource(vm, rlstStream, parent);
+ resource = new MystResource(vm, rlstStream, parent);
+ break;
case kMystActionResource:
- return new MystResourceType5(vm, rlstStream, parent);
+ resource = new MystResourceType5(vm, rlstStream, parent);
+ break;
case kMystVideoResource:
- return new MystResourceType6(vm, rlstStream, parent);
+ resource = new MystResourceType6(vm, rlstStream, parent);
+ break;
case kMystSwitchResource:
- return new MystResourceType7(vm, rlstStream, parent);
+ resource = new MystResourceType7(vm, rlstStream, parent);
+ break;
case 8:
- return new MystResourceType8(vm, rlstStream, parent);
+ resource = new MystResourceType8(vm, rlstStream, parent);
+ break;
case 10:
- return new MystResourceType10(vm, rlstStream, parent);
+ resource = new MystResourceType10(vm, rlstStream, parent);
+ break;
case 11:
- return new MystResourceType11(vm, rlstStream, parent);
+ resource = new MystResourceType11(vm, rlstStream, parent);
+ break;
case 12:
- return new MystResourceType12(vm, rlstStream, parent);
+ resource = new MystResourceType12(vm, rlstStream, parent);
+ break;
case 13:
- return new MystResourceType13(vm, rlstStream, parent);
+ resource = new MystResourceType13(vm, rlstStream, parent);
+ break;
default:
error ("Unknown/Unhandled MystResource type %d", type);
}
+
+ resource->type = type;
+
+ return resource;
}
void MohawkEngine_Myst::loadResources() {
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index fcd9e709a3..a2852f191d 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -154,6 +154,7 @@ public:
virtual ~MystResource();
MystResource *_parent;
+ uint16 type;
bool contains(Common::Point point) { return _rect.contains(point); }
virtual void drawDataToScreen() {}