aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-09-27 00:33:08 +0200
committerStrangerke2013-09-27 00:33:08 +0200
commite166f6fc44be9322cd502520af0cd1daa6b07813 (patch)
treef5753e6a5be359cac8ab5652f07e25dd093e54b1 /engines/avalanche
parent75cbbda822714fdc07906adcdb123a2eab217089 (diff)
downloadscummvm-rg350-e166f6fc44be9322cd502520af0cd1daa6b07813.tar.gz
scummvm-rg350-e166f6fc44be9322cd502520af0cd1daa6b07813.tar.bz2
scummvm-rg350-e166f6fc44be9322cd502520af0cd1daa6b07813.zip
AVALANCHE: Move a couple of variables to Sequence, more private variables
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/avalanche.cpp2
-rw-r--r--engines/avalanche/avalot.cpp3
-rw-r--r--engines/avalanche/avalot.h2
-rw-r--r--engines/avalanche/sequence.cpp13
-rw-r--r--engines/avalanche/sequence.h32
5 files changed, 28 insertions, 24 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 339d027cf9..222414ca02 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -242,8 +242,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
sz.syncAsByte(_avalot->_nextBell);
sz.syncAsByte(_avalot->_givenPotionToGeida);
sz.syncAsByte(_avalot->_lustieIsAsleep);
- sz.syncAsByte(_avalot->_flipToWhere);
- sz.syncAsByte(_avalot->_flipToPed);
sz.syncAsByte(_avalot->_beenTiedUp);
sz.syncAsByte(_avalot->_sittingInPub);
sz.syncAsByte(_avalot->_spurgeTalkCount);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 397d1b7a3c..6bf1b46913 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1616,8 +1616,6 @@ void Avalot::resetVariables() {
_nextBell = 0;
_givenPotionToGeida = false;
_lustieIsAsleep = false;
- _flipToWhere = kRoomNowhere;
- _flipToPed = 0;
_beenTiedUp = false;
_sittingInPub = false;
_spurgeTalkCount = 0;
@@ -1628,6 +1626,7 @@ void Avalot::resetVariables() {
_vm->_parser->resetVariables();
_vm->_animation->resetVariables();
+ _vm->_sequence->resetVariables();
}
void Avalot::newGame() {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index fa61690246..a80d80d275 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -225,8 +225,6 @@ public:
byte _nextBell; // For the ringing.
bool _givenPotionToGeida; // Does Geida have the potion?
bool _lustieIsAsleep; // Is BDL asleep?
- Room _flipToWhere;
- byte _flipToPed; // For the sequencer.
bool _beenTiedUp; // In r__Robins.
bool _sittingInPub; // Are you sitting down in the pub?
byte _spurgeTalkCount; // Count for talking to Spurge.
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 707cd9f300..bbbbf6229c 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -41,6 +41,11 @@ Sequence::Sequence(AvalancheEngine *vm) {
_vm = vm;
}
+void Sequence::resetVariables() {
+ _flipToWhere = kRoomNowhere;
+ _flipToPed = 0;
+}
+
void Sequence::init(byte what) {
_seq[0] = what;
@@ -60,8 +65,8 @@ void Sequence::add(byte what) {
void Sequence::switchRoom(Room where, byte ped) {
add(kNowFlip);
- _vm->_avalot->_flipToWhere = where;
- _vm->_avalot->_flipToPed = ped;
+ _flipToWhere = where;
+ _flipToPed = ped;
}
void Sequence::startTimer() {
@@ -90,7 +95,7 @@ void Sequence::callSequencer() {
break;
case kNowFlip: // Flip room.
_vm->_avalot->_userMovesAvvy = true;
- _vm->_avalot->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
+ _vm->_avalot->flipRoom(_flipToWhere, _flipToPed);
// CHECKME: Always true?
if (curSeq == kNowFlip)
shoveLeft();
@@ -215,5 +220,7 @@ void Sequence::startDummySeq(Room whither, byte ped) {
void Sequence::synchronize(Common::Serializer &sz) {
sz.syncBytes(_seq, kSeqLength);
+ sz.syncAsByte(_flipToWhere);
+ sz.syncAsByte(_flipToPed);
}
} // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 7f164853e1..94025babf4 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -27,8 +27,8 @@
/* SEQUENCE The sequencer. */
-#ifndef AVALANCHE_SEQUENCE2_H
-#define AVALANCHE_SEQUENCE2_H
+#ifndef AVALANCHE_SEQUENCE_H
+#define AVALANCHE_SEQUENCE_H
#include "common/scummsys.h"
@@ -40,12 +40,24 @@ private:
static const int16 kNowFlip = 177;
static const int16 kSeqLength = 10;
-public:
byte _seq[kSeqLength];
+ Room _flipToWhere;
+ byte _flipToPed;
+
+ AvalancheEngine *_vm;
+
+ void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
+ void init(byte what);
+ void add(byte what);
+ void switchRoom(Room where, byte ped);
+ void startTimer();
+ void startTimerImmobilized();
+
+public:
Sequence(AvalancheEngine *vm);
void synchronize(Common::Serializer &sz);
-
+ void resetVariables();
void callSequencer();
void startCupboardSeq();
@@ -63,18 +75,8 @@ public:
void startDuckSeq();
void startCardiffSeq2();
void startDummySeq(Room whither, byte ped);
-
-private:
- AvalancheEngine *_vm;
-
- void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
- void init(byte what);
- void add(byte what);
- void switchRoom(Room where, byte ped);
- void startTimer();
- void startTimerImmobilized();
};
} // End of namespace Avalanche.
-#endif // AVALANCHE_SEQUENCE2_H
+#endif // AVALANCHE_SEQUENCE_H