[Scummvm-cvs-logs] scummvm master -> 1e15c02d1ea56439509926b68b9e393957241e65
dreammaster
dreammaster at scummvm.org
Sat Mar 14 19:39:34 CET 2015
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:
1e15c02d1e MADS: Fix animation of tying rope to the boat
Commit: 1e15c02d1ea56439509926b68b9e393957241e65
https://github.com/scummvm/scummvm/commit/1e15c02d1ea56439509926b68b9e393957241e65
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-03-14T14:38:22-04:00
Commit Message:
MADS: Fix animation of tying rope to the boat
Changed paths:
engines/mads/animation.cpp
engines/mads/animation.h
engines/mads/nebular/nebular_scenes5.cpp
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index 7e616bf..bda0bb6 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -436,10 +436,7 @@ void Animation::update() {
if (_vm->_game->_scene._frameStartTime < _nextFrameTimer)
return;
- for (uint idx = 0; idx < scene._spriteSlots.size(); ++idx) {
- if (scene._spriteSlots[idx]._seqIndex >= 0x80)
- scene._spriteSlots[idx]._flags = IMG_ERASE;
- }
+ eraseSprites();
// Validate the current frame
if (_currentFrame >= (int)_miscEntries.size()) {
@@ -604,4 +601,13 @@ void Animation::setNextFrameTimer(int frameNumber) {
_nextFrameTimer = frameNumber;
}
+void Animation::eraseSprites() {
+ Scene &scene = _vm->_game->_scene;
+
+ for (uint idx = 0; idx < scene._spriteSlots.size(); ++idx) {
+ if (scene._spriteSlots[idx]._seqIndex >= 0x80)
+ scene._spriteSlots[idx]._flags = IMG_ERASE;
+ }
+}
+
} // End of namespace MADS
diff --git a/engines/mads/animation.h b/engines/mads/animation.h
index 8b85a53..1c87273 100644
--- a/engines/mads/animation.h
+++ b/engines/mads/animation.h
@@ -219,6 +219,11 @@ public:
*/
void update();
+ /**
+ * Erases any sprites from the previous animation frame
+ */
+ void eraseSprites();
+
void setNextFrameTimer(int frameNumber);
int getNextFrameTimer() const { return _nextFrameTimer; }
void setCurrentFrame(int frameNumber);
diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp
index a76edac..2470137 100644
--- a/engines/mads/nebular/nebular_scenes5.cpp
+++ b/engines/mads/nebular/nebular_scenes5.cpp
@@ -2066,6 +2066,7 @@ void Scene511::actions() {
if (_game._trigger == 0) {
_game._player._stepEnabled = false;
_game._player._visible = false;
+ _game._player.update();
_lineAnimationMode = 1;
_lineAnimationPosition = 1;
_lineMoving = true;
@@ -2088,7 +2089,8 @@ void Scene511::actions() {
} else {
_vm->_dialogs->show(51130);
}
- } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) || _action.isAction(VERB_ATTACH, NOUN_FISHING_LINE, NOUN_BOAT)) {
+ } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) ||
+ _action.isAction(VERB_ATTACH, NOUN_FISHING_LINE, NOUN_BOAT)) {
if (_globals[kBoatRaised])
_vm->_dialogs->show(51131);
else if (_globals[kLineStatus] == 1)
@@ -2106,7 +2108,6 @@ void Scene511::actions() {
_scene->_sequences.addTimer(1, 1);
else {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount;
_globals._sequenceIndexes[7] = _scene->_sequences.startCycle(_globals._spriteIndexes[7], false, -2);
_scene->_sequences.setDepth(_globals._sequenceIndexes[7], 4);
int idx = _scene->_dynamicHotspots.add(NOUN_FISHING_LINE, VERB_WALKTO, _globals._sequenceIndexes[7], Common::Rect(0, 0, 0, 0));
@@ -2116,6 +2117,10 @@ void Scene511::actions() {
_lineMoving = true;
_globals[kLineStatus] = 3;
_game._player._stepEnabled = true;
+
+ if (_scene->_activeAnimation)
+ _scene->_activeAnimation->eraseSprites();
+ _game._player.update();
}
}
}
More information about the Scummvm-git-logs
mailing list