aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-11-13 01:14:49 +0100
committerEugene Sandulenko2016-11-13 01:15:12 +0100
commit82211302c04f8320953d568b912052e3c6d3f11c (patch)
treeba76b5e7c7a98f70028b0edf811ef967c8d7da41 /engines
parent476513389297786021743e16de777e99e0fea709 (diff)
downloadscummvm-rg350-82211302c04f8320953d568b912052e3c6d3f11c.tar.gz
scummvm-rg350-82211302c04f8320953d568b912052e3c6d3f11c.tar.bz2
scummvm-rg350-82211302c04f8320953d568b912052e3c6d3f11c.zip
DIRECTOR: More work on Cast loading in D4
Diffstat (limited to 'engines')
-rw-r--r--engines/director/frame.cpp5
-rw-r--r--engines/director/resource.cpp2
-rw-r--r--engines/director/score.cpp2
-rw-r--r--engines/director/score.h1
4 files changed, 9 insertions, 1 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 6464943d99..cccfb375c8 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -559,6 +559,8 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
continue;
}
+ assert(_sprites[i]->_cast);
+
uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX;
uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY;
uint32 rectLeft = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.left;
@@ -646,9 +648,10 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
}
if (_vm->_currentScore->getArchive()->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) {
+ warning("************");
Common::SeekableReadStream *pic = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId);
- if (_vm->getVersion() < 4) {
+ if (_vm->getVersion() <= 4) {
BitmapCast *bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
int w = bc->initialRect.width(), h = bc->initialRect.height();
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 54ab2198e1..2f8ef3e432 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -220,6 +220,8 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
castScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator);
}
+ castScore->setSpriteCasts();
+
_sharedCasts = &castScore->_casts;
Common::Array<uint16> dib = shardcst->getResourceIDList(MKTAG('D','I','B',' '));
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 1c78745330..f145364882 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -381,7 +381,9 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
break;
}
}
+}
+void Score::setSpriteCasts() {
// Set cast pointers to sprites
for (uint16 i = 0; i < _frames.size(); i++) {
for (uint16 j = 0; j < _frames[i]->_sprites.size(); j++) {
diff --git a/engines/director/score.h b/engines/director/score.h
index 9f6088307b..49e4f357b0 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -72,6 +72,7 @@ public:
int getCurrentFrame() { return _currentFrame; }
Common::String getMacName() const { return _macName; }
Sprite *getSpriteById(uint16 id);
+ void setSpriteCasts();
private:
void update();