[Scummvm-cvs-logs] scummvm master -> de434e45d3828bb1c5b0c82711d0fe34bf14eed2

dreammaster dreammaster at scummvm.org
Tue Oct 7 04:16:28 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
de434e45d3 MADS: Fixes for loading of intro cutscene animation


Commit: de434e45d3828bb1c5b0c82711d0fe34bf14eed2
    https://github.com/scummvm/scummvm/commit/de434e45d3828bb1c5b0c82711d0fe34bf14eed2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-06T22:14:57-04:00

Commit Message:
MADS: Fixes for loading of intro cutscene animation

Changed paths:
    engines/mads/animation.cpp
    engines/mads/nebular/menu_nebular.cpp



diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index 9b2c097..ace5058 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 4f9493a..1b71555 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() {






More information about the Scummvm-git-logs mailing list