aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-23 13:52:32 -0400
committerPaul Gilbert2014-03-23 13:52:32 -0400
commit9ef27c4ea0359d3dce74c49b5f2e9b37050097ae (patch)
treea499c8df1026bdd66fb8858a90ac4c84a32e53c5 /engines
parent1a54ae3de856ddc69004bc57a0aee043772490d7 (diff)
downloadscummvm-rg350-9ef27c4ea0359d3dce74c49b5f2e9b37050097ae.tar.gz
scummvm-rg350-9ef27c4ea0359d3dce74c49b5f2e9b37050097ae.tar.bz2
scummvm-rg350-9ef27c4ea0359d3dce74c49b5f2e9b37050097ae.zip
MADS: Moved sub71312 method to be SequenceList::setMsgLayout
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/nebular/game_nebular.cpp8
-rw-r--r--engines/mads/nebular/game_nebular.h2
-rw-r--r--engines/mads/nebular/nebular_scenes1.cpp4
-rw-r--r--engines/mads/nebular/nebular_scenes2.cpp14
-rw-r--r--engines/mads/sequence.cpp22
-rw-r--r--engines/mads/sequence.h3
6 files changed, 28 insertions, 25 deletions
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 52e8913eb3..e5c344b738 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -194,14 +194,6 @@ void GameNebular::checkShowDialog() {
}
}
-void GameNebular::sub71312(int idx) {
- int yp = _player._playerPos.y + (_player._yScale * _player._currentScale) / 100;
- _scene._sequences.setMsgPosition(idx, Common::Point(_player._playerPos.x, yp));
- _scene._sequences.setDepth(idx, _player._currentDepth);
- _scene._sequences.setScale(idx, _player._currentScale);
- _scene._sequences.getTimeout(-1, idx);
-}
-
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h
index 0197766b8f..685e5c7cd6 100644
--- a/engines/mads/nebular/game_nebular.h
+++ b/engines/mads/nebular/game_nebular.h
@@ -65,8 +65,6 @@ protected:
public:
Globals _globals;
StoryMode _storyMode;
-
- void sub71312(int idx);
};
diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp
index 9070bca722..d6287de993 100644
--- a/engines/mads/nebular/nebular_scenes1.cpp
+++ b/engines/mads/nebular/nebular_scenes1.cpp
@@ -285,7 +285,7 @@ void Scene103::actions() {
_scene->changeDepthSurface(1);
_globals._spriteIndexes[28] = _scene->_sequences.startReverseCycle(
_globals._spriteIndexes[13], false, 3, 2);
- _game.sub71312(_globals._spriteIndexes[28]);
+ _scene->_sequences.setMsgLayout(_globals._spriteIndexes[28]);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[28], SM_FRAME_INDEX, 7, 1);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[28], SM_0, 0, 2);
@@ -317,7 +317,7 @@ void Scene103::actions() {
_scene->changeDepthSurface(1);
_globals._spriteIndexes[27] = _scene->_sequences.startReverseCycle(
_globals._spriteIndexes[12], false, 3, 2);
- _game.sub71312(_globals._spriteIndexes[27]);
+ _scene->_sequences.setMsgLayout(_globals._spriteIndexes[27]);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[27], SM_FRAME_INDEX, 6, 1);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[27], SM_0, 0, 2);
diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp
index 458cd1d844..0e297e10ba 100644
--- a/engines/mads/nebular/nebular_scenes2.cpp
+++ b/engines/mads/nebular/nebular_scenes2.cpp
@@ -541,8 +541,8 @@ void Scene202::step() {
_scene->_hotspots.activate(199, false);
int idx = _scene->_dynamicHotspots.add(457, 13, _globals._spriteIndexes[20], Common::Rect(0, 0, 0, 0));
_scene->_dynamicHotspots.setPosition(idx, 246, 124, 8);
- _scene->_sequences.getTimeout(_globals._spriteIndexes[26], _globals._spriteIndexes[20]);
- _scene->_sequences.getTimeout(-1, _globals._spriteIndexes[26]);
+ _scene->_sequences.updateTimeout(_globals._spriteIndexes[26], _globals._spriteIndexes[20]);
+ _scene->_sequences.updateTimeout(-1, _globals._spriteIndexes[26]);
_game._player._stepEnabled = true;
_game._player._visible = true;
_globals._v4 = false;
@@ -729,7 +729,7 @@ void Scene202::preActions() {
_scene->_sequences.setDepth(_globals._spriteIndexes[23], 1);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[23], SM_0, 0, 1);
} else if (_game._abortTimers == 1) {
- _scene->_sequences.getTimeout(-1, _globals._spriteIndexes[23]);
+ _scene->_sequences.updateTimeout(-1, _globals._spriteIndexes[23]);
warning("CHECKME: _scene->_dynamicHotspots.remove(_globals._frameTime);");
_scene->_dynamicHotspots.remove(_globals._frameTime);
_game._player._visible = true;
@@ -777,7 +777,7 @@ void Scene202::actions() {
_game._player._stepEnabled = false;
_game._player._visible = false;
_globals._spriteIndexes[22] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], false, 3, 2, 0, 0);
- _game.sub71312(_globals._spriteIndexes[22]);
+ _scene->_sequences.setMsgLayout(_globals._spriteIndexes[22]);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[22], SM_FRAME_INDEX, 6, 1);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[22], SM_0, 0, 2);
}
@@ -823,7 +823,7 @@ void Scene202::actions() {
_globals._spriteIndexes[24] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], true, 1);
_scene->_sequences.setMsgPosition(_globals._spriteIndexes[24], Common::Point(247, 82));
_scene->_sequences.setDepth(_globals._spriteIndexes[24], 1);
- _scene->_sequences.getTimeout(_globals._spriteIndexes[23], _globals._spriteIndexes[24]);
+ _scene->_sequences.updateTimeout(_globals._spriteIndexes[23], _globals._spriteIndexes[24]);
_globals._v4 = -1;
_game._player._stepEnabled = true;
int msgIndex = _scene->_kernelMessages.add(Common::Point(248, 15), 0x1110, 32, 0, 60, _game.getQuote(97));
@@ -841,7 +841,7 @@ void Scene202::actions() {
_scene->_sequences.setAnimRange(_globals._spriteIndexes[25], 1, 6);
_scene->_sequences.setMsgPosition(_globals._spriteIndexes[25], Common::Point(172, 123));
_scene->_sequences.setDepth(_globals._spriteIndexes[25], 1);
- _scene->_sequences.getTimeout(-1, _globals._spriteIndexes[25]);
+ _scene->_sequences.updateTimeout(-1, _globals._spriteIndexes[25]);
_scene->_sequences.addSubEntry(_globals._spriteIndexes[25], SM_0, 0, 1);
} else if (_game._abortTimers == 1) {
_globals._spriteIndexes[25] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], false, 6);
@@ -864,7 +864,7 @@ void Scene202::actions() {
_scene->_sequences.setMsgPosition(_globals._spriteIndexes[25], Common::Point(172, 123));
_scene->_sequences.addSubEntry(_globals._spriteIndexes[25], SM_0, 0, 3);
} else if (_game._abortTimers == 3) {
- _scene->_sequences.getTimeout(-1, _globals._spriteIndexes[25]);
+ _scene->_sequences.updateTimeout(-1, _globals._spriteIndexes[25]);
_game._player._stepEnabled = true;
_game._player._visible = true;
} else {
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index 53ed02a566..bb2454d3fc 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -473,21 +473,33 @@ int SequenceList::startReverseCycle(int srcSpriteIndex, bool flipped, int numTic
numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_REVERSIBLE, 0, 0);
}
-void SequenceList::getTimeout(int spriteIdx, int arg2) {
+void SequenceList::updateTimeout(int spriteIdx, int seqIndex) {
+ Player &player = _vm->_game->_player;
int timeout;
+
if (spriteIdx >= 0)
timeout = _entries[spriteIdx]._timeout;
else
- timeout = _vm->_game->_player._priorTimer + _vm->_game->_player._ticksAmount;
+ timeout = player._priorTimer + player._ticksAmount;
- if (arg2 >= 0)
- _entries[arg2]._timeout = timeout;
+ if (seqIndex >= 0)
+ _entries[seqIndex]._timeout = timeout;
else
- _vm->_game->_player._priorTimer = timeout - _vm->_game->_player._ticksAmount;
+ player._priorTimer = timeout - player._ticksAmount;
}
void SequenceList::setScale(int spriteIdx, int scale) {
_entries[spriteIdx]._scale = scale;
}
+
+void SequenceList::setMsgLayout(int seqIndex) {
+ Player &player = _vm->_game->_player;
+ int yp = player._playerPos.y + (player._yScale * player._currentScale) / 100;
+ setMsgPosition(seqIndex, Common::Point(player._playerPos.x, yp));
+ setDepth(seqIndex, player._currentDepth);
+ setScale(seqIndex, player._currentScale);
+ updateTimeout(-1, seqIndex);
+}
+
} // End of namespace
diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h
index f8051bde75..f24a2bd659 100644
--- a/engines/mads/sequence.h
+++ b/engines/mads/sequence.h
@@ -118,8 +118,9 @@ public:
int startCycle(int srcSpriteIdx, bool flipped, int cycleIndex);
int startReverseCycle(int srcSpriteIndex, bool flipped, int numTicks,
int triggerCountdown = 0, int timeoutTicks = 0, int extraTicks = 0);
- void getTimeout(int spriteIdx, int arg2);
+ void updateTimeout(int spriteIdx, int seqIndex);
void setScale(int spriteIdx, int scale);
+ void setMsgLayout(int seqIndex);
};
} // End of namespace MADS