diff options
author | Strangerke | 2013-09-07 09:00:34 +0200 |
---|---|---|
committer | Strangerke | 2013-09-07 09:00:34 +0200 |
commit | e859e17e3b7753fdae839cd78f04a9370b85bb40 (patch) | |
tree | 6aaf4862ed8b9e018920dc053dcdc099bfc43585 | |
parent | 7be84e9d52cb90bd14a84926bbad34da707ea5d6 (diff) | |
download | scummvm-rg350-e859e17e3b7753fdae839cd78f04a9370b85bb40.tar.gz scummvm-rg350-e859e17e3b7753fdae839cd78f04a9370b85bb40.tar.bz2 scummvm-rg350-e859e17e3b7753fdae839cd78f04a9370b85bb40.zip |
AVALANCHE: Janitorial - Remove trailing spaces, fix define names
34 files changed, 293 insertions, 347 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 2df42e4542..882fc3d3ed 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -190,7 +190,7 @@ const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = { {255, "SOME"}, {255, "AND"}, {255, "THAT"}, {255, "POCUS"}, {255, "HIS"}, {255, "THIS"}, {255, "SENTINEL"} // for "Ken SENT Me" -}; +}; Acci::Acci(AvalancheEngine *vm) { _vm = vm; @@ -210,7 +210,7 @@ void Acci::clearWords() { byte Acci::wordNum(Common::String word) { if (word.empty()) return 0; - + for (int32 i = kParserWordsNum - 1; i >= 0; i--) { if (kVocabulary[i]._word == word) return kVocabulary[i]._number; @@ -258,7 +258,7 @@ Common::String Acci::rank() { Common::String Acci::totalTime() { // There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour. - const double ticksInOneSec = (double)(65535) / 3600; + const double ticksInOneSec = (double)(65535) / 3600; uint16 h, m, s; h = _vm->_gyro->_dna._totalTime / ticksInOneSec; // No. of seconds. @@ -302,7 +302,7 @@ void Acci::stripPunctuation(Common::String &word) { -void Acci::displayWhat(byte target, bool animate, bool &ambiguous) { +void Acci::displayWhat(byte target, bool animate, bool &ambiguous) { if (target == kPardon) { ambiguous = true; if (animate) @@ -314,7 +314,7 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) { _vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getName(target) + " }"); else { Common::String z = _vm->_gyro->getItem(target); - if (z != "") + if (z != "") _vm->_scrolls->display(Common::String("{ ") + z + " }"); } } @@ -357,7 +357,7 @@ void Acci::properNouns() { if (_vm->_parser->_inputText[i] == ' ') _vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1); } - + // And the first character as well. _vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0); } @@ -365,7 +365,7 @@ void Acci::properNouns() { void Acci::sayIt() { Common::String x = _vm->_parser->_inputText; x.setChar(toupper(x[0]), 0); - _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x + _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x + '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2'); } @@ -378,7 +378,7 @@ void Acci::storeInterrogation(byte interrogation) { _vm->_parser->_inputText.deleteChar(0); while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty())) _vm->_parser->_inputText.deleteLastChar(); - + _vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement. switch (interrogation) { @@ -428,7 +428,7 @@ void Acci::parse() { // First parsing - word identification if (!_thats.empty()) _thats.clear(); - + byte n = 0; _polite = false; _verb = kPardon; @@ -512,7 +512,7 @@ void Acci::parse() { } } - if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) + if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) _unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)]; else if (!_unknown.empty()) _unknown.clear(); @@ -521,7 +521,7 @@ void Acci::parse() { replace(Common::String('\xFF'), 0); // zap noise words replace(Common::String('\xD') + '\xE2', 1); // "look at" = "examine" replace(Common::String('\xD') + '\xE4', 1); // "look in" = "examine" - replace(Common::String('\x4') + '\xE6', 17); // "get up" = "stand" + replace(Common::String('\x4') + '\xE6', 17); // "get up" = "stand" replace(Common::String('\x4') + '\xE7', 17); // "get down" = "stand"... well, why not? replace(Common::String('\x12') + '\xE4', 2); // "go in" = "open [door]" replace(Common::String('\x1C') + '\xE5', 253); // "P' off" is a swear word @@ -538,14 +538,14 @@ void Acci::parse() { switch (_vm->_gyro->_dna._room) { case r__aylesoffice: replace(Common::String('\xCB'), 163); // Monk = Ayles - break; + break; case r__musicroom: replace(Common::String('\xCB'), 166); // Monk = Jacques - break; + break; default: replace(Common::String('\xCB'), 162); // Monk = Ibythneth } - + if (doPronouns()) { _vm->_gyro->_weirdWord = true; _thats = kNothing; @@ -556,7 +556,7 @@ void Acci::parse() { if (!_vm->_gyro->_subject.empty()) _vm->_gyro->_subject.clear(); _vm->_gyro->_subjectNum = 0; // Find subject of conversation. - + for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) { if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) { _vm->_gyro->_subjectNum = (byte)_thats[i]; @@ -618,7 +618,7 @@ void Acci::parse() { } } -void Acci::examineObject() { +void Acci::examineObject() { if (_thing != _vm->_gyro->_thinks) _vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing); switch (_thing) { @@ -626,7 +626,7 @@ void Acci::examineObject() { switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine. case 1: _vm->_visa->dixi('t', 1); // Normal examine wine scroll - break; + break; case 2: _vm->_visa->dixi('d', 6); // Bad wine break; @@ -640,7 +640,7 @@ void Acci::examineObject() { _vm->_visa->dixi('q', 21); // Yucky onion. else _vm->_visa->dixi('t', 18); // Normal onion scroll - break; + break; default: _vm->_visa->dixi('t', _thing); // <<< Ordinarily } @@ -680,8 +680,8 @@ void Acci::exampers() { } // Otherwise... _vm->_visa->dixi('p', _person); - } - + } + // And afterwards... if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake)) _vm->_visa->dixi('Q', 13); @@ -697,7 +697,7 @@ bool Acci::holding() { _vm->_scrolls->display("Be reasonable!"); else if (!_vm->_gyro->_dna._objects[_thing - 1]) // Verbs that need "_thing" to be in the inventory. _vm->_scrolls->display("You're not holding it, Avvy."); - else + else holdingResult = true; return holdingResult; @@ -821,7 +821,7 @@ void Acci::swallow() { // Eat something. void Acci::peopleInRoom() { byte numPeople = 0; // Number of people in the room. - + for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself! if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) numPeople++; @@ -878,13 +878,13 @@ void Acci::lookAround() { switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) { case 258 : _vm->_visa->dixi('q', 80); // Inside art gallery. - break; + break; case 514 : _vm->_visa->dixi('q', 81); // Outside ditto. break; case 260 : _vm->_visa->dixi('q', 82); // Outside Geida's room. - break; + break; } break; default: @@ -892,9 +892,9 @@ void Acci::lookAround() { } } -void Acci::openDoor() { +void Acci::openDoor() { // Special cases. - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_dna._room) { case r__yours: if (_vm->_trip->infield(2)) { // Opening the box. @@ -925,7 +925,7 @@ void Acci::openDoor() { _vm->_visa->dixi('x', _vm->_gyro->_portals[fv]._data); break; case Gyro::kMagicTransport: - _vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8, // High byte + _vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8, // High byte (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte ); break; @@ -940,7 +940,7 @@ void Acci::openDoor() { _vm->_trip->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9); break; } - + return; } } @@ -1049,7 +1049,7 @@ void Acci::goToCauldron() { * Check is it's possible to give something to Spludwick * @remarks Originally called 'give2spludwick' */ -bool Acci::giveToSpludwick() { +bool Acci::giveToSpludwick() { if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) { notInOrder(); return false; @@ -1468,7 +1468,7 @@ void Acci::doThat() { winSequence(); else _vm->_visa->dixi('q', 77); // That Geida woman! - break; + break; default: heyThanks(); } @@ -1620,7 +1620,7 @@ void Acci::doThat() { _vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)"); } - break; + break; case r__musicroom: playHarp(); break; @@ -1801,7 +1801,7 @@ void Acci::doThat() { } } else _vm->_visa->dixi('D', 5); // Go to the bar! - break; + break; case r__outsideducks: if (_vm->_trip->infield(6)) { @@ -1832,7 +1832,7 @@ void Acci::doThat() { case r__nottspub: _vm->_visa->dixi('n', 15); // Can't sell to southerners. - break; + break; default: _vm->_visa->dixi('D', 0); // Can't buy that. } @@ -1972,7 +1972,7 @@ void Acci::doThat() { _vm->_scrolls->display("You can't seem to wake him by yourself."); break; case Gyro::kPeopleJacques: - _vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + + _vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good..."); break; default: diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h index 9004fc6ad5..ed44a758bd 100644 --- a/engines/avalanche/acci2.h +++ b/engines/avalanche/acci2.h @@ -27,8 +27,8 @@ /* ACCIDENCE II The parser. */ -#ifndef ACCI2_H -#define ACCI2_H +#ifndef AVALANCHE_ACCI2_H +#define AVALANCHE_ACCI2_H #include "common/scummsys.h" #include "common/str.h" @@ -132,4 +132,4 @@ private: } // End of namespace Avalanche. -#endif // ACCI2_H +#endif // AVALANCHE_ACCI2_H diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 9347b7762b..9fd802d30a 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -51,7 +51,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription * _console = new AvalancheConsole(this); _rnd = new Common::RandomSource("avalanche"); - _rnd->setSeed(42); + _rnd->setSeed(42); } AvalancheEngine::~AvalancheEngine() { @@ -238,7 +238,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { _gyro->_dna._spareEvening += actChr; } } - + sz.syncAsSint32LE(_gyro->_dna._totalTime); sz.syncAsByte(_gyro->_dna._jumpStatus); sz.syncAsByte(_gyro->_dna._mushroomGrowing); @@ -288,7 +288,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { } } sz.syncAsByte(spriteNum); - + if (sz.isLoading()) { for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites. if (_trip->tr[i].quick) @@ -299,8 +299,8 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { for (byte i = 0; i < spriteNum; i++) { sz.syncAsByte(_trip->tr[i].whichsprite); sz.syncAsByte(_trip->tr[i].check_me); - - + + if (sz.isLoading()) { _trip->tr[i].quick = true; _trip->tr[i].init(_trip->tr[i].whichsprite, _trip->tr[i].check_me, _trip); @@ -379,7 +379,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) { Common::Serializer sz(NULL, f); synchronize(sz); - + f->finalize(); delete f; @@ -465,7 +465,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _dropdown->setupMenu(); _gyro->_whereIs[0] = _gyro->_dna._room; - + _gyro->_alive = true; _lucerna->objectlist(); @@ -478,7 +478,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _trip->trippancy_link(); _celer->updateBackgroundSprites(); - + _scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG" + _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine + _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine @@ -618,14 +618,14 @@ Common::String AvalancheEngine::elmToStr(Elm how) { } void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) { - warning("STUB: run(%s)", what.c_str()); + warning("STUB: run(%s)", what.c_str()); // Probably there'll be no need of this function, as all *.AVX-es will become classes. } void AvalancheEngine::getArguments() { // This function should mess around with command line arguments, // but I am not sure if there'll be use of these arguments at all... - warning("STUB: getArguments()"); + warning("STUB: getArguments()"); } void AvalancheEngine::getSlope() { @@ -646,7 +646,7 @@ void AvalancheEngine::dosShell() { } // Getting used only in demo() / call_menu(). Going to be implemented at the same time with these. -bool AvalancheEngine::keyPressed() { +bool AvalancheEngine::keyPressed() { warning("STUB: keyPressed()"); return false; } @@ -663,7 +663,7 @@ void AvalancheEngine::demo() { - + void AvalancheEngine::runAvalot() { bFlightOn(); @@ -681,7 +681,7 @@ Common::Error AvalancheEngine::run() { if (err != Common::kNoError) return err; - + // From bootstrp: @@ -690,7 +690,7 @@ Common::Error AvalancheEngine::run() { getArguments(); getSlope(); - _zoomy = true; + _zoomy = true; // Don't call the menu by default. Might be modified later, if get_slope() gets implemented, // because zoomy's value is given there. Not sure yet what "zoomy" stands for. if (!_zoomy) @@ -702,7 +702,7 @@ Common::Error AvalancheEngine::run() { runAvalot(); // Needed for later implementation!!! Don't remove these comments!!! - + //if (dosexitcode != 77) quit(); // Didn't stop for us. //switch (_storage._operation) { @@ -727,6 +727,6 @@ Common::Error AvalancheEngine::run() { return Common::kNoError; } - + } // End of namespace Avalanche diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 839618dbc6..639f4cca3d 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ -#ifndef AVALANCHE_H -#define AVALANCHE_H +#ifndef AVALANCHE_AVALANCHE_H +#define AVALANCHE_AVALANCHE_H #include "avalanche/console.h" @@ -90,11 +90,11 @@ public: AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd); ~AvalancheEngine(); - Common::ErrorCode initialize(); + Common::ErrorCode initialize(); GUI::Debugger *getDebugger(); Common::RandomSource *_rnd; - + const AvalancheGameDescription *_gameDescription; uint32 getFeatures() const; const char *getGameId() const; @@ -172,4 +172,4 @@ private: } // End of namespace Avalanche -#endif // AVALANCHE_H +#endif // AVALANCHE_AVALANCHE_H diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 3d3a7a01fe..a84d67a7af 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -61,9 +61,9 @@ Avalot::Avalot(AvalancheEngine *vm) { void Avalot::handleKeyDown(Common::Event &event) { //if (keyboardclick) // click(); - // + // // To be implemented later with the sounds, I assume. - + if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15)) _vm->_parser->handleFunctionKey(event); @@ -169,7 +169,7 @@ void Avalot::setup() { int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot"); - if (loadSlot >= 0) { + if (loadSlot >= 0) { _vm->_gyro->_thinks = 2; // You always have money. _vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); @@ -182,8 +182,8 @@ void Avalot::setup() { _vm->_lucerna->fxtoggle(); _vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); - _vm->_visa->dixi('q', 83); // Info on the game, etc. - } + _vm->_visa->dixi('q', 83); // Info on the game, etc. + } } @@ -211,7 +211,7 @@ void Avalot::run(Common::String arg) { #ifdef DEBUG // ONLY FOR TESTING!!! - for (byte i = 0; i < _vm->_gyro->_lineNum; i++) + for (byte i = 0; i < _vm->_gyro->_lineNum; i++) _vm->_graphics->_surface.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i].col); for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) { diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h index 00f2edc758..34a9d9f7ba 100644 --- a/engines/avalanche/avalot.h +++ b/engines/avalanche/avalot.h @@ -27,8 +27,8 @@ /* AVALOT The kernel of the program. */ -#ifndef AVALOT_H -#define AVALOT_H +#ifndef AVALANCHE_AVALOT_H +#define AVALANCHE_AVALOT_H #include "common/events.h" #include "common/system.h" @@ -50,4 +50,4 @@ private: } // End of namespace Avalanche -#endif // AVALOT_H +#endif // AVALANCHE_AVALOT_H diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index cd56ead287..8e1b13a22e 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -83,16 +83,16 @@ void Celer::updateBackgroundSprites() { case 11: case 21: drawBackgroundSprite(-1, -1, 12); // Looks forwards. - break; + break; case 8: case 18: case 28: case 32: drawBackgroundSprite(-1, -1, 11); // Looks at you. - break; + break; case 30: drawBackgroundSprite(-1, -1, 13); // Winks. - break; + break; case 33: _vm->_gyro->_dna._malagauche = 0; break; @@ -103,7 +103,7 @@ void Celer::updateBackgroundSprites() { case 179: case 197: drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle. - break; + break; case 182: case 194: drawBackgroundSprite(-1, -1, 6); @@ -113,7 +113,7 @@ void Celer::updateBackgroundSprites() { break; case 199: _vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this. - break; + break; } if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally. @@ -177,7 +177,7 @@ void Celer::updateBackgroundSprites() { break; case 1: drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural. - break; + break; } } break; @@ -186,10 +186,10 @@ void Celer::updateBackgroundSprites() { switch (_vm->_gyro->_roomTime % 54) { case 20: drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks. - break; + break; case 23: drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal. - break; + break; } } break; @@ -215,7 +215,7 @@ void Celer::updateBackgroundSprites() { switch (_vm->_gyro->_roomTime % 50) { case 45 : drawBackgroundSprite(-1, -1, 9); // Spurge blinks. - break; + break; case 49 : drawBackgroundSprite(-1, -1, 10); break; @@ -279,7 +279,7 @@ void Celer::loadBackgroundSprites(byte number) { for (byte i = 0; i < _spriteNum; i++) { f.seek(_offsets[i]); - + SpriteType sprite; sprite._type = PictureType(f.readByte()); sprite._x = f.readSint16LE(); @@ -289,7 +289,7 @@ void Celer::loadBackgroundSprites(byte number) { sprite._size = f.readSint32LE(); bool natural = f.readByte(); bool memorize = f.readByte(); - + if (memorize) { _sprites[i]._x = sprite._x; _sprites[i]._xl = sprite._xl; @@ -299,7 +299,7 @@ void Celer::loadBackgroundSprites(byte number) { if (natural) { _sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back. - _sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; + _sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; _sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8()); for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) { diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h index 674f6e1621..47a11bfad4 100644 --- a/engines/avalanche/celer2.h +++ b/engines/avalanche/celer2.h @@ -27,8 +27,8 @@ /* CELER The unit for updating the screen pics. */ -#ifndef CELER2_H -#define CELER2_H +#ifndef AVALANCHE_CELER2_H +#define AVALANCHE_CELER2_H #include "common/scummsys.h" #include "common/file.h" @@ -78,4 +78,4 @@ private: } // End of namespace Avalanche. -#endif // CELER2_H +#endif // AVALANCHE_CELER2_H diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h index 89e2d7358a..e1bf8b2cab 100644 --- a/engines/avalanche/closing2.h +++ b/engines/avalanche/closing2.h @@ -27,8 +27,8 @@ /* CLOSING The closing screen and error handler. */ -#ifndef CLOSING2_H -#define CLOSING2_H +#ifndef AVALANCHE_CLOSING2_H +#define AVALANCHE_CLOSING2_H #include "common/scummsys.h" #include "common/str.h" @@ -68,4 +68,4 @@ private: } // End of namespace Avalanche. -#endif // CLOSING2_H +#endif // AVALANCHE_CLOSING2_H diff --git a/engines/avalanche/color.h b/engines/avalanche/color.h index c0c348f9ab..e9f9c460bc 100644 --- a/engines/avalanche/color.h +++ b/engines/avalanche/color.h @@ -27,8 +27,8 @@ // Color constants replacing the colors from the CRT unit of Pascal -#ifndef COLOR_H -#define COLOR_H +#ifndef AVALANCHE_COLOR_H +#define AVALANCHE_COLOR_H #include "common/system.h" @@ -55,4 +55,4 @@ enum Color { } // End of namespace Avalanche -#endif // COLOR_H +#endif // AVALANCHE_COLOR_H diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index 10cefa13b2..1d3a0235d4 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -54,7 +54,7 @@ void HeadType::init(char trig, char altTrig, Common::String title, byte pos, Dro } void HeadType::draw() { - CursorMan.showMouse(false); + CursorMan.showMouse(false); _dr->drawMenuText(_xpos, 1, _trigger, _title, true, false); CursorMan.showMouse(true); } @@ -67,17 +67,17 @@ void HeadType::highlight() { warning("STUB: Dropdown::headytpe::highlight()"); _dr->drawMenuText(_xpos, 1, _trigger, _title, true, true); - + _dr->_activeMenuItem._left = _xpos; _dr->_activeMenuItem._activeNow = true; _dr->_vm->_gyro->_dropdownActive = true; _dr->_activeMenuItem._activeNum = _position; - + _dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor. } bool HeadType::parseAltTrigger(char key) { - if (key != _altTrigger) + if (key != _altTrigger) return true; return false; } @@ -118,7 +118,7 @@ void MenuItem::displayOption(byte y, bool highlit) { else backgroundColor = 7; _dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor); - + Common::String text = _options[y]._title; while (text.size() + _options[y]._shortcut.size() < _width) text += ' '; // Pad _options[y] with spaces. @@ -146,7 +146,7 @@ void MenuItem::display() { displayOption(0, true); for (byte y = 1; y < _optionNum; y++) displayOption(y, false); - + _dr->_vm->_gyro->_defaultLed = 1; _dr->_vm->_gyro->_currentMouse = 177; //mousepage(cp); @@ -155,8 +155,8 @@ void MenuItem::display() { void MenuItem::wipe() { //setactivepage(cp); - CursorMan.showMouse(false); - + CursorMan.showMouse(false); + _dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false); _activeNow = false; @@ -164,7 +164,7 @@ void MenuItem::wipe() { _firstlix = false; _dr->_vm->_gyro->_defaultLed = 2; - CursorMan.showMouse(true); + CursorMan.showMouse(true); } void MenuItem::moveHighlight(int8 inc) { @@ -176,15 +176,15 @@ void MenuItem::moveHighlight(int8 inc) { _highlightNum = highlightNum; } //setactivepage(cp); - CursorMan.showMouse(false); + CursorMan.showMouse(false); displayOption(_oldY, false); displayOption(_highlightNum, true); //setactivepage(1 - cp); _oldY = _highlightNum; - CursorMan.showMouse(true); + CursorMan.showMouse(true); } -void MenuItem::lightUp(Common::Point cursorPos) { +void MenuItem::lightUp(Common::Point cursorPos) { if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1))) return; _highlightNum = (cursorPos.y - 26) / 20; @@ -193,7 +193,7 @@ void MenuItem::lightUp(Common::Point cursorPos) { moveHighlight(0); } -void MenuItem::select(byte which) { +void MenuItem::select(byte which) { if (!_options[which]._valid) return; @@ -235,7 +235,7 @@ void MenuBar::draw() { const ByteField menuspace = {0, 0, 80, 9}; //setactivepage(3); - + _dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor); byte savecp = _dr->_vm->_gyro->_cp; @@ -343,7 +343,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, } _vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor); - + // Underline the selected character. if (!text.contains(trigger)) return; @@ -351,7 +351,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, byte i; for (i = 0; text[i] != trigger; i++) ; // Search for the character in the string. - + byte pixel = ander; for (byte bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; @@ -508,7 +508,7 @@ void Dropdown::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->_gyro->_lastPerson == _vm->_gyro->kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing) || (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room)) _activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here. @@ -680,25 +680,25 @@ void Dropdown::runMenuWith() { _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy); return; } - break; + break; case 103: { // Cider _vm->_acci->_thing = 103; _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy); return; } - break; + break; case 104: { // Mead _vm->_acci->_thing = 107; _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy); return; } - break; + break; case 105: { // Onion (trader) _vm->_acci->_thing = 67; _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy); return; } - break; + break; default: { _vm->_acci->_person = _vm->_acci->_thing; _vm->_acci->_thing = 254; @@ -709,7 +709,7 @@ void Dropdown::runMenuWith() { _vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]); } -void Dropdown::setupMenu() { +void Dropdown::setupMenu() { _menuBar.init(this); _activeMenuItem.init(this); @@ -730,13 +730,13 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it... while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) { _menuBar.chooseMenuItem(cursorPos.x); - do + do _vm->updateEvents(); while (_vm->_lucerna->holdLeftMouse); - + while (!_vm->shouldQuit()) { - do { + do { _vm->updateEvents(); // We updadte the cursor's picture. @@ -768,14 +768,14 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it... backup.free(); return; } // No "else"- clicking on menu has no effect (only releasing). - } + } } else { // Clicked on menu bar. if (_activeMenuItem._activeNow) { _activeMenuItem.wipe(); _vm->_graphics->_surface.copyFrom(backup); _vm->_graphics->refreshScreen(); - + if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels. // If we clicked on the same menu item (the one that is already active) on the bar... _vm->_lucerna->holdLeftMouse = false; @@ -787,7 +787,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it... } } } - + // NOT clicked button... if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) { diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h index 4122d3fae4..95e258effb 100644 --- a/engines/avalanche/dropdown2.h +++ b/engines/avalanche/dropdown2.h @@ -27,8 +27,8 @@ /* DROPDOWN A customised version of Oopmenu (qv). */ -#ifndef DROPDOWN2_H -#define DROPDOWN2_H +#ifndef AVALANCHE_DROPDOWN2_H +#define AVALANCHE_DROPDOWN2_H #include "avalanche/color.h" @@ -164,4 +164,4 @@ private: } // End of namespace Avalanche. -#endif // DROPDOWN2_H +#endif // AVALANCHE_DROPDOWN2_H diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp index a22a205aaa..7cf4075d1a 100644 --- a/engines/avalanche/enid2.cpp +++ b/engines/avalanche/enid2.cpp @@ -77,7 +77,7 @@ void Enid::expandMonthName(Common::String x) { Common::String Enid::expandDate(byte d, byte m, uint16 y) { const Common::String months[12] = { "Jan#", "Febr#", "March", "April", "May", "June", "July", "August", - "Septem*", "Octo*", "Novem*", "Decem*" + "Septem*", "Octo*", "Novem*", "Decem*" }; Common::String expanddate_result; @@ -162,11 +162,11 @@ void Enid::showHeader() { _vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4"); } -void Enid::avvyBackground() { +void Enid::avvyBackground() { // Not really a filing procedure, // but it's only called just before edna_load, so I thought I'd put it // in Enid instead of, say, Lucerna. - + #if 0 port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. } diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h index 1cf14d10de..97e249e187 100644 --- a/engines/avalanche/enid2.h +++ b/engines/avalanche/enid2.h @@ -27,8 +27,8 @@ /* ENID Edna's manager. Loads/saves files. */ -#ifndef ENID2_H -#define ENID2_H +#ifndef AVALANCHE_ENID2_H +#define AVALANCHE_ENID2_H #include "common/scummsys.h" @@ -75,4 +75,4 @@ private: } // End of namespace Avalanche. -#endif // ENID2_H +#endif // AVALANCHE_ENID2_H diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index df310500f8..6058b006bf 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -102,25 +102,25 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, stAngle = stAngle % 361; endAngle = endAngle % 361; - // If impossible angles, then swap them! + // If impossible angles, then swap them! if (endAngle < stAngle) { uint16 tmpAngle=endAngle; endAngle=stAngle; stAngle=tmpAngle; } - // Approximate the number of pixels required by using the circumference equation of an ellipse. + // Approximate the number of pixels required by using the circumference equation of an ellipse. uint16 numOfPixels = (uint16)floor(sqrt(3.0) * sqrt(pow(double(xRadius), 2) + pow(double(yRadius), 2)) + 0.5); // Calculate the angle precision required. double delta = 90.0 / numOfPixels; - // Always just go over the first 90 degrees. Could be optimized a - // bit if startAngle and endAngle lie in the same quadrant, left as an - // exercise for the reader. :) + // Always just go over the first 90 degrees. Could be optimized a + // bit if startAngle and endAngle lie in the same quadrant, left as an + // exercise for the reader. :) double j = 0; - // Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn. + // Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn. uint16 deltaEnd = 91; // Set the end point. @@ -128,7 +128,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, endPoint.x = (int16)floor(xRadius * cos(tempTerm) + 0.5) + x; endPoint.y = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5) + y; - // Calculate points. + // Calculate points. int16 xNext = xRadius; int16 yNext = 0; do { @@ -136,7 +136,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 yTemp = yNext; // This is used by both sin and cos. tempTerm = (j + delta) * convfac; - + xNext = (int16)floor(xRadius * cos(tempTerm) + 0.5); yNext = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5); @@ -145,18 +145,18 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 yp = y + yTemp; int16 ym = y - yTemp; - if ((j >= stAngle) && (j <= endAngle)) + if ((j >= stAngle) && (j <= endAngle)) *(byte *)_scrolls.getBasePtr(xp,yp) = color; - if (((180-j) >= stAngle) && ((180-j) <= endAngle)) + if (((180-j) >= stAngle) && ((180-j) <= endAngle)) *(byte *)_scrolls.getBasePtr(xm,yp) = color; - if (((j+180) >= stAngle) && ((j+180) <= endAngle)) + if (((j+180) >= stAngle) && ((j+180) <= endAngle)) *(byte *)_scrolls.getBasePtr(xm,ym) = color; - if (((360-j) >= stAngle) && ((360-j) <= endAngle)) + if (((360-j) >= stAngle) && ((360-j) <= endAngle)) *(byte *)_scrolls.getBasePtr(xp,ym) = color; - + j += delta; } while (j <= deltaEnd); @@ -208,7 +208,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) { for (byte i = 0; i < text.size(); i++) { for (byte j = 0; j < fontHeight; j++) { - byte pixel = font[(byte)text[i]][j]; + byte pixel = font[(byte)text[i]][j]; for (byte bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; if (pixelBit) @@ -236,7 +236,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text byte pixelBit = (pixel >> bit) & 1; if (pixelBit != 0) *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); - } + } } } } @@ -258,7 +258,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text for (byte i = 0; i < 8; i++) { byte pixelBit = (pixel >> i) & 1; *(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane); - } + } } } } @@ -285,7 +285,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 for (byte bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; *(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane); - } + } } } } @@ -304,8 +304,8 @@ void Graphics::refreshScreen() { // These cycles are for doubling the screen height. for (uint16 y = 0; y < _screen.h / 2; y++) { for (uint16 x = 0; x < _screen.w; x++) { - for (byte j = 0; j < 2; j++) - *(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y); + for (byte j = 0; j < 2; j++) + *(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y); } } // Now we copy the stretched picture to the screen. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index ad6a68252b..a94ed77112 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ -#ifndef GRAPHICS_H -#define GRAPHICS_H +#ifndef AVALANCHE_GRAPHICS_H +#define AVALANCHE_GRAPHICS_H #include "common/file.h" @@ -38,7 +38,7 @@ class AvalancheEngine; typedef byte FontType[256][16]; // raw font type -typedef byte ManiType[2049]; // manitype = array[5..2053] of byte; +typedef byte ManiType[2049]; // manitype = array[5..2053] of byte; // Be aware!!! typedef byte SilType[51][11]; // 35, 4 @@ -69,12 +69,12 @@ public: ~Graphics(); void init(); void fleshColors(); - + // Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc. // Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().) // TODO: Make it more accurate later. Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color); - + void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color); void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color); void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color); @@ -100,4 +100,4 @@ private: } // End of namespace Avalanche -#endif // GRAPHICS_H +#endif // AVALANCHE_GRAPHICS_H diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 398e4a8624..1fd906d48d 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -119,7 +119,7 @@ const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroo // A quasiped defines how people who aren't sprites talk. For example, quasiped // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context. const QuasipedType Gyro::kQuasipeds[16] = { - {2, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19). + {2, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19). {3, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19). {3, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1). {3, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23). @@ -234,7 +234,7 @@ void Gyro::shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) { warning("STUB: Gyro::shbox()"); } -void Gyro::newGame() { +void Gyro::newGame() { for (byte gm = 0; gm < kMaxSprites; gm++) { if (_vm->_trip->tr[gm].quick) _vm->_trip->tr[gm].done(); @@ -259,7 +259,7 @@ void Gyro::newGame() { _dna._objects[kObjectBodkin - 1] = true; _dna._objects[kObjectBell - 1] = true; _dna._objects[kObjectClothes - 1] = true; - + _thinkThing = true; _thinks = 2; _vm->_lucerna->objectlist(); @@ -293,7 +293,7 @@ void Gyro::newGame() { _vm->_lucerna->sprite_run(); } -void Gyro::click() { +void Gyro::click() { warning("STUB: Gyro::click()"); } @@ -326,7 +326,7 @@ bool Gyro::updateMoney(uint16 howmuchby) { // There'll may be problems with calling these functions because of the conversion of the arrays!!! // Keep an eye open! -Common::String Gyro::getName(byte whose) { +Common::String Gyro::getName(byte whose) { static const Common::String kLads[17] = { "Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck", "Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood", @@ -350,7 +350,7 @@ byte Gyro::getNameChar(byte whose) { assert((whose > 150) && (whose < 179)); - if (whose < 175) + if (whose < 175) return kLadChar[whose - 150]; else return kLassChar[whose - 175]; @@ -461,7 +461,7 @@ Common::String Gyro::f5Does() { return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up"; } break; - case r__insidecardiffcastle: + case r__insidecardiffcastle: if (_dna._standingOnDais) return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down"; else @@ -505,7 +505,7 @@ void Gyro::loadMouse(byte which) { for (byte k = 0; k < 2; k++) if (*(byte *)mask.getBasePtr(i, j) == 0) *(byte *)cursor.getBasePtr(i, j * 2 + k) = 0; - + mask.free(); // The OR mask. diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 75dc50c720..ca367cd66f 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -27,8 +27,8 @@ /* GYRO It all revolves around this bit! */ -#ifndef GYRO2_H -#define GYRO2_H +#ifndef AVALANCHE_GYRO2_H +#define AVALANCHE_GYRO2_H #include "common/str.h" #include "common/scummsys.h" @@ -49,7 +49,7 @@ static const int16 kCarryLimit = 12; // carry limit static const int16 kNumlockCode = 32; // Code for Num Lock static const int16 kMouseSize = 134; -struct MouseHotspotType { // mouse-void +struct MouseHotspotType { // mouse-void int16 _horizontal, _vertical; }; @@ -115,7 +115,7 @@ struct DnaType { // Ux, uy, & ww now all belong to Trip5 byte _jumpStatus; // Fixes how high you're jumping. - bool _mushroomGrowing; // Is the mushroom growing in 42? + bool _mushroomGrowing; // Is the mushroom growing in 42? bool _spludwickAtHome; // Is Spludwick at home? @@ -298,7 +298,7 @@ public: // For Thinkabout: static const bool kThing = true; - static const bool kPerson = false; + static const bool kPerson = false; // Magic/portal constants: enum Magics { @@ -310,7 +310,7 @@ public: kMagicSpecial, // Special function. kMagicOpenDoor // Opening door. }; - + // These following static constants should be included in CFG when it's written. static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar. @@ -331,7 +331,7 @@ public: static const bool kDemo = false; // If this is true, we're in a demo of the game. static const char kSpludwicksOrder[3]; - + static const QuasipedType kQuasipeds[16]; enum Pitch { @@ -353,13 +353,13 @@ public: // If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value. // If a scroll comes up, or you leave the room, it's automatically set to zero. byte _interrogation; - + static byte _whereIs[29]; // Variable static constant for overriding the ability of On to switch pages. // You may know better than On which page to switch to. - bool _onCanDoPageSwap; - + bool _onCanDoPageSwap; + @@ -489,7 +489,7 @@ public: private: AvalancheEngine *_vm; - + // CHECKME: Useless? // static const char kItemsChar[]; void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc); @@ -497,4 +497,4 @@ private: } // End of namespace Avalanche -#endif // GYRO2_H +#endif // AVALANCHE_GYRO2_H diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 81dc45875d..47f8382143 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -80,7 +80,7 @@ void Lucerna::init() { _vm->_gyro->atkey = "alt-"; #endif } - + /** * Call a given Verb * @remarks Originally called 'callverb' @@ -101,7 +101,7 @@ void Lucerna::callVerb(byte id) { void Lucerna::draw_also_lines() { byte ff; - + CursorMan.showMouse(false); _vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0); @@ -119,7 +119,7 @@ void Lucerna::draw_also_lines() { -// nextstring, scram1 and unscrable are only used in load_also +// nextstring, scram1 and unscrable are only used in load_also Common::String Lucerna::nextstring() { Common::String str; @@ -145,7 +145,7 @@ void Lucerna::unscramble() { void Lucerna::load_also(Common::String n) { byte ff, fv; - + for (fv = 0; fv < 31; fv++) for (ff = 0; ff < 2; ff++) if (_vm->_gyro->_also[fv][ff] != 0) { @@ -170,9 +170,9 @@ void Lucerna::load_also(Common::String n) { } *_vm->_gyro->_also[fv][0] = Common::String('\x9D') + *_vm->_gyro->_also[fv][0] + Common::String('\x9D'); } - + memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines)); - + //fv = getpixel(0, 0); _vm->_gyro->_lineNum = f.readByte(); for (byte i = 0; i < _vm->_gyro->_lineNum; i++) { @@ -217,7 +217,7 @@ void Lucerna::load_also(Common::String n) { _vm->_gyro->_listen.clear(); for (byte i = 0; i < listen_length; i++) _vm->_gyro->_listen += f.readByte(); - + draw_also_lines(); //setactivepage(1); @@ -231,9 +231,9 @@ void Lucerna::load_also(Common::String n) { void Lucerna::load(byte n) { // Load2, actually Common::String xx; - + CursorMan.showMouse(false); - + _vm->_graphics->fleshColors(); xx = _vm->_gyro->intToStr(n); @@ -380,10 +380,10 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_gyro->_roomTime = 0; - + if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room)) new_town(); - + switch (x) { case r__yours: @@ -514,7 +514,7 @@ void Lucerna::enterroom(byte x, byte ped) { if (_vm->_gyro->_dna._tiedUp) _vm->_celer->drawBackgroundSprite(-1, -1, 2); - if (!_vm->_gyro->_dna._mushroomGrowing) + if (!_vm->_gyro->_dna._mushroomGrowing) _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); break; @@ -571,17 +571,17 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_gyro->_dna._catacombX = 8; _vm->_gyro->_dna._catacombY = 4; } - break; + break; case 5: { // Enter from du Lustie's _vm->_gyro->_dna._catacombX = 8; _vm->_gyro->_dna._catacombY = 7; } - break; + break; case 6: { // Enter from Geida's _vm->_gyro->_dna._catacombX = 4; _vm->_gyro->_dna._catacombY = 1; } - break; + break; } _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; @@ -709,7 +709,7 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_sequence->start_to_close(); } break; - + case r__entrancehall: case r__insideabbey: case r__yourhall: @@ -804,19 +804,19 @@ void Lucerna::thinkabout(byte z, bool th) { // Hey!!! Get it and put it!!! z = z - 149; if (z >= 25) z -= 8; - if (z == 20) + if (z == 20) z--; // Last time... } f.seek(z * picsize + 65); - + ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f); _vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170); picture.free(); - + f.close(); CursorMan.showMouse(false); @@ -829,7 +829,7 @@ void Lucerna::thinkabout(byte z, bool th) { // Hey!!! Get it and put it!!! for (byte fv = 0; fv <= 1; fv++) _vm->_trip->getset[fv].remember(thinkspace); - + CursorMan.showMouse(true); _vm->_gyro->_thinkThing = th; } @@ -845,7 +845,7 @@ void Lucerna::load_digits() { // Load the scoring digits & rwlites for (byte fv = 0; fv < 10; fv++) { f.seek(fv * digitsize); - + #if 0 _vm->_gyro->digit[fv] = new byte[digitsize]; f.read(_vm->_gyro->digit[fv], digitsize); @@ -856,7 +856,7 @@ void Lucerna::load_digits() { // Load the scoring digits & rwlites for (byte ff = 0; ff < 9; ff++) { f.seek(10 * digitsize + ff * rwlitesize); - + #if 0 _vm->_gyro->rwlite[ff] = new byte[rwlitesize]; f.read(_vm->_gyro->rwlite[ff], rwlitesize); @@ -875,7 +875,7 @@ void Lucerna::toolbar() { } f.seek(40); - + // off; ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f); @@ -915,7 +915,7 @@ void Lucerna::showscore() { //setactivepage(3); for (byte fv = 0; fv < 3; fv++) - if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv]) + if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv]) _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177); for (byte fv = 0; fv < 2; fv++) @@ -1008,16 +1008,16 @@ void Lucerna::objectlist() { } void Lucerna::verte(Common::Point cursorPos) { - if (! _vm->_gyro->_dna._userMovesAvvy) + if (! _vm->_gyro->_dna._userMovesAvvy) return; cursorPos.y /= 2; byte what; // _vm->_trip->tr[0] : that's the only one we're interested in here. (It's Avalot.) - if (cursorPos.x < _vm->_trip->tr[0].x) + if (cursorPos.x < _vm->_trip->tr[0].x) what = 1; - else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength)) + else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength)) what = 2; else what = 0; // On top @@ -1063,7 +1063,7 @@ void Lucerna::verte(Common::Point cursorPos) { void Lucerna::checkclick() { Common::Point cursorPos = _vm->getMousePos(); _vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10)); - + /*if (_vm->_gyro->mrelease > 0) _vm->_gyro->after_the_scroll = false;*/ @@ -1080,7 +1080,7 @@ void Lucerna::checkclick() { } else _vm->_gyro->newMouse(4); // fletch } - + if (holdLeftMouse) { if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu. if (_vm->_gyro->_dropsOk) @@ -1185,11 +1185,11 @@ void Lucerna::dawn() { void Lucerna::showrw() { // It's data is loaded in load_digits(). - if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction) + if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction) return; _vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; CursorMan.showMouse(false); - + #if 0 for (byte page_ = 0; page_ <= 1; page_++) { setactivepage(page_); @@ -1201,7 +1201,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits(). CursorMan.showMouse(true); //setactivepage(1 - cp); - + warning("STUB: Lucerna::showrw()"); } @@ -1277,7 +1277,7 @@ void Lucerna::clock_lucerna() { if ((_vm->_gyro->_hours == 0) && (_vm->_gyro->_oh != 0) && (_vm->_gyro->_oh != 17717)) _vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!")); - + _vm->_gyro->_oh = _vm->_gyro->_hours; _vm->_gyro->_onh = nh; _vm->_gyro->_om = _vm->_gyro->_minutes; @@ -1287,11 +1287,11 @@ void Lucerna::clock_lucerna() { void Lucerna::delavvy() { CursorMan.showMouse(false); - + // triptype &with = _vm->_trip->tr[0]; // for (byte page_ = 0; page_ <= 1; page_++) // mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_); - + CursorMan.showMouse(true); } @@ -1300,12 +1300,12 @@ void Lucerna::gameover() { int16 sx = _vm->_trip->tr[0].x; int16 sy = _vm->_trip->tr[0].y; - + _vm->_trip->tr[0].done(); _vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls _vm->_trip->tr[0].step = 0; _vm->_trip->tr[0].appear(sx, sy, 0); - + _vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over); _vm->_gyro->_alive = false; @@ -1323,11 +1323,11 @@ void Lucerna::minor_redraw() { _vm->_gyro->_cp = 1 - _vm->_gyro->_cp; _vm->_trip->getback(); } - + for (byte i = 0; i < 3; i++) _vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits showscore(); - + dawn(); } @@ -1339,7 +1339,7 @@ uint16 Lucerna::bearing(byte whichped) { byte pedId = whichped - 1; // Different array indexes in Pascal and C. const double rad2deg = 180 / 3.14; // Pi - + if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[pedId]._x) return 0; else if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[pedId]._x) { diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h index f337d97f7b..1436e388b5 100644 --- a/engines/avalanche/lucerna2.h +++ b/engines/avalanche/lucerna2.h @@ -27,8 +27,8 @@ /* LUCERNA The screen, [keyboard] and mouse handler.*/ -#ifndef LUCERNA2_H -#define LUCERNA2_H +#ifndef AVALANCHE_LUCERNA2_H +#define AVALANCHE_LUCERNA2_H #include "common/scummsys.h" #include "common/file.h" @@ -139,4 +139,4 @@ private: } // End of namespace Avalanche -#endif // LUCERNA2_H +#endif // AVALANCHE_LUCERNA2_H diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 5b72ee1289..073fdfdc7e 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -134,7 +134,7 @@ void Parser::cursorOff() { _cursorState = false; } -void Parser::tryDropdown() { +void Parser::tryDropdown() { warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown. } @@ -162,7 +162,7 @@ void Parser::drawCursor() { void Parser::wipeText() { CursorMan.showMouse(false); cursorOff(); - + _vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text. _quote = true; diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index e16df6d3bc..70a87b6ea7 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ -#ifndef PARSER_H -#define PARSER_H +#ifndef AVALANCHE_PARSER_H +#define AVALANCHE_PARSER_H #include "common/events.h" @@ -41,7 +41,7 @@ public: bool _quote; // 66 or 99 next? byte _leftMargin; bool _cursorState; - + Parser(AvalancheEngine *vm); @@ -77,4 +77,4 @@ private: } // End of namespace Avalanche -#endif // PARSER_H +#endif // AVALANCHE_PARSER_H diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h index 9625236660..1228ab2dbd 100644 --- a/engines/avalanche/pingo2.h +++ b/engines/avalanche/pingo2.h @@ -27,8 +27,8 @@ /* PINGO Full-screen sub-parts of the game. */ -#ifndef PINGO2_H -#define PINGO2_H +#ifndef AVALANCHE_PINGO2_H +#define AVALANCHE_PINGO2_H #include "common/scummsys.h" #include "common/str.h" @@ -64,4 +64,4 @@ private: } // End of namespace Avalanche. -#endif // PINGO2_H +#endif // AVALANCHE_PINGO2_H diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h index 4007504f6e..e623c27a20 100644 --- a/engines/avalanche/roomnums.h +++ b/engines/avalanche/roomnums.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ -#ifndef ROOMNUMS_H -#define ROOMNUMS_H +#ifndef AVALANCHE_ROOMNUMS_H +#define AVALANCHE_ROOMNUMS_H #include "common/system.h" @@ -80,9 +80,9 @@ const byte r__insidecardiffcastle = 71; //{ -------------- } -const byte r__bosskey = 98; // assumed +const byte r__bosskey = 98; // assumed const byte r__map = 99; } // End of namespace Avalanche -#endif // ROOMNUMS_H +#endif // AVALANCHE_ROOMNUMS_H diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 531794c770..d3f76b595c 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -85,7 +85,7 @@ void Scrolls::easteregg() { void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwriting FontType itw; byte lz = z.size(); - + bool offset = x % 8 == 4; x = x / 8; y++; @@ -130,7 +130,7 @@ void Scrolls::normscroll() { ::Graphics::Surface temp; temp.copyFrom(_vm->_graphics->_surface); _vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!! - + Common::Event event; while (!_vm->shouldQuit()) { _vm->_graphics->refreshScreen(); @@ -224,7 +224,7 @@ void Scrolls::music_scroll() { CursorMan.showMouse(true); _vm->_gyro->newMouse(4); - // Since there are no sounds in the game yet, it's pretty pointless to implement this function further. + // Since there are no sounds in the game yet, it's pretty pointless to implement this function further. // For now we act like the player just played the right tone. #if 0 if (they_match(played)) { @@ -239,7 +239,7 @@ void Scrolls::music_scroll() { return; #if 0 } - + _vm->_gyro->screturn = false; CursorMan.showMouse(false); state(0); @@ -261,12 +261,12 @@ void Scrolls::dingdongbell() { // Pussy's in the well. Who put her in? Little. _vm->_lucerna->errorled(); // ring the bell "x" times } -void Scrolls::dodgem() { +void Scrolls::dodgem() { dodgeCoord = _vm->getMousePos(); g_system->warpMouse(dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll. } -void Scrolls::undodgem() { +void Scrolls::undodgem() { Common::Point actCoord = _vm->getMousePos(); if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll)) g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position. @@ -357,7 +357,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t _vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray); _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed); _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed); - + // The body of the scroll. _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray); _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray); @@ -381,7 +381,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t // int16 ey = my - ly; mx -= lx; my -= ly + 2; - + centre = false; switch (use_icon) { @@ -525,7 +525,7 @@ void Scrolls::bubble(func2 gotoit) { // "Tail" of the speech bubble. _vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->_talkBackgroundColor); - + yl -= 3; // Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify(). @@ -592,7 +592,7 @@ Common::String Scrolls::lsd() { + '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12); if (_vm->_gyro->_dna._money > 12) x = x + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)"; - + return x; } @@ -702,7 +702,7 @@ void Scrolls::calldrivers() { // sprites.) _vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._x; _vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._y; // Position. - + _vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor; _vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors. } else { @@ -722,7 +722,7 @@ void Scrolls::calldrivers() { switch (param) { case 1: display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion) - break; + break; case 2: display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer); break; @@ -831,7 +831,7 @@ void Scrolls::loadfont() { for (int16 i = 0; i < 256; i++) f.read(ch[1][i], 16); f.close(); - + if (!f.open("ttsmall.fnt")) { warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt"); return; diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h index 362000b153..3c1efc92ac 100644 --- a/engines/avalanche/scrolls2.h +++ b/engines/avalanche/scrolls2.h @@ -27,8 +27,8 @@ /* SCROLLS The scroll driver. */ -#ifndef SCROLLS2_H -#define SCROLLS2_H +#ifndef AVALANCHE_SCROLLS2_H +#define AVALANCHE_SCROLLS2_H #include "common/system.h" @@ -67,7 +67,7 @@ public: Scrolls(AvalancheEngine *vm); - + void init(); void state(byte x); // Sets "Ready" light to whatever @@ -105,7 +105,7 @@ private: int16 dix, diy; - + byte cfont; // Current font Common::Point dodgeCoord; @@ -150,4 +150,4 @@ private: } // End of namespace Avalanche -#endif // SCROLLS2_H +#endif // AVALANCHE_SCROLLS2_H diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp index 15759bd1c0..4e51cf91a7 100644 --- a/engines/avalanche/sequence2.cpp +++ b/engines/avalanche/sequence2.cpp @@ -91,10 +91,10 @@ void Sequence::call_sequencer() { switch (seq[0]) { case 0: return; // No more routines. - break; + break; case 177: // Flip room. _vm->_gyro->_dna._userMovesAvvy = true; - _vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); + _vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); if (seq[0] == 177) shove_left(); break; @@ -105,7 +105,7 @@ void Sequence::call_sequencer() { _vm->_celer->drawBackgroundSprite(-1, -1, seq[0]); shove_left(); } - + start_to_close(); // Make sure this PROC gets called again. } diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h index d93cf426e0..7fcb646fa5 100644 --- a/engines/avalanche/sequence2.h +++ b/engines/avalanche/sequence2.h @@ -27,8 +27,8 @@ /* SEQUENCE The sequencer. */ -#ifndef SEQUENCE2_H -#define SEQUENCE2_H +#ifndef AVALANCHE_SEQUENCE2_H +#define AVALANCHE_SEQUENCE2_H #include "common/scummsys.h" @@ -68,4 +68,4 @@ private: } // End of namespace Avalanche. -#endif // SEQUENCE2_H +#endif // AVALANCHE_SEQUENCE2_H diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index dbb4f80acd..59c7ed45fb 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -332,7 +332,7 @@ void Timeout::hang_around2() { _vm->_trip->tr[0].done(); _vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck. - set_up_timer(1, procafter_the_shootemup, reason_hanging_around); + set_up_timer(1, procafter_the_shootemup, reason_hanging_around); // Immediately call the following proc (when you have a chance). _vm->_gyro->_dna._tiedUp = false; @@ -341,7 +341,7 @@ void Timeout::hang_around2() { } void Timeout::after_the_shootemup() { - + _vm->_trip->fliproom(_vm->_gyro->_dna._room, 0); // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! @@ -614,7 +614,7 @@ void Timeout::arkata_shouts() { return; _vm->_visa->dixi('q', 76); - + set_up_timer(160, procarkata_shouts, reason_arkata_shouts); } @@ -627,7 +627,7 @@ void Timeout::winning() { do { _vm->_lucerna->checkclick(); } while (!(_vm->_gyro->mrelease == 0)); -#endif +#endif // TODO: To be implemented with Pingo::winning_pic(). _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore); diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h index 2bac5a0031..0e7be33640 100644 --- a/engines/avalanche/timeout2.h +++ b/engines/avalanche/timeout2.h @@ -27,8 +27,8 @@ /* TIMEOUT The scheduling unit. */ -#ifndef TIMEOUT2_H -#define TIMEOUT2_H +#ifndef AVALANCHE_TIMEOUT2_H +#define AVALANCHE_TIMEOUT2_H #include "common/scummsys.h" @@ -121,11 +121,11 @@ public: timetype times[7]; - + bool timerLost; // Is the timer "lost"? (Because of using lose_timer()) - + Timeout(AvalancheEngine *vm); void setParent(AvalancheEngine *vm); @@ -222,4 +222,4 @@ private: } // End of namespace Avalanche. -#endif // TIMEOUT2_H +#endif // AVALANCHE_TIMEOUT2_H diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index c514734fcb..ccaba83088 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -44,7 +44,7 @@ #include "common/file.h" namespace Avalanche { - + void triptype::init(byte spritenum, bool do_check, Trip *tr) { _tr = tr; @@ -73,14 +73,14 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) { } inf.skip(2); // Replace variable named 'soa' in the original code. - + if (!a.name.empty()) a.name.clear(); byte nameSize = inf.readByte(); - for (byte i = 0; i < nameSize; i++) + for (byte i = 0; i < nameSize; i++) a.name += inf.readByte(); inf.skip(12 - nameSize); - + //inf.skip(1); // Same as above. byte commentSize = inf.readByte(); for (byte i = 0; i < commentSize; i++) @@ -147,9 +147,9 @@ void triptype::original() { void triptype::andexor() { if ((vanishifstill) && (ix == 0) && (iy == 0)) return; - byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). + byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). - _tr->_vm->_graphics->drawSprite(_info, picnum, x, y); + _tr->_vm->_graphics->drawSprite(_info, picnum, x, y); } void triptype::turn(byte whichway) { @@ -171,11 +171,11 @@ void triptype::appear(int16 wx, int16 wy, byte wf) { } bool triptype::collision_check() { - for (byte fv = 0; fv < _tr->numtr; fv++) + for (byte fv = 0; fv < _tr->numtr; fv++) if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) && ((x + _info._xLength) > _tr->tr[fv].x) && (x < (_tr->tr[fv].x + _tr->tr[fv]._info._xLength)) && - (_tr->tr[fv].y == y)) + (_tr->tr[fv].y == y)) return true; return false; @@ -193,7 +193,7 @@ void triptype::walk() { r._y1 = y - 2; r._x2 = ((x + _info._xLength) / 8) + 1; r._y2 = y + _info._yLength + 2; - + _tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r); } @@ -470,7 +470,7 @@ Trip::~Trip() { void Trip::loadtrip() { for (int16 gm = 0; gm < numtr; gm++) tr[gm].original(); - + for (uint16 i = 0; i < sizeof(aa); i++) aa[i] = 0; } @@ -491,7 +491,7 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) { for (fv = x1; fv <= x2; fv++) { for (ff = oy + yl; ff <= y + yl; ff++) { c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff); - if (c > a) + if (c > a) a = c; } } @@ -520,7 +520,7 @@ byte Trip::geida_ped(byte which) { case 5: return 9; case 4: - return 10; + return 10; default: return 0; } @@ -539,10 +539,10 @@ void Trip::catamove(byte ped) { // catacombs has a different number for it. - + xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256; _vm->_gyro->_dna._geidaSpin = 0; - + switch (xy_uint16) { case 1801: // Exit catacombs fliproom(r__lustiesroom, 4); @@ -696,7 +696,7 @@ void Trip::catamove(byte ped) { break; case 0x1: _vm->_celer->drawBackgroundSprite(-1, -1, 22); - + if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows)) _vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim; else @@ -724,7 +724,7 @@ void Trip::catamove(byte ped) { _vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; _vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door. break; - // LEFT handles: + // LEFT handles: #if 0 case 0x1: _vm->_celer->show_one(-1, -1, 4); @@ -837,7 +837,7 @@ void Trip::catamove(byte ped) { } } - + // This proc gets called whenever you touch a line defined as _vm->_gyro->special. void Trip::dawndelay() { @@ -875,7 +875,7 @@ void Trip::call_special(uint16 which) { // Should call some kind of Eachstep procedure which will deallocate // the sprite when it hits the wall, and replace it with the chunk // graphic of the arrow buried in the plaster. */ - + // OK! tr[1].call_eachstep = true; tr[1].eachstep = procarrow_procs; @@ -1005,7 +1005,7 @@ void Trip::call_special(uint16 which) { } } - + void Trip::open_the_door(byte whither, byte ped, byte magicnum) { // This slides the door open. (The data really ought to be saved in @@ -1087,7 +1087,7 @@ void Trip::newspeed() { for (page_ = 0; page_ <= 1; page_++) getset[page_].remember(lightspace); - + } void Trip::rwsp(byte t, byte dir) { @@ -1234,7 +1234,7 @@ void Trip::arrow_procs(byte tripnum) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door. _vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up. } - + } #if 0 @@ -1368,7 +1368,7 @@ void Trip::call_andexors() { } } while (!ok); - + _vm->_graphics->refreshBackground(); for (fv = 0; fv < 5; fv++) { @@ -1544,13 +1544,13 @@ bool Trip::neardoor() { // there ARE no doors here! return false; } - + int16 ux = tr[0].x; int16 uy = tr[0].y + tr[0]._info._yLength; bool nd = false; for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++) if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2) - && (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2)) + && (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2)) nd = true; return nd; } @@ -1561,7 +1561,7 @@ void Trip::new_game_for_trippancy() { // Called by gyro.newgame -void Trip::handleMoveKey(const Common::Event &event) { +void Trip::handleMoveKey(const Common::Event &event) { if (!_vm->_gyro->_dna._userMovesAvvy) return; diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h index 655adae8b6..e701464f85 100644 --- a/engines/avalanche/trip6.h +++ b/engines/avalanche/trip6.h @@ -28,8 +28,8 @@ /* TRIP5 Trippancy V - the sprite animation subsystem */ -#ifndef TRIP6_H -#define TRIP6_H +#ifndef AVALANCHE_TRIP6_H +#define AVALANCHE_TRIP6_H #include "avalanche/graphics.h" @@ -120,12 +120,9 @@ private: Trip *_tr; bool collision_check(); - int8 sgn(int16 val); }; - - const int16 maxgetset = 35; class getsettype { @@ -138,18 +135,11 @@ public: void recall(ByteField &r); }; - - - - - class Trip { public: friend class triptype; friend class getsettype; - - static const int16 up = 0; static const int16 right = 1; static const int16 down = 2; @@ -162,69 +152,37 @@ public: static const int16 numtr = 5; // current max no. of sprites - - static const int16 procfollow_avvy_y = 1; - static const int16 procback_and_forth = 2; - static const int16 procface_avvy = 3; - static const int16 procarrow_procs = 4; - static const int16 procspludwick_procs = 5; - static const int16 procgrab_avvy = 6; - static const int16 procgeida_procs = 7; - - Trip(AvalancheEngine *vm); - ~Trip(); void trippancy_link(); - void get_back_loretta(); - void loadtrip(); - void call_special(uint16 which); - void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors. - void catamove(byte ped); - void stopwalking(); - void tripkey(char dir); - void rwsp(byte t, byte dir); - void apped(byte trn, byte np); - void getback(); - void fliproom(byte room, byte ped); - bool infield(byte which); // Returns true if you're within field "which". - bool neardoor(); // Returns True if you're near a door. - void readstick(); - void newspeed(); - void new_game_for_trippancy(); - void take_a_step(byte &tripnum); - - - void handleMoveKey(const Common::Event &event); // To replace tripkey(). - triptype tr[numtr]; getsettype getset[2]; byte aa[1600]; @@ -240,32 +198,20 @@ private: // int16 beforex, beforey; byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl); - byte geida_ped(byte which); - void dawndelay(); - void hide_in_the_cupboard(); - void follow_avvy_y(byte tripnum); - void back_and_forth(byte tripnum); - void face_avvy(byte tripnum); - void arrow_procs(byte tripnum); - void grab_avvy(byte tripnum); - void spin(byte whichway, byte &tripnum); - void geida_procs(byte tripnum); - void call_andexors(); - void getsetclear(); }; } // End of namespace Avalanche. -#endif // TRIP6_H +#endif // AVALANCHE_TRIP6_H diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 4cdbe5a8de..f61236593e 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -49,7 +49,7 @@ bool Visa::bubbling = false; bool Visa::report_dixi_errors = true; void Visa::unskrimble() { - for (uint16 fv = 0; fv < _vm->_gyro->_bufSize; fv++) + for (uint16 fv = 0; fv < _vm->_gyro->_bufSize; fv++) _vm->_gyro->_buffer[fv] = (~(_vm->_gyro->_buffer[fv] - (fv + 1))) % 256; } @@ -182,7 +182,7 @@ void Visa::talkto(byte whom) { if (_vm->_gyro->_dna._talkedToCrapulus) // Spludwick - what does he need? // 0 - let it through to use normal routine. - switch (_vm->_gyro->_dna._givenToSpludwick) { + switch (_vm->_gyro->_dna._givenToSpludwick) { case 1: // Falltrough is intended. case 2:{ _vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble); @@ -251,7 +251,7 @@ void Visa::talkto(byte whom) { break; } // On a subject. Is there any reason to block it? - else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) { + else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) { dixi('q', 43); // He's fast asleep! return; } diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h index c3aa3f6255..37cb177fbe 100644 --- a/engines/avalanche/visa2.h +++ b/engines/avalanche/visa2.h @@ -27,8 +27,8 @@ /* VISA The new Sez handler. (Replaces Access.) */ -#ifndef VISA2_H -#define VISA2_H +#ifndef AVALANCHE_VISA2_H +#define AVALANCHE_VISA2_H #include "common/scummsys.h" @@ -60,4 +60,4 @@ private: } // End of namespace Avalanche. -#endif // VISA2_H +#endif // AVALANCHE_VISA2_H |