aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-10-01 00:12:28 +0200
committerStrangerke2013-10-01 00:12:28 +0200
commit9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0 (patch)
tree0e542c0970e3377c5478359bf3afc16b1c860f3d /engines/avalanche
parent98b5fe757f2559acd90b05f20ce4425ab8c73b0f (diff)
downloadscummvm-rg350-9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0.tar.gz
scummvm-rg350-9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0.tar.bz2
scummvm-rg350-9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0.zip
AVALANCHE: Move several variables to make them private
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/animation.cpp6
-rw-r--r--engines/avalanche/avalanche.cpp3
-rw-r--r--engines/avalanche/avalanche.h16
-rw-r--r--engines/avalanche/avalot.cpp3
-rw-r--r--engines/avalanche/background.cpp15
-rw-r--r--engines/avalanche/background.h3
6 files changed, 26 insertions, 20 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f7f103d988..3de2c7c83c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -720,8 +720,8 @@ void Animation::callSpecial(uint16 which) {
case 3: // _vm->special 3: Room 71: triggers dart.
_sprites[0].bounce(); // Must include that.
- if (!_vm->_arrowTriggered) {
- _vm->_arrowTriggered = true;
+ if (!_arrowTriggered) {
+ _arrowTriggered = true;
appearPed(1, 3); // The dart starts at ped 4, and...
_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
_sprites[1]._facingDir = kDirUp; // Only face.
@@ -1285,6 +1285,7 @@ Direction Animation::getOldDirection() {
void Animation::resetVariables() {
_geidaSpin = 0;
_geidaTime = 0;
+ _arrowTriggered = false;
}
void Animation::synchronize(Common::Serializer &sz) {
@@ -1342,6 +1343,7 @@ void Animation::synchronize(Common::Serializer &sz) {
spr->appear(spr->_x, spr->_y, spr->_facingDir);
}
+ sz.syncAsByte(_arrowTriggered);
}
} // End of namespace Avalanche.
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 54bede1af9..251cc0c71a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -134,6 +134,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
_animation->synchronize(sz);
_parser->synchronize(sz);
_sequence->synchronize(sz);
+ _background->synchronize(sz);
sz.syncAsByte(_carryNum);
for (int i = 0; i < kObjectNum; i++)
@@ -171,7 +172,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
sz.syncAsByte(_bellsAreRinging);
sz.syncAsByte(_standingOnDais);
sz.syncAsByte(_takenPen);
- sz.syncAsByte(_arrowTriggered);
sz.syncAsByte(_arrowInTheDoor);
if (sz.isSaving()) {
@@ -257,7 +257,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
sz.syncAsByte(_catacombY);
sz.syncAsByte(_avvysInTheCupboard);
sz.syncAsByte(_geidaFollows);
- sz.syncAsByte(_nextBell);
sz.syncAsByte(_givenPotionToGeida);
sz.syncAsByte(_lustieIsAsleep);
sz.syncAsByte(_beenTiedUp);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e27848c1dc..db4434a009 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -181,7 +181,6 @@ public:
};
// These following static constants should be included in CFG when it's written.
- static const int16 kBorder = 1; // size of border on shadowboxes
static const int16 kWalk = 3;
static const int16 kRun = 5;
static const int32 kCatacombMap[8][8];
@@ -193,8 +192,6 @@ public:
static const char *kVersionNum;
static const char *kCopyright;
- static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
- static const int16 kGameCode = 2; // Avalot's code number
bool _holdLeftMouse;
@@ -208,7 +205,6 @@ public:
int16 _dnascore; // your score, of course
int32 _money; // your current amount of dosh
Room _room; // your current room
- byte _roomCount[100]; // Add one to each every time you enter a room
bool _wonNim; // Have you *won* Nim? (That's harder.)
byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
@@ -221,7 +217,6 @@ public:
byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
byte _brummieStairs; // Progression through the stairs trick.
byte _cardiffQuestionNum; // Things you get asked in Cardiff.
- bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
bool _avvyInBed; // True if Avvy's in bed, but awake.
bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
@@ -235,15 +230,11 @@ public:
bool _bellsAreRinging; // Is Jacques ringing the bells?
bool _standingOnDais; // In room 71, inside Cardiff Castle.
bool _takenPen; // Have you taken the pen (in Cardiff?)
- bool _arrowTriggered; // And has the arrow been triggered?
bool _arrowInTheDoor; // Did the arrow hit the wall?
Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
uint32 _totalTime; // Your total time playing this game, in ticks.
byte _jumpStatus; // Fixes how high you're jumping.
bool _mushroomGrowing; // Is the mushroom growing in 42?
- bool _spludwickAtHome; // Is Spludwick at home?
- byte _lastRoom;
- byte _lastRoomNotMap;
bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
bool _enterCatacombsFromLustiesRoom;
bool _teetotal; // Are we touching any more drinks?
@@ -253,7 +244,6 @@ public:
byte _catacombX, _catacombY; // XY coords in the catacombs.
bool _avvysInTheCupboard; // On screen 22.
bool _geidaFollows; // Is Geida following you?
- byte _nextBell; // For the ringing.
bool _givenPotionToGeida; // Does Geida have the potion?
bool _lustieIsAsleep; // Is BDL asleep?
bool _beenTiedUp; // In r__Robins.
@@ -366,6 +356,12 @@ public:
private:
static Room _whereIs[29];
+ bool _spludwickAtHome; // Is Spludwick at home?
+ byte _lastRoom;
+ byte _lastRoomNotMap;
+ bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+ byte _roomCount[100]; // Add one to each every time you enter a room
+
Common::File file;
Common::String readAlsoStringFromFile();
void scram(Common::String &str);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 1e739709b1..922be91806 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1455,7 +1455,6 @@ void AvalancheEngine::resetVariables() {
_bellsAreRinging = false;
_standingOnDais = false;
_takenPen = false;
- _arrowTriggered = false;
_arrowInTheDoor = false;
_favouriteDrink = "";
_favouriteSong = "";
@@ -1477,7 +1476,6 @@ void AvalancheEngine::resetVariables() {
_catacombY = 0;
_avvysInTheCupboard = false;
_geidaFollows = false;
- _nextBell = 0;
_givenPotionToGeida = false;
_lustieIsAsleep = false;
_beenTiedUp = false;
@@ -1491,6 +1489,7 @@ void AvalancheEngine::resetVariables() {
_parser->resetVariables();
_animation->resetVariables();
_sequence->resetVariables();
+ _background->resetVariables();
}
void AvalancheEngine::newGame() {
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 0d350c17e3..e72e4a4cca 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -250,11 +250,11 @@ void Background::update() {
// They're ringing the bells.
switch (_vm->_roomTime % 4) {
case 1:
- if (_vm->_nextBell < 5)
- _vm->_nextBell = 12;
- _vm->_nextBell--;
+ if (_nextBell < 5)
+ _nextBell = 12;
+ _nextBell--;
// CHECKME: 2 is a guess. No length in the original?
- _vm->_sound->playNote(_vm->kNotes[_vm->_nextBell], 2);
+ _vm->_sound->playNote(_vm->kNotes[_nextBell], 2);
break;
case 2:
_vm->_sound->stopSound();
@@ -367,4 +367,11 @@ void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
_vm->_graphics->drawBackgroundSprite(x, y - 10, sprite);
}
+void Background::resetVariables() {
+ _nextBell = 0;
+}
+
+void Background::synchronize(Common::Serializer &sz) {
+ sz.syncAsByte(_nextBell);
+}
} // End of namespace Avalanche.
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 36bb1d486e..f4fcd38b9b 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -62,10 +62,13 @@ public:
// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
void draw(int16 destX, int16 destY, byte sprId);
+ void resetVariables();
+ void synchronize(Common::Serializer &sz);
private:
AvalancheEngine *_vm;
+ byte _nextBell; // For the ringing.
int32 _offsets[40];
byte _spriteNum;
SpriteType _sprites[40];