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

dreammaster dreammaster at scummvm.org
Mon Oct 13 15:04:44 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:
fc2a579f2e MADS: Further fixes for palette cycling during animations


Commit: fc2a579f2e44879217b9d16d264eaafeea680de4
    https://github.com/scummvm/scummvm/commit/fc2a579f2e44879217b9d16d264eaafeea680de4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-13T09:03:50-04:00

Commit Message:
MADS: Further fixes for palette cycling during animations

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



diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 069557d..d5d7021 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -810,6 +810,7 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) {
 	_manualStartFrame = _manualEndFrame = 0;
 	_manualFrame2 = 0;
 	_animFrameNumber = 0;
+	_nextCyclingActive = false;
 	_sceneInfo = SceneInfo::init(_vm);
 
 	load();
@@ -864,6 +865,8 @@ void AnimationView::doFrame() {
 			scene._frameStartTime = 0;
 			loadNextResource();
 		}
+	} else if (_currentAnimation->getCurrentFrame() == 1) {
+		scene._cyclingActive = _nextCyclingActive;
 	}
 
 	if (_currentAnimation) {
@@ -923,11 +926,12 @@ void AnimationView::loadNextResource() {
 		&palette._cyclingPalette[0]);
 
 	_vm->_game->_fx = (ScreenTransition)resEntry._fx;
+	_nextCyclingActive = paletteCycles.size() > 0;
 	if (!_vm->_game->_fx) {
 		palette.setFullPalette(palette._mainPalette);
 	}
 
-	scene.initPaletteAnimation(paletteCycles, (paletteCycles.size() > 0) && !_vm->_game->_fx);
+	scene.initPaletteAnimation(paletteCycles, _nextCyclingActive && !_vm->_game->_fx);
 }
 
 void AnimationView::scriptDone() {
@@ -965,8 +969,12 @@ void AnimationView::processLines() {
 					resName += c;
 				}
 
+				// Add resource into list along with any set state information
 				_resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, 
 					_bgLoadFlag, _showWhiteBars));
+
+				// Fx resets between resource entries
+				_sfx = 0;
 			}
 
 			// Skip any spaces
diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h
index ae063c6..c05c872 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -282,6 +282,7 @@ private:
 	int _manualStartFrame, _manualEndFrame;
 	int _manualFrame2;
 	int _animFrameNumber;
+	bool _nextCyclingActive;
 private:
 	void checkResource(const Common::String &resourceName);
 
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index 2101a85..b0a5aa3 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -299,6 +299,7 @@ void SceneInfo::loadPalette(int sceneId, int artFileNum, const Common::String &r
 	delete stream;
 
 	// Copy out the palette animation data
+	_paletteCycles.clear();
 	for (uint i = 0; i < artHeader._paletteCycles.size(); ++i)
 		_paletteCycles.push_back(artHeader._paletteCycles[i]);
 






More information about the Scummvm-git-logs mailing list