aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/avalanche/avalanche.h54
-rw-r--r--engines/avalanche/avalot.cpp11
-rw-r--r--engines/avalanche/dialogs.cpp6
-rw-r--r--engines/avalanche/dialogs.h1
-rw-r--r--engines/avalanche/menu.cpp14
-rw-r--r--engines/avalanche/menu.h2
-rw-r--r--engines/avalanche/parser.cpp4
-rw-r--r--engines/avalanche/parser.h2
8 files changed, 41 insertions, 53 deletions
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f024f247fa..cbbc469ac5 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -277,46 +277,27 @@ public:
byte _cp, _ledStatus;
FontType _font;
bool _alive;
- int16 _underScroll; // Y-coord of just under the scroll text.
- Common::String _roomnName; // Name of actual room
- Common::String _subject; // What you're talking to them about.
byte _subjectNum; // The same thing.
- bool _keyboardClick; // Is a keyboard click noise wanted?
People _him, _her;
byte _it;
uint32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
- People _lastPerson; // Last person to have been selected using the People menu.
bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
- bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
bool _isLoaded; // Is it a loaded gamestate?
bool _soundFx;
- void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
- void setup();
- void runAvalot();
-
- void init();
void callVerb(VerbCode id);
void loadRoom(byte num);
- void exitRoom(byte x);
- void enterRoom(Room room, byte ped);
void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
- void drawToolbar();
- void drawScore();
void incScore(byte num); // Add on no. of points
- void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
void fxToggle();
void refreshObjectList();
- void checkClick();
void errorLed();
void dusk();
void dawn();
void drawDirection(); // Draws the little icon at the left end of the text input field.
void gameOver();
uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
- void fixFlashers();
- void loadAlso(byte num);
// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
void minorRedraw();
@@ -326,12 +307,13 @@ public:
Common::String intToStr(int32 num);
- void resetVariables();
+
+
+
+
void newGame(); // This sets up the DNA for a completely new game.
- void slowDown();
bool getFlag(char x);
bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
- void hangAroundForAWhile();
Common::String getName(People whose);
byte getNameChar(People whose);
@@ -348,31 +330,45 @@ public:
private:
static Room _whereIs[29];
+ // Will be used in dusk() and dawn().
+ bool _fxHidden;
bool _spludwickAtHome; // Is Spludwick at home?
+ bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+ bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
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::String _mouseText;
Common::String _flags;
+ Common::String _roomnName; // Name of actual room
int8 _scoreToDisplay[3];
Common::File file;
Common::String readAlsoStringFromFile();
+
+ void runAvalot();
+ void init();
+ void setup();
void scram(Common::String &str);
void unScramble();
-
+ void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
void enterNewTown();
void findPeople(byte room);
void putGeidaAt(byte whichPed, byte ped);
void guideAvvy(Common::Point cursorPos);
-
- // Will be used in dusk() and dawn().
- bool _fxHidden;
-
- int8 fades(int8 x);
void fadeOut(byte n);
void fadeIn(byte n);
+ void enterRoom(Room room, byte ped);
+ void exitRoom(byte x);
+ void drawToolbar();
+ void drawScore();
+ void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
+ void checkClick();
+ void fixFlashers();
+ void loadAlso(byte num);
+ void resetVariables();
+
+ int8 fades(int8 x);
};
} // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0c5685bf36..29224c1009 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1485,6 +1485,7 @@ void AvalancheEngine::resetVariables() {
_animation->resetVariables();
_sequence->resetVariables();
_background->resetVariables();
+ _menu->resetVariables();
}
void AvalancheEngine::newGame() {
@@ -1524,7 +1525,6 @@ void AvalancheEngine::newGame() {
_him = kPeoplePardon;
_her = kPeoplePardon;
_it = Parser::kPardon;
- _lastPerson = kPeoplePardon; // = Pardon?
_passwordNum = _rnd->getRandomNumber(29) + 1; //Random(30) + 1;
_userMovesAvvy = false;
_doingSpriteRun = false;
@@ -1538,10 +1538,6 @@ void AvalancheEngine::newGame() {
spriteRun();
}
-void AvalancheEngine::slowDown() {
- warning("STUB: slowdown()");
-}
-
bool AvalancheEngine::getFlag(char x) {
for (uint16 i = 0; i < _flags.size(); i++) {
if (_flags[i] == x)
@@ -1708,11 +1704,6 @@ Common::String AvalancheEngine::f5Does() {
return Common::String::format("%c", kVerbCodePardon); // If all else fails...
}
-void AvalancheEngine::hangAroundForAWhile() {
- for (int i = 0; i < 28; i++)
- slowDown();
-}
-
void AvalancheEngine::flipRoom(Room room, byte ped) {
assert((ped > 0) && (ped < 15));
if (!_alive) {
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index f04c233809..926f6624b5 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -354,12 +354,12 @@ void Dialogs::ringBell() { // Pussy's in the well. Who put her in? Little...
void Dialogs::dodgem() {
_dodgeCoord = _vm->getMousePos();
- g_system->warpMouse(_dodgeCoord.x, _vm->_underScroll); // Move the pointer off the scroll.
+ g_system->warpMouse(_dodgeCoord.x, _underScroll); // Move the pointer off the scroll.
}
void Dialogs::unDodgem() {
Common::Point actCoord = _vm->getMousePos();
- if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_underScroll))
+ if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _underScroll))
g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
}
@@ -436,7 +436,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
my += 12;
}
- _vm->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+ _underScroll = (my + 3) * 2; // Multiplying because of the doubled screen height.
ringBell();
_vm->_dropsOk = false;
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 9c70767eb1..9cd4e729d4 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -105,6 +105,7 @@ private:
byte _scrollBells; // no. of times to ring the bell
byte _buffer[2000];
uint16 _bufSize;
+ int16 _underScroll; // Y-coord of just under the scroll text.
// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
void scrollModeNormal();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 23c49cc121..92949c5be2 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -478,11 +478,11 @@ void Menu::setupMenuWith() {
// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
// or (c), the _person you've selected is YOU!
- if ((_vm->_lastPerson == kPeopleAvalot) || (_vm->_lastPerson == _vm->_parser->kNothing)
- || (_vm->getRoom(_vm->_lastPerson) != _vm->_room))
+ if ((_lastPerson == kPeopleAvalot) || (_lastPerson == _vm->_parser->kNothing)
+ || (_vm->getRoom(_lastPerson) != _vm->_room))
_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
else {
- _activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_vm->_lastPerson), 'G', "", true);
+ _activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_lastPerson), 'G', "", true);
_verbStr = _verbStr + kVerbCodeGive;
}
} else {
@@ -611,7 +611,7 @@ void Menu::runMenuObjects() {
void Menu::runMenuPeople() {
_vm->thinkAbout(people[_activeMenuItem._choiceNum], AvalancheEngine::kPerson);
- _vm->_lastPerson = (People)people[_activeMenuItem._choiceNum];
+ _lastPerson = (People)people[_activeMenuItem._choiceNum];
}
void Menu::runMenuWith() {
@@ -621,7 +621,7 @@ void Menu::runMenuWith() {
_vm->_parser->_thing += 49;
if (_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
- _vm->_parser->_person = _vm->_lastPerson;
+ _vm->_parser->_person = _lastPerson;
else
_vm->_parser->_person = kPeoplePardon;
} else {
@@ -771,4 +771,8 @@ bool Menu::isActive() {
void Menu::init() {
_menuActive = false;
}
+
+void Menu::resetVariables() {
+ _lastPerson = kPeoplePardon; // = Pardon?
+}
} // End of namespace Avalanche.
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index ef74e73d1d..5de54a2dc8 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -128,6 +128,7 @@ public:
void setup(); // Standard menu bar.
bool isActive();
void init();
+ void resetVariables();
private:
static const byte kIndent = 5;
@@ -141,6 +142,7 @@ private:
Common::String _verbStr; // what you can do with your object. :-)
bool _menuActive; // Kludge so we don't have to keep referring to the menu.
+ People _lastPerson; // Last person to have been selected using the People menu.
AvalancheEngine *_vm;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 2064fa7dec..beb683a2ce 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -820,8 +820,6 @@ void Parser::parse() {
}
// Second parsing.
- if (!_vm->_subject.empty())
- _vm->_subject.clear();
_vm->_subjectNum = 0; // Find subject of conversation.
for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
@@ -1380,7 +1378,6 @@ void Parser::drink() {
_vm->_avvyInBed = true;
_vm->refreshObjectList();
_vm->dusk();
- _vm->hangAroundForAWhile();
_vm->flipRoom(kRoomYours, 1);
_vm->_graphics->setBackgroundColor(kColorYellow);
_vm->_animation->_sprites[0]._visible = false;
@@ -2284,7 +2281,6 @@ void Parser::doThat() {
}
} else { // Default doodah.
_vm->dusk();
- _vm->hangAroundForAWhile();
_vm->dawn();
Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
_vm->_dialogs->displayText(tmpStr);
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index f20aa9015a..4ebf559d85 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -148,9 +148,7 @@ private:
void winSequence();
Common::String personSpeaks();
void heyThanks();
-
void wipeText();
-
};
} // End of namespace Avalanche