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

dreammaster dreammaster at scummvm.org
Sun Oct 12 00:39:54 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:
e743621f23 MADS: Fix palette animations in cutscene animations


Commit: e743621f230caa807c24a8fc754f9391d43749f5
    https://github.com/scummvm/scummvm/commit/e743621f230caa807c24a8fc754f9391d43749f5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-11T18:21:49-04:00

Commit Message:
MADS: Fix palette animations in cutscene animations

Changed paths:
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/menu_nebular.h
    engines/mads/scene.h



diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index a85a67d..84db5a4 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -809,7 +809,6 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) {
 	_manualSpriteSet = nullptr;
 	_manualStartFrame = _manualEndFrame = 0;
 	_manualFrame2 = 0;
-	_hasManual = false;
 	_animFrameNumber = 0;
 	_sceneInfo = SceneInfo::init(_vm);
 
@@ -878,6 +877,7 @@ void AnimationView::loadNextResource() {
 	Scene &scene = _vm->_game->_scene;
 	Palette &palette = *_vm->_palette;
 	ResourceEntry &resEntry = _resources[_resourceIndex];
+	Common::Array<PaletteCycle> paletteCycles;
 
 	if (resEntry._bgFlag)
 		palette.resetGamePalette(1, 8);
@@ -887,7 +887,7 @@ void AnimationView::loadNextResource() {
 	_currentAnimation = Animation::init(_vm, &scene);
 	_currentAnimation->load(scene._backgroundSurface, scene._depthSurface, 
 		resEntry._resourceName, resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0,
-		nullptr, _sceneInfo);
+		&paletteCycles, _sceneInfo);
 
 	// Signal for a screen refresh
 	scene._spriteSlots.fullRefresh();
@@ -906,7 +906,6 @@ void AnimationView::loadNextResource() {
 	if (_currentAnimation->_header._manualFlag) {
 		_manualFrameNumber = _currentAnimation->_header._spritesIndex;
 		_manualSpriteSet = _currentAnimation->getSpriteSet(_manualFrameNumber);
-		_hasManual = true;
 	}
 
 	// Set the sound data for the animation
@@ -916,27 +915,11 @@ void AnimationView::loadNextResource() {
 	if (!dsrName.empty())
 		_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];
-		AnimFrameEntry &frame = _currentAnimation->_frameEntries[frameCtr];
-		
-		if (frame._spriteSlot._spritesIndex == spritesIdx) {
-			_animFrameNumber = frame._frameNumber;
-			_manualStartFrame = _animFrameNumber;
-			_manualEndFrame = _manualSpriteSet->getCount() - 1;
-			_manualFrame2 = _manualStartFrame - 1;
-			break;
-		}
-	}
-	if (!foundFrame)
-	*/
-	_hasManual = false;
-
 	// Start the new animation
 	_currentAnimation->startAnimation(0);
+
+	// If there were any palette cycles defined, start them up
+	scene.initPaletteAnimation(paletteCycles, true);
 }
 
 void AnimationView::scriptDone() {
diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h
index f8e84fa..ae063c6 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -281,7 +281,6 @@ private:
 	SpriteAsset *_manualSpriteSet;
 	int _manualStartFrame, _manualEndFrame;
 	int _manualFrame2;
-	bool _hasManual;
 	int _animFrameNumber;
 private:
 	void checkResource(const Common::String &resourceName);
diff --git a/engines/mads/scene.h b/engines/mads/scene.h
index ee7864c..9fd99ad 100644
--- a/engines/mads/scene.h
+++ b/engines/mads/scene.h
@@ -52,11 +52,6 @@ private:
 	 */
 	void loadVocabStrings();
 
-	/*
-	 * Initializes the data for palette animation within the scene
-	 */
-	void initPaletteAnimation(Common::Array<PaletteCycle> &palCycles, bool animFlag);
-
 	/**
 	 * Handles a single frame within the game scene
 	 */
@@ -204,6 +199,11 @@ public:
 	 */
 	void drawElements(ScreenTransition transitionType, bool surfaceFlag);
 
+	/*
+	* Initializes the data for palette animation within the scene
+	*/
+	void initPaletteAnimation(Common::Array<PaletteCycle> &palCycles, bool animFlag);
+
 	/**
 	* Handles cycling palette colors for the scene
 	*/






More information about the Scummvm-git-logs mailing list