diff options
author | Dmitry Iskrich | 2016-06-17 15:26:41 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 6a0e3945cf220fb944599e20dbd3490aadb6673e (patch) | |
tree | 54b70c6e8cdf55129b3534a28439a4cdb86a3266 /engines | |
parent | 6b5c0626f7318542726bacce75a56b93af59fbe5 (diff) | |
download | scummvm-rg350-6a0e3945cf220fb944599e20dbd3490aadb6673e.tar.gz scummvm-rg350-6a0e3945cf220fb944599e20dbd3490aadb6673e.tar.bz2 scummvm-rg350-6a0e3945cf220fb944599e20dbd3490aadb6673e.zip |
DIRECTOR: Set engine pointer in Frame
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/score.cpp | 33 | ||||
-rw-r--r-- | engines/director/score.h | 3 |
2 files changed, 19 insertions, 17 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 8a40670cf7..04b61a6778 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -59,12 +59,25 @@ Score::Score(DirectorEngine *vm) { } void Score::loadArchive() { + Common::Array<uint16> clutList = _movieArchive->getResourceIDList(MKTAG('C','L','U','T')); + + if (clutList.size() > 1) + error("More than one palette was found"); + + if (clutList.size() == 0) + error("CLUT not found"); + + Common::SeekableReadStream *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]); + + loadPalette(*pal); + g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount()); assert(_movieArchive->hasResource(MKTAG('V','W','S','C'), 1024)); assert(_movieArchive->hasResource(MKTAG('V','W','C','F'), 1024)); assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024)); loadFrames(*_movieArchive->getResource(MKTAG('V','W','S','C'), 1024)); loadConfig(*_movieArchive->getResource(MKTAG('V','W','C','F'), 1024)); loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024)); + if (_movieArchive->hasResource(MKTAG('V','W','A','C'), 1024)) { loadActions(*_movieArchive->getResource(MKTAG('V','W','A','C'), 1024)); } @@ -95,20 +108,6 @@ void Score::loadArchive() { loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator)); } } - - - Common::Array<uint16> clutList = _movieArchive->getResourceIDList(MKTAG('C','L','U','T')); - - if (clutList.size() > 1) - error("More than one palette was found"); - - if (clutList.size() == 0) - error("CLUT not found"); - - Common::SeekableReadStream *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]); - - loadPalette(*pal); - g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount()); } Score::~Score() { @@ -148,7 +147,7 @@ void Score::loadFrames(Common::SeekableReadStream &stream) { uint16 channelSize; uint16 channelOffset; - Frame *initial = new Frame(); + Frame *initial = new Frame(_vm); _frames.push_back(initial); while (size != 0) { @@ -652,7 +651,8 @@ void Score::processEvents() { } } -Frame::Frame() { +Frame::Frame(DirectorEngine *vm) { + _vm = vm; _transDuration = 0; _transArea = 0; _transChunkSize = 0; @@ -676,6 +676,7 @@ Frame::Frame() { } Frame::Frame(const Frame &frame) { + _vm = frame._vm; _actionId = frame._actionId; _transArea = frame._transArea; _transDuration = frame._transDuration; diff --git a/engines/director/score.h b/engines/director/score.h index 9ac8685090..626e47b415 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -246,7 +246,7 @@ public: class Frame { public: - Frame(); + Frame(DirectorEngine *vm); Frame(const Frame &frame); ~Frame(); @@ -282,6 +282,7 @@ public: uint8 _blend; Common::Array<Sprite *> _sprites; Common::Array<Common::Rect > _drawRects; + DirectorEngine *_vm; }; class Score { |