aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/actorresource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/illusions/actorresource.cpp')
-rw-r--r--engines/illusions/actorresource.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/engines/illusions/actorresource.cpp b/engines/illusions/actorresource.cpp
index 058b093ac6..d3762f96b6 100644
--- a/engines/illusions/actorresource.cpp
+++ b/engines/illusions/actorresource.cpp
@@ -32,7 +32,7 @@ void ActorResourceLoader::load(Resource *resource) {
debug("ActorResourceLoader::load() Loading actor %08X from %s...", resource->_resId, resource->_filename.c_str());
ActorResource *actorResource = new ActorResource();
- actorResource->load(resource->_data, resource->_dataSize);
+ actorResource->load(resource);
resource->_refId = actorResource;
ActorItem *actorItem = _vm->_actorItems->allocActorItem();
@@ -151,7 +151,10 @@ ActorResource::ActorResource() {
ActorResource::~ActorResource() {
}
-void ActorResource::load(byte *data, uint32 dataSize) {
+void ActorResource::load(Resource *resource) {
+ byte *data = resource->_data;
+ uint32 dataSize = resource->_dataSize;
+
Common::MemoryReadStream stream(data, dataSize, DisposeAfterUse::NO);
_totalSize = stream.readUint32LE();
@@ -196,10 +199,14 @@ void ActorResource::load(byte *data, uint32 dataSize) {
}
// Load named points
- // The count isn't stored explicitly so calculate it
- uint namedPointsCount = (actorTypesOffs - 0x20) / 8;
- stream.seek(0x20);
- _namedPoints.load(namedPointsCount, stream);
+ if (resource->_gameId == kGameIdBBDOU) {
+ // The count isn't stored explicitly so calculate it
+ uint namedPointsCount = (actorTypesOffs - 0x20) / 8;
+ stream.seek(0x20);
+ _namedPoints.load(namedPointsCount, stream);
+ }
+
+ debug("ActorResource(%08X) framesCount: %d", resource->_resId, framesCount);
}