diff options
author | Paul Gilbert | 2014-10-06 22:14:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-10-06 22:14:57 -0400 |
commit | de434e45d3828bb1c5b0c82711d0fe34bf14eed2 (patch) | |
tree | 27afc954a5e816c4f08b5cde99248b795d3d50ee /engines | |
parent | 9e6f3c5964962ca15f4663e75174ca87852334de (diff) | |
download | scummvm-rg350-de434e45d3828bb1c5b0c82711d0fe34bf14eed2.tar.gz scummvm-rg350-de434e45d3828bb1c5b0c82711d0fe34bf14eed2.tar.bz2 scummvm-rg350-de434e45d3828bb1c5b0c82711d0fe34bf14eed2.zip |
MADS: Fixes for loading of intro cutscene animation
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/animation.cpp | 4 | ||||
-rw-r--r-- | engines/mads/nebular/menu_nebular.cpp | 28 |
2 files changed, 23 insertions, 9 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 9b2c097004..ace505839c 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -242,7 +242,7 @@ void Animation::load(MSurface &backSurface, DepthSurface &depthSurface, for (int i = 0; i < _header._frameEntriesCount; i++) { AnimFrameEntry rec; - rec.load(frameStream, flags & ANIMFLAG_LOAD_BACKGROUND); + rec.load(frameStream, _header._bgType == ANIMBG_INTERFACE); _frameEntries.push_back(rec); } @@ -255,7 +255,7 @@ void Animation::load(MSurface &backSurface, DepthSurface &depthSurface, // Chunk 4: Misc Data Common::SeekableReadStream *miscStream = madsPack.getItemStream(streamIndex++); - if (flags & ANIMFLAG_LOAD_BACKGROUND) { + if (_header._bgType == ANIMBG_INTERFACE) { for (int i = 0; i < _header._miscEntriesCount; ++i) { AnimUIEntry rec; rec.load(miscStream); diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 4f9493ade5..1b71555e23 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -833,12 +833,13 @@ void AnimationView::load() { } void AnimationView::display() { + Scene &scene = _vm->_game->_scene; _vm->_palette->initPalette(); Common::fill(&_vm->_palette->_cyclingPalette[0], &_vm->_palette->_cyclingPalette[PALETTE_SIZE], 0); _vm->_palette->resetGamePalette(1, 8); - _vm->_game->_scene._spriteSlots.reset(); - _vm->_game->_scene._paletteCycles.clear(); + scene._spriteSlots.reset(); + scene._paletteCycles.clear(); MenuView::display(); } @@ -855,14 +856,22 @@ bool AnimationView::onEvent(Common::Event &event) { } void AnimationView::doFrame() { -// Scene &scene = _vm->_game->_scene; + Scene &scene = _vm->_game->_scene; // TODO: Or when current animation is finished if (_resourceIndex == -1) { - if (++_resourceIndex == (int)_resources.size()) + if (++_resourceIndex == (int)_resources.size()) { scriptDone(); - else + } else { + scene._frameStartTime = 0; loadNextResource(); + } + } + + if (_currentAnimation) { + ++scene._frameStartTime; + _currentAnimation->update(); +// scene._spriteSlots.fullRefresh(); } } @@ -876,7 +885,7 @@ void AnimationView::loadNextResource() { delete _currentAnimation; _currentAnimation = Animation::init(_vm, &scene); _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, - resEntry._resourceName, resEntry._bgFlag ? 0x100 : 0, + resEntry._resourceName, resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0, nullptr, _sceneInfo); // If a sound driver has been specified, then load the correct one @@ -903,6 +912,7 @@ void AnimationView::loadNextResource() { _vm->_audio->setSoundGroup(dsrName); // Initial frames scan loop + /* bool foundFrame = false; for (int frameCtr = 0; frameCtr < (int)_currentAnimation->_frameEntries.size(); ++frameCtr) { int spritesIdx = _currentAnimation->_spriteListIndexes[_manualFrameNumber]; @@ -917,7 +927,11 @@ void AnimationView::loadNextResource() { } } if (!foundFrame) - _hasManual = false; + */ + _hasManual = false; + + // Start the new animation + _currentAnimation->startAnimation(0); } void AnimationView::scriptDone() { |