diff options
author | uruk | 2013-09-07 15:58:02 +0200 |
---|---|---|
committer | uruk | 2013-09-07 15:58:02 +0200 |
commit | 2bed64b447516f1f702fd70952a9886fac454b0d (patch) | |
tree | 2c5109df8ff5111bc3d385e074bc42aff136a354 /engines | |
parent | cfd7d06539e32ca088f01cd13e8b328aef801e24 (diff) | |
download | scummvm-rg350-2bed64b447516f1f702fd70952a9886fac454b0d.tar.gz scummvm-rg350-2bed64b447516f1f702fd70952a9886fac454b0d.tar.bz2 scummvm-rg350-2bed64b447516f1f702fd70952a9886fac454b0d.zip |
AVALANCHE: Do renaming/refactoring in Lucerna.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/acci2.cpp | 84 | ||||
-rw-r--r-- | engines/avalanche/avalanche.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 22 | ||||
-rw-r--r-- | engines/avalanche/dropdown2.cpp | 6 | ||||
-rw-r--r-- | engines/avalanche/enid2.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 13 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.cpp | 536 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.h | 119 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.cpp | 18 | ||||
-rw-r--r-- | engines/avalanche/timeout2.cpp | 20 | ||||
-rw-r--r-- | engines/avalanche/trip6.cpp | 18 | ||||
-rw-r--r-- | engines/avalanche/visa2.cpp | 8 |
12 files changed, 349 insertions, 507 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 830087361b..0712fd05cd 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -620,7 +620,7 @@ void Acci::parse() { void Acci::examineObject() { if (_thing != _vm->_gyro->_thinks) - _vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing); + _vm->_lucerna->thinkAbout(_thing, Gyro::kThing); switch (_thing) { case Gyro::kObjectWine : switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine. @@ -662,7 +662,7 @@ bool Acci::isPersonHere() { // Person equivalent of "holding". void Acci::exampers() { if (isPersonHere()) { if (_thing != _vm->_gyro->_thinks) - _vm->_lucerna->thinkabout(_person, _vm->_gyro->kPerson); + _vm->_lucerna->thinkAbout(_person, Gyro::kPerson); _person -= 149; switch (_person) { // Special cases case 11: @@ -777,7 +777,7 @@ void Acci::swallow() { // Eat something. _vm->_pingo->wobble(); _vm->_visa->dixi('U', 2); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); drink(); break; case 2: @@ -789,7 +789,7 @@ void Acci::swallow() { // Eat something. case Gyro::kObjectPotion: _vm->_gyro->setBackgroundColor(4); _vm->_visa->dixi('U', 3); - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); _vm->_gyro->setBackgroundColor(0); break; case Gyro::kObjectInk: @@ -800,7 +800,7 @@ void Acci::swallow() { // Eat something. break; case Gyro::kObjectMushroom: _vm->_visa->dixi('U', 6); - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); break; case Gyro::kObjectOnion: if (_vm->_gyro->_dna._rottenOnion) @@ -808,7 +808,7 @@ void Acci::swallow() { // Eat something. else { _vm->_visa->dixi('U', 8); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); } break; default: @@ -981,7 +981,7 @@ void Acci::putProc() { + _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!"); else { // Put onion into vinegar! Yes! _vm->_gyro->_dna._onionInVinegar = true; - _vm->_lucerna->points(7); + _vm->_lucerna->incScore(7); _vm->_visa->dixi('u', 9); } } @@ -1015,7 +1015,7 @@ void Acci::putProc() { _vm->_gyro->_dna._boxContent = _thing; _vm->_gyro->_dna._objects[_thing - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_scrolls->display("OK, it's in the box."); openBox(false); // Shut box. @@ -1064,26 +1064,26 @@ bool Acci::giveToSpludwick() { _vm->_gyro->_dna._givenToSpludwick++; _vm->_visa->dixi('q', 20); goToCauldron(); - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); } - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); break; case Gyro::kObjectInk: _vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_dna._givenToSpludwick++; _vm->_visa->dixi('q', 24); goToCauldron(); - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); break; case Gyro::kObjectMushroom: _vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = false; _vm->_visa->dixi('q', 25); - _vm->_lucerna->points(5); + _vm->_lucerna->incScore(5); _vm->_gyro->_dna._givenToSpludwick++; goToCauldron(); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); break; default: return true; @@ -1099,7 +1099,7 @@ void Acci::drink() { _vm->_gyro->_dna._teetotal = true; _vm->_gyro->_dna._avvyIsAwake = false; _vm->_gyro->_dna._avvyInBed = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_lucerna->dusk(); _vm->_gyro->hangAroundForAWhile(); _vm->_trip->fliproom(1, 1); @@ -1141,7 +1141,7 @@ void Acci::standUp() { _vm->_trip->apped(1, 2); _vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft; _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow. - _vm->_lucerna->points(1); + _vm->_lucerna->incScore(1); _vm->_gyro->_dna._avvyInBed = false; _vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts); } else @@ -1177,7 +1177,7 @@ void Acci::getProc(char thing) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_scrolls->display("OK, I've got it."); _vm->_gyro->_dna._objects[thing - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_dna._boxContent = kNothing; _vm->_celer->drawBackgroundSprite(-1, -1, 6); } else @@ -1197,7 +1197,7 @@ void Acci::getProc(char thing) { _vm->_trip->call_special(3); // Zap! _vm->_gyro->_dna._takenPen = true; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_scrolls->display("Taken."); } } else if (_vm->_gyro->_dna._standingOnDais) @@ -1219,8 +1219,8 @@ void Acci::getProc(char thing) { _vm->_gyro->_dna._mushroomGrowing = false; _vm->_gyro->_dna._takenMushroom = true; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = true; - _vm->_lucerna->objectlist(); - _vm->_lucerna->points(3); + _vm->_lucerna->refreshObjectList(); + _vm->_lucerna->incScore(3); } else _vm->_visa->dixi('q', 57); break; @@ -1239,7 +1239,7 @@ void Acci::giveGeidaTheLute() { return; } _vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_visa->dixi('q', 64); // She plays it. _vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings); @@ -1422,7 +1422,7 @@ void Acci::doThat() { case Gyro::kPeopleIbythneth: if (_thing == _vm->_gyro->kObjectBadge) { _vm->_visa->dixi('q', 32); // Thanks! Wow! - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = false; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectHabit - 1] = true; _vm->_gyro->_dna._givenBadgeToIby = true; @@ -1438,8 +1438,8 @@ void Acci::doThat() { _vm->_visa->dixi('q', 54); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = true; _vm->_gyro->_dna._givenPenToAyles = true; - _vm->_lucerna->objectlist(); - _vm->_lucerna->points(2); + _vm->_lucerna->refreshObjectList(); + _vm->_lucerna->incScore(2); } else heyThanks(); } else @@ -1450,9 +1450,9 @@ void Acci::doThat() { case Gyro::kObjectPotion: _vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = false; _vm->_visa->dixi('u', 16); // She drinks it. - _vm->_lucerna->points(2); + _vm->_lucerna->incScore(2); _vm->_gyro->_dna._givenPotionToGeida = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); break; case Gyro::kObjectLute: giveGeidaTheLute(); @@ -1478,7 +1478,7 @@ void Acci::doThat() { } } } - _vm->_lucerna->objectlist(); // Just in case... + _vm->_lucerna->refreshObjectList(); // Just in case... } break; @@ -1539,7 +1539,7 @@ void Acci::doThat() { else if (_vm->_gyro->_dna._avvysInTheCupboard) { _vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.'); _vm->_gyro->_dna._wearing = kNothing; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); } else _vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?"); break; @@ -1561,7 +1561,7 @@ void Acci::doThat() { } else _vm->_gyro->_dna._wearing = _thing; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); byte i; if (_thing == _vm->_gyro->kObjectHabit) @@ -1608,13 +1608,13 @@ void Acci::doThat() { // You won - strange! _vm->_visa->dixi('Q', 7); // You won! Give us a lute! _vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_dna._wonNim = true; _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it. - _vm->_lucerna->points(7); // 7 points for winning! + _vm->_lucerna->incScore(7); // 7 points for winning! if (_vm->_gyro->_dna._playedNim == 1) - _vm->_lucerna->points(3); // 3 points for playing your 1st game. + _vm->_lucerna->incScore(3); // 3 points for playing your 1st game. // A warning to the player that there should have been a mini-game. TODO: Remove it later!!! _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.") @@ -1729,7 +1729,7 @@ void Acci::doThat() { _vm->_pingo->zonk(); _vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, and fries you.") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")"); - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); } _vm->_gyro->_dna._sworeNum++; break; @@ -1761,7 +1761,7 @@ void Acci::doThat() { } if (_vm->_gyro->_dna._alcoholLevel == 0) - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); _vm->_celer->drawBackgroundSprite(-1, -1, 12); _vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble); @@ -1791,7 +1791,7 @@ void Acci::doThat() { _vm->_celer->drawBackgroundSprite(-1, -1, 12); _vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble); if (_vm->_gyro->_dna._alcoholLevel == 0) - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); _vm->_celer->drawBackgroundSprite(-1, -1, 10); _vm->_gyro->_dna._malagauche = 177; @@ -1815,11 +1815,11 @@ void Acci::doThat() { _vm->_visa->dixi('D', 11); else { _vm->_visa->dixi('D', 9); - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); } _vm->_gyro->decreaseMoney(3); // It costs thruppence. _vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_dna._boughtOnion = true; _vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall! _vm->_gyro->_dna._onionInVinegar = false; @@ -1858,9 +1858,9 @@ void Acci::doThat() { _vm->_gyro->_dna._cwytalotGone = true; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = false; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = false; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing; - _vm->_lucerna->points(7); + _vm->_lucerna->incScore(7); _vm->_trip->tr[1].walkto(2); _vm->_trip->tr[1].vanishifstill = true; _vm->_trip->tr[1].call_eachstep = false; @@ -1890,7 +1890,7 @@ void Acci::doThat() { if (_vm->_gyro->_dna._drawbridgeOpen != 0) _vm->_scrolls->display("Contrary to your expectations, the drawbridge fails to close again."); else { - _vm->_lucerna->points(4); + _vm->_lucerna->incScore(4); _vm->_scrolls->display("The drawbridge opens!"); _vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls); _vm->_gyro->_dna._drawbridgeOpen = 1; @@ -1903,7 +1903,7 @@ void Acci::doThat() { _vm->_enid->dir(_realWords[1]); break; case kVerbCodeDie: - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); break; case kVerbCodeScore: _vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter @@ -1959,7 +1959,7 @@ void Acci::doThat() { case 0: if (!_vm->_gyro->_dna._avvyIsAwake) { _vm->_gyro->_dna._avvyIsAwake = true; - _vm->_lucerna->points(1); + _vm->_lucerna->incScore(1); _vm->_gyro->_dna._avvyInBed = true; _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed. if (_vm->_gyro->_dna._teetotal) diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 4e3bbba319..fbdeb2583b 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -460,7 +460,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _celer->forgetBackgroundSprites(); - _lucerna->minor_redraw(); + _lucerna->minorRedraw(); _dropdown->setupMenu(); @@ -468,11 +468,11 @@ bool AvalancheEngine::loadGame(const int16 slot) { _gyro->_alive = true; - _lucerna->objectlist(); + _lucerna->refreshObjectList(); _trip->newspeed(); - _lucerna->showrw(); + _lucerna->drawDirection(); _gyro->_onToolbar = false; _trip->trippancy_link(); @@ -720,7 +720,7 @@ Common::Error AvalancheEngine::run() { // break; //} - } while (false); + } while (!shouldQuit()); diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index a84d67a7af..ff8a5aa8bf 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -111,7 +111,7 @@ void Avalot::handleKeyDown(Common::Event &event) { case Common::KEYCODE_KP5: if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) { _vm->_trip->handleMoveKey(event); // Fallthroughs are intended. - _vm->_lucerna->showrw(); + _vm->_lucerna->drawDirection(); return; } case Common::KEYCODE_BACKSPACE: @@ -124,7 +124,7 @@ void Avalot::handleKeyDown(Common::Event &event) { break; } - _vm->_lucerna->showrw(); + _vm->_lucerna->drawDirection(); } @@ -137,11 +137,11 @@ void Avalot::setup() { _vm->_gyro->_holdTheDawn = true; _vm->_lucerna->dusk(); _vm->_gyro->_currentMouse = 177; - _vm->_lucerna->mouse_init(); // on; + _vm->_gyro->setMousePointerWait(); _vm->_gyro->_dropsOk = true; _vm->_gyro->_mouseText = ""; _vm->_gyro->_dropdownActive = false; - _vm->_lucerna->load_digits(); + _vm->_lucerna->loadDigits(); _vm->_gyro->_cheat = false; _vm->_gyro->_cp = 0; _vm->_parser->_inputTextPos = 0; @@ -151,7 +151,7 @@ void Avalot::setup() { // TSkellern = 0; Replace with a more local variable sometime _vm->_gyro->_dna._direction = _vm->_gyro->kDirectionStopped; _vm->_gyro->_enidFilename = ""; // Undefined. - _vm->_lucerna->toolbar(); + _vm->_lucerna->drawToolbar(); _vm->_scrolls->state(2); for (byte i = 0; i < 3; i++) _vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits. @@ -171,7 +171,7 @@ void Avalot::setup() { int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot"); if (loadSlot >= 0) { _vm->_gyro->_thinks = 2; // You always have money. - _vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); + _vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); _vm->loadGame(loadSlot); } else { @@ -179,8 +179,8 @@ void Avalot::setup() { _vm->_gyro->newGame(); // No game was requested- load the default. _vm->_gyro->_soundFx = ! _vm->_gyro->_soundFx; - _vm->_lucerna->fxtoggle(); - _vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); + _vm->_lucerna->fxToggle(); + _vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); _vm->_visa->dixi('q', 83); // Info on the game, etc. } @@ -198,13 +198,13 @@ void Avalot::run(Common::String arg) { - _vm->_lucerna->clock_lucerna(); + _vm->_lucerna->updateClock(); _vm->_dropdown->updateMenu(); _vm->_gyro->forceNumlock(); _vm->_trip->get_back_loretta(); _vm->_celer->updateBackgroundSprites(); _vm->_trip->trippancy_link(); - _vm->_lucerna->checkclick(); + _vm->_lucerna->checkClick(); _vm->_timeout->one_tick(); @@ -227,7 +227,7 @@ void Avalot::run(Common::String arg) { uint32 delay = _vm->_system->getMillis() - beginLoop; if (delay <= 55) _vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight). - } while (! _vm->_gyro->_letMeOut); + } while (!_vm->_gyro->_letMeOut && !_vm->shouldQuit()); //if (logging) // close(logfile); diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index 1d3a0235d4..b0b3b2fd51 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -562,7 +562,7 @@ void Dropdown::runMenuGame() { _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBoss); break; case 2: - _vm->_lucerna->major_redraw(); + _vm->_lucerna->majorRedraw(); break; case 3: _vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore); @@ -641,11 +641,11 @@ void Dropdown::runMenuAction() { } void Dropdown::runMenuObjects() { - _vm->_lucerna->thinkabout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], _vm->_gyro->kThing); + _vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing); } void Dropdown::runMenuPeople() { - _vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->kPerson); + _vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson); _vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum]; } diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp index 7cf4075d1a..d942177391 100644 --- a/engines/avalanche/enid2.cpp +++ b/engines/avalanche/enid2.cpp @@ -272,13 +272,13 @@ void Enid::ednaReload() { _vm->_gyro->_seeScroll = true; // This prevents display of the new sprites before the // new picture is loaded. - _vm->_lucerna->major_redraw(); + _vm->_lucerna->majorRedraw(); _vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room; _vm->_gyro->_alive = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); if (_vm->_gyro->_holdTheDawn) { _vm->_gyro->_holdTheDawn = false; diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 879cc15714..cc624172d1 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -240,7 +240,6 @@ void Gyro::newGame() { memset(&_vm->_gyro->_dna, 0, sizeof(DnaType)); _vm->_scrolls->natural(); - _vm->_lucerna->mousepage(0); _dna._spareEvening = "answer a questionnaire"; _dna._favouriteDrink = "beer"; @@ -254,7 +253,7 @@ void Gyro::newGame() { _thinkThing = true; _thinks = 2; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _onToolbar = false; _seeScroll = false; @@ -276,12 +275,12 @@ void Gyro::newGame() { _vm->_trip->getback(); } - _vm->_lucerna->enterroom(1, 1); + _vm->_lucerna->enterRoom(1, 1); _vm->_trip->new_game_for_trippancy(); - _vm->_lucerna->showscore(); + _vm->_lucerna->drawScore(); _vm->_dropdown->setupMenu(); - _vm->_lucerna->clock_lucerna(); - _vm->_lucerna->sprite_run(); + _vm->_lucerna->updateClock(); + _vm->_lucerna->spriteRun(); } void Gyro::click() { @@ -309,7 +308,7 @@ bool Gyro::decreaseMoney(uint16 howmuchby) { _dna._money -= howmuchby; if (_dna._money < 0) { _vm->_visa->dixi('Q', 2); // "You are now denariusless!" - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); return false; } else return true; diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index a2df1fae24..76b2836c0f 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -47,13 +47,9 @@ #include "graphics/palette.h" -//#include "dropdown.h" -//#include "basher.h" - - namespace Avalanche { -Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) { +Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false) { _vm = vm; } @@ -99,19 +95,17 @@ void Lucerna::callVerb(byte id) { } } -void Lucerna::draw_also_lines() { - byte ff; - +void Lucerna::drawAlsoLines() { CursorMan.showMouse(false); _vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0); _vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15); - for (ff = 0; ff < _vm->_gyro->_lineNum; ff++) { + for (byte i = 0; i < _vm->_gyro->_lineNum; i++) { // We had to check if the lines are within the borders of the screen. - if ((_vm->_gyro->_lines[ff]._x1 >= 0) && (_vm->_gyro->_lines[ff]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y1 >= 0) && (_vm->_gyro->_lines[ff]._y1 < _vm->_graphics->kScreenHeight) - && (_vm->_gyro->_lines[ff]._x2 >= 0) && (_vm->_gyro->_lines[ff]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y2 >= 0) && (_vm->_gyro->_lines[ff]._y2 < _vm->_graphics->kScreenHeight)) - _vm->_graphics->_magics.drawLine(_vm->_gyro->_lines[ff]._x1, _vm->_gyro->_lines[ff]._y1, _vm->_gyro->_lines[ff]._x2, _vm->_gyro->_lines[ff]._y2, _vm->_gyro->_lines[ff]._color); + if ((_vm->_gyro->_lines[i]._x1 >= 0) && (_vm->_gyro->_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y1 >= 0) && (_vm->_gyro->_lines[i]._y1 < _vm->_graphics->kScreenHeight) + && (_vm->_gyro->_lines[i]._x2 >= 0) && (_vm->_gyro->_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y2 >= 0) && (_vm->_gyro->_lines[i]._y2 < _vm->_graphics->kScreenHeight)) + _vm->_graphics->_magics.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]._color); } CursorMan.showMouse(true); @@ -121,173 +115,160 @@ void Lucerna::draw_also_lines() { // nextstring, scram1 and unscrable are only used in load_also -Common::String Lucerna::nextstring() { +Common::String Lucerna::readAlsoStringFromFile() { Common::String str; - byte length = f.readByte(); + byte length = file.readByte(); for (int i = 0; i < length; i++) - str += f.readByte(); + str += file.readByte(); return str; } -void Lucerna::scram1(Common::String &x) { - for (uint fz = 0; fz < x.size(); fz++) - x.setChar(x[fz] ^ 177, fz); +void Lucerna::scram(Common::String &str) { + for (uint i = 0; i < str.size(); i++) + str.setChar(str[i] ^ 177, i); } -void Lucerna::unscramble() { - for (byte fv = 0; fv < 31; fv++) - for (byte ff = 0; ff < 2; ff++) - if (_vm->_gyro->_also[fv][ff] != 0) - scram1(*_vm->_gyro->_also[fv][ff]); - scram1(_vm->_gyro->_listen); - scram1(_vm->_gyro->_flags); +void Lucerna::unScramble() { + for (byte i = 0; i < 31; i++) + for (byte j = 0; j < 2; j++) + if (_vm->_gyro->_also[i][j] != 0) + scram(*_vm->_gyro->_also[i][j]); + scram(_vm->_gyro->_listen); + scram(_vm->_gyro->_flags); } -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) { - delete _vm->_gyro->_also[fv][ff]; - _vm->_gyro->_also[fv][ff] = 0; +void Lucerna::loadAlso(byte num) { + for (byte i = 0; i < 31; i++) + for (byte j = 0; j < 2; j++) + if (_vm->_gyro->_also[i][j] != 0) { + delete _vm->_gyro->_also[i][j]; + _vm->_gyro->_also[i][j] = 0; } Common::String filename; - filename = filename.format("also%s.avd", n.c_str()); - if (!f.open(filename)) { + filename = filename.format("also%d.avd", num); + if (!file.open(filename)) { warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str()); return; } - f.seek(128); + file.seek(128); - byte minnames = f.readByte(); - for (fv = 0; fv <= minnames; fv++) { - for (ff = 0; ff < 2; ff++) { - _vm->_gyro->_also[fv][ff] = new Common::String; - *_vm->_gyro->_also[fv][ff] = nextstring(); + byte alsoNum = file.readByte(); + for (byte i = 0; i <= alsoNum; i++) { + for (byte j = 0; j < 2; j++) { + _vm->_gyro->_also[i][j] = new Common::String; + *_vm->_gyro->_also[i][j] = readAlsoStringFromFile(); } - *_vm->_gyro->_also[fv][0] = Common::String('\x9D') + *_vm->_gyro->_also[fv][0] + Common::String('\x9D'); + *_vm->_gyro->_also[i][0] = Common::String('\x9D') + *_vm->_gyro->_also[i][0] + Common::String('\x9D'); } memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines)); - //fv = getpixel(0, 0); - _vm->_gyro->_lineNum = f.readByte(); + _vm->_gyro->_lineNum = file.readByte(); for (byte i = 0; i < _vm->_gyro->_lineNum; i++) { - _vm->_gyro->_lines[i]._x1 = f.readSint16LE(); - _vm->_gyro->_lines[i]._y1 = f.readSint16LE(); - _vm->_gyro->_lines[i]._x2 = f.readSint16LE(); - _vm->_gyro->_lines[i]._y2 = f.readSint16LE(); - _vm->_gyro->_lines[i]._color = f.readByte(); + _vm->_gyro->_lines[i]._x1 = file.readSint16LE(); + _vm->_gyro->_lines[i]._y1 = file.readSint16LE(); + _vm->_gyro->_lines[i]._x2 = file.readSint16LE(); + _vm->_gyro->_lines[i]._y2 = file.readSint16LE(); + _vm->_gyro->_lines[i]._color = file.readByte(); } memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds)); - fv = f.readByte(); - for (byte i = 0; i < fv; i++) { - _vm->_gyro->_peds[i]._x = f.readSint16LE(); - _vm->_gyro->_peds[i]._y = f.readSint16LE(); - _vm->_gyro->_peds[i]._direction = f.readByte(); + byte pedNum = file.readByte(); + for (byte i = 0; i < pedNum; i++) { + _vm->_gyro->_peds[i]._x = file.readSint16LE(); + _vm->_gyro->_peds[i]._y = file.readSint16LE(); + _vm->_gyro->_peds[i]._direction = file.readByte(); } - _vm->_gyro->_fieldNum = f.readByte(); + _vm->_gyro->_fieldNum = file.readByte(); for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) { - _vm->_gyro->_fields[i]._x1 = f.readSint16LE(); - _vm->_gyro->_fields[i]._y1 = f.readSint16LE(); - _vm->_gyro->_fields[i]._x2 = f.readSint16LE(); - _vm->_gyro->_fields[i]._y2 = f.readSint16LE(); + _vm->_gyro->_fields[i]._x1 = file.readSint16LE(); + _vm->_gyro->_fields[i]._y1 = file.readSint16LE(); + _vm->_gyro->_fields[i]._x2 = file.readSint16LE(); + _vm->_gyro->_fields[i]._y2 = file.readSint16LE(); } for (byte i = 0; i < 15; i++) { - _vm->_gyro->_magics[i]._operation = f.readByte(); - _vm->_gyro->_magics[i]._data = f.readUint16LE(); + _vm->_gyro->_magics[i]._operation = file.readByte(); + _vm->_gyro->_magics[i]._data = file.readUint16LE(); } for (byte i = 0; i < 7; i++) { - _vm->_gyro->_portals[i]._operation = f.readByte(); - _vm->_gyro->_portals[i]._data = f.readUint16LE(); + _vm->_gyro->_portals[i]._operation = file.readByte(); + _vm->_gyro->_portals[i]._data = file.readUint16LE(); } _vm->_gyro->_flags.clear(); for (byte i = 0; i < 26; i++) - _vm->_gyro->_flags += f.readByte(); + _vm->_gyro->_flags += file.readByte(); - int16 listen_length = f.readByte(); + int16 listen_length = file.readByte(); _vm->_gyro->_listen.clear(); for (byte i = 0; i < listen_length; i++) - _vm->_gyro->_listen += f.readByte(); - - draw_also_lines(); + _vm->_gyro->_listen += file.readByte(); - //setactivepage(1); - warning("STUB: Lucerna::load_also()"); + drawAlsoLines(); - f.close(); - unscramble(); - for (fv = 0; fv <= minnames; fv++) - *_vm->_gyro->_also[fv][0] = Common::String(',') + *_vm->_gyro->_also[fv][0] + ','; + file.close(); + unScramble(); + for (byte i = 0; i <= alsoNum; i++) + *_vm->_gyro->_also[i][0] = Common::String(',') + *_vm->_gyro->_also[i][0] + ','; } -void Lucerna::load(byte n) { // Load2, actually - Common::String xx; - +void Lucerna::loadRoom(byte num) { CursorMan.showMouse(false); _vm->_graphics->fleshColors(); - xx = _vm->_gyro->intToStr(n); Common::String filename; - filename = filename.format("place%s.avd", xx.c_str()); - if (!f.open(filename)) { + filename = filename.format("place%d.avd", num); + if (!file.open(filename)) { warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str()); return; } - f.seek(146); + file.seek(146); if (!_vm->_gyro->_roomnName.empty()) _vm->_gyro->_roomnName.clear(); for (byte i = 0; i < 30; i++) { - char actChar = f.readByte(); + char actChar = file.readByte(); if ((32 <= actChar) && (actChar <= 126)) _vm->_gyro->_roomnName += actChar; } // Compression method byte follows this... - f.seek(177); + file.seek(177); - _vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight); + _vm->_graphics->_background = _vm->_graphics->loadPictureRow(file, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight); _vm->_graphics->refreshBackground(); - f.close(); + file.close(); - load_also(xx); - _vm->_celer->loadBackgroundSprites(n); - // byte bit = *_vm->_graphics->getPixel(0,0); + loadAlso(num); + _vm->_celer->loadBackgroundSprites(num); CursorMan.showMouse(true); } -void Lucerna::zoomout(int16 x, int16 y) { -// int16 x1, y1, x2, y2; -// byte fv; - +void Lucerna::zoomOut(int16 x, int16 y) { warning("STUB: Lucerna::zoomout()"); } -void Lucerna::find_people(byte room) { - for (byte fv = 1; fv < 29; fv++) { - if (_vm->_gyro->_whereIs[fv] == room) { - if (fv < 25) - _vm->_gyro->_him = fv + 150; +void Lucerna::findPeople(byte room) { + for (byte i = 1; i < 29; i++) { + if (_vm->_gyro->_whereIs[i] == room) { + if (i < 25) + _vm->_gyro->_him = i + 150; else - _vm->_gyro->_her = fv + 150; + _vm->_gyro->_her = i + 150; } } } -void Lucerna::exitroom(byte x) { +void Lucerna::exitRoom(byte x) { //nosound(); _vm->_celer->forgetBackgroundSprites(); _vm->_gyro->_seeScroll = true; // This stops the trippancy system working over the length of this procedure. @@ -321,7 +302,7 @@ void Lucerna::exitroom(byte x) { _vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room; } -void Lucerna::new_town() { // You've just entered a town from the map. +void Lucerna::enterNewTown() { _vm->_dropdown->setupMenu(); switch (_vm->_gyro->_dna._room) { @@ -351,41 +332,41 @@ void Lucerna::new_town() { // You've just entered a town from the map. -void Lucerna::put_geida_at(byte whichped, byte &ped) { +void Lucerna::putGeidaAt(byte whichPed, byte &ped) { if (ped == 0) return; _vm->_trip->tr[1].init(5, false, _vm->_trip); // load Geida - _vm->_trip->apped(2, whichped); + _vm->_trip->apped(2, whichPed); _vm->_trip->tr[1].call_eachstep = true; _vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs; } -void Lucerna::enterroom(byte x, byte ped) { +void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_seeScroll = true; // This stops the trippancy system working over the length of this procedure. - find_people(x); - _vm->_gyro->_dna._room = x; + findPeople(room); + _vm->_gyro->_dna._room = room; if (ped != 0) - _vm->_gyro->_dna._roomCount[x]++; + _vm->_gyro->_dna._roomCount[room]++; - load(x); + loadRoom(room); - if ((_vm->_gyro->_dna._roomCount[x] == 0) && (! _vm->_gyro->setFlag('S'))) - points(1); + if ((_vm->_gyro->_dna._roomCount[room] == 0) && (! _vm->_gyro->setFlag('S'))) + incScore(1); _vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room; if (_vm->_gyro->_dna._geidaFollows) - _vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = x; + _vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = room; _vm->_gyro->_roomTime = 0; if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room)) - new_town(); + enterNewTown(); - switch (x) { + switch (room) { case r__yours: if (_vm->_gyro->_dna._avvyInBed) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); @@ -449,7 +430,7 @@ void Lucerna::enterroom(byte x, byte ped) { case r__brummieroad: if (_vm->_gyro->_dna._geidaFollows) - put_geida_at(5, ped); + putGeidaAt(5, ped); if (_vm->_gyro->_dna._cwytalotGone) { _vm->_gyro->_magics[kColorLightred - 1]._operation = _vm->_gyro->kMagicNothing; _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere; @@ -492,7 +473,7 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_gyro->_magics[kColorGreen - 1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge. } if (_vm->_gyro->_dna._geidaFollows) - put_geida_at(ped + 3, ped); // load Geida + putGeidaAt(ped + 3, ped); // load Geida break; case r__robins: @@ -549,14 +530,14 @@ void Lucerna::enterroom(byte x, byte ped) { dawn(); //setactivepage(cp); if (ped > 0) - zoomout(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y); + zoomOut(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y); //setactivepage(1 - cp); { if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) { _vm->_visa->dixi('q', 9); // Don't want to waste the wine! _vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false; - objectlist(); + refreshObjectList(); } } @@ -610,7 +591,7 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks); if (_vm->_gyro->_dna._geidaFollows) { - put_geida_at(5, ped); + putGeidaAt(5, ped); if (_vm->_gyro->_dna._lustieIsAsleep) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_graphics->refreshBackground(); @@ -738,18 +719,18 @@ void Lucerna::enterroom(byte x, byte ped) { break; // Ayles awake. case r__geidas: - put_geida_at(2, ped); + putGeidaAt(2, ped); break; // load Geida case r__easthall: case r__westhall: if (_vm->_gyro->_dna._geidaFollows) - put_geida_at(ped + 2, ped); + putGeidaAt(ped + 2, ped); break; case r__lusties: if (_vm->_gyro->_dna._geidaFollows) - put_geida_at(ped + 6, ped); + putGeidaAt(ped + 6, ped); break; case r__nottspub: @@ -781,43 +762,45 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_gyro->isLoaded = false; } -void Lucerna::thinkabout(byte z, bool th) { // Hey!!! Get it and put it!!! - const int16 picsize = 966; - const ByteField thinkspace = {25, 170, 32, 200}; +void Lucerna::thinkAbout(byte object, bool type) { + const int16 picSize = 966; - _vm->_gyro->_thinks = z; - z--; + _vm->_gyro->_thinks = object; + object--; _vm->_gyro->setMousePointerWait(); - if (th) { - if (!f.open("thinks.avd")) { + switch (type) { + case Gyro::kThing: + if (!file.open("thinks.avd")) { warning("AVALANCHE: Lucerna: File not found: thinks.avd"); return; } - } else { - if (!f.open("folk.avd")) { + break; + case Gyro::kPerson: + if (!file.open("folk.avd")) { warning("AVALANCHE: Lucerna: File not found: folk.avd"); return; } - z = z - 149; - if (z >= 25) - z -= 8; - if (z == 20) - z--; // Last time... + object = object - 149; + if (object >= 25) + object -= 8; + if (object == 20) + object--; // Last time... + break; } - f.seek(z * picsize + 65); + file.seek(object * picSize + 65); - ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f); + ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file); _vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170); picture.free(); - f.close(); + file.close(); CursorMan.showMouse(false); @@ -827,75 +810,57 @@ void Lucerna::thinkabout(byte z, bool th) { // Hey!!! Get it and put it!!! setactivepage(1 - cp); #endif - for (byte fv = 0; fv <= 1; fv++) - _vm->_trip->getset[fv].remember(thinkspace); - CursorMan.showMouse(true); - _vm->_gyro->_thinkThing = th; + _vm->_gyro->_thinkThing = type; } -void Lucerna::load_digits() { // Load the scoring digits & rwlites +void Lucerna::loadDigits() { // Load the scoring digits & rwlites const byte digitsize = 134; const byte rwlitesize = 126; - if (!f.open("digit.avd")) { + if (!file.open("digit.avd")) { warning("AVALANCHE: Lucerna: File not found: digit.avd"); return; } - 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); -#endif - - _vm->_gyro->_digits[fv] = _vm->_graphics->loadPictureGraphic(f); + for (byte i = 0; i < 10; i++) { + file.seek(i * digitsize); + _vm->_gyro->_digits[i] = _vm->_graphics->loadPictureGraphic(file); } - 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); -#endif - - _vm->_gyro->_directions[ff] = _vm->_graphics->loadPictureGraphic(f); + for (byte i = 0; i < 9; i++) { + file.seek(10 * digitsize + i * rwlitesize); + _vm->_gyro->_directions[i] = _vm->_graphics->loadPictureGraphic(file); } - f.close(); + file.close(); } -void Lucerna::toolbar() { - if (!f.open("useful.avd")) { +void Lucerna::drawToolbar() { + if (!file.open("useful.avd")) { warning("AVALANCHE: Lucerna: File not found: useful.avd"); return; } - f.seek(40); + file.seek(40); - // off; + CursorMan.showMouse(false); - ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f); + ::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file); _vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169); picture.free(); - f.close(); + file.close(); - // on; + CursorMan.showMouse(true); _vm->_gyro->_oldDirection = 177; - showrw(); + drawDirection(); } -void Lucerna::showscore() { - - const ByteField scorespace = {33, 177, 39, 200}; - +void Lucerna::drawScore() { if (_vm->_gyro->kDemo) return; @@ -912,23 +877,17 @@ void Lucerna::showscore() { CursorMan.showMouse(false); - //setactivepage(3); - for (byte fv = 0; fv < 3; 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++) - _vm->_trip->getset[fv].remember(scorespace); - - //setactivepage(1 - cp); - CursorMan.showMouse(true); + for (byte i = 0; i < 3; i++) _vm->_gyro->_scoreToDisplay[i] = numbers[i]; } -void Lucerna::points(byte num) { // Add on no. of points +void Lucerna::incScore(byte num) { // Add on no. of points for (byte q = 1; q <= num; q++) { _vm->_gyro->_dna._score++; @@ -942,39 +901,35 @@ void Lucerna::points(byte num) { // Add on no. of points } warning("STUB: Lucerna::points()"); - showscore(); + drawScore(); } -void Lucerna::topcheck(Common::Point cursorPos) { - _vm->_dropdown->_menuBar.chooseMenuItem(cursorPos.x); -} - -void Lucerna::mouseway(const Common::Point &cursorPos) { - byte col = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2); +void Lucerna::useCompass(const Common::Point &cursorPos) { + byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2); - switch (col) { + switch (color) { case kColorGreen: { _vm->_gyro->_dna._direction = _vm->_trip->kDirUp; _vm->_trip->rwsp(0, _vm->_trip->kDirUp); - showrw(); + drawDirection(); } break; case kColorBrown: { _vm->_gyro->_dna._direction = _vm->_trip->kDirDown; _vm->_trip->rwsp(0, _vm->_trip->kDirDown); - showrw(); + drawDirection(); } break; case kColorCyan: { _vm->_gyro->_dna._direction = _vm->_trip->kDirLeft; _vm->_trip->rwsp(0, _vm->_trip->kDirLeft); - showrw(); + drawDirection(); } break; case kColorLightmagenta: { _vm->_gyro->_dna._direction = _vm->_trip->kDirRight; _vm->_trip->rwsp(0, _vm->_trip->kDirRight); - showrw(); + drawDirection(); } break; case kColorRed: @@ -982,32 +937,28 @@ void Lucerna::mouseway(const Common::Point &cursorPos) { case kColorLightcyan: case kColorYellow: { // Fall-throughs are intended. _vm->_trip->stopwalking(); - showrw(); + drawDirection(); } break; } } -void Lucerna::posxy() { - warning("STUB: Lucerna::posxy()"); -} - -void Lucerna::fxtoggle() { +void Lucerna::fxToggle() { warning("STUB: Lucerna::fxtoggle()"); } -void Lucerna::objectlist() { +void Lucerna::refreshObjectList() { _vm->_gyro->_dna._carryNum = 0; if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1]) - thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); // you always have money - for (byte fv = 0; fv < kObjectNum; fv++) - if (_vm->_gyro->_dna._objects[fv]) { + thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); // you always have money + for (byte i = 0; i < kObjectNum; i++) + if (_vm->_gyro->_dna._objects[i]) { _vm->_gyro->_dna._carryNum++; - _vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = fv + 1; + _vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1; } } -void Lucerna::verte(Common::Point cursorPos) { +void Lucerna::guideAvvy(Common::Point cursorPos) { if (! _vm->_gyro->_dna._userMovesAvvy) return; @@ -1057,10 +1008,10 @@ void Lucerna::verte(Common::Point cursorPos) { break; } // No other values are possible. - showrw(); + drawDirection(); } -void Lucerna::checkclick() { +void Lucerna::checkClick() { Common::Point cursorPos = _vm->getMousePos(); _vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10)); @@ -1076,7 +1027,7 @@ void Lucerna::checkclick() { else if (!_vm->_gyro->_dropdownActive) { // Dropdown can handle its own pointers. if (holdLeftMouse) { _vm->_gyro->newMouse(7); // Mark's crosshairs - verte(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around. + guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around. } else _vm->_gyro->newMouse(4); // fletch } @@ -1096,7 +1047,7 @@ void Lucerna::checkclick() { } else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar. if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass. if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) - mouseway(cursorPos); + useCompass(cursorPos); } else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing. do { _vm->updateEvents(); @@ -1124,7 +1075,7 @@ void Lucerna::checkclick() { _vm->_trip->tr[0].xs = _vm->_gyro->kRun; _vm->_trip->newspeed(); } else if ((396 <= cursorPos.x) && (cursorPos.x <= 483)) - fxtoggle(); + fxToggle(); else if ((535 <= cursorPos.x) && (cursorPos.x <= 640)) _vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText; } else if (!_vm->_gyro->_dropsOk) @@ -1132,170 +1083,102 @@ void Lucerna::checkclick() { } } -void Lucerna::mouse_init() { - _vm->_gyro->setMousePointerWait(); -} - -void Lucerna::mousepage(uint16 page_) { - warning("STUB: Lucerna::mousepage()"); -} - -void Lucerna::errorled() { +void Lucerna::errorLed() { warning("STUB: Lucerna::errorled()"); } int8 Lucerna::fades(int8 x) { - byte r = x / 16; - x = x % 16; - byte g = x / 4; - byte b = x % 4; - if (r > 0) - r--; - if (g > 0) - g--; - if (b > 0) - b--; - - return (16 * r + 4 * g + b); - // fades = x - 1; + warning("STUB: Lucerna::fades()"); + return 0; } - - - -void Lucerna::fadeout(byte n) { - warning("STUB: Lucerna::fadeout()"); // I'll bother with colors later. +void Lucerna::fadeOut(byte n) { + warning("STUB: Lucerna::fadeOut()"); } void Lucerna::dusk() { - warning("STUB: Lucerna::dusk()"); // I'll bother with colors later. + warning("STUB: Lucerna::dusk()"); } - - - -void Lucerna::fadein(byte n) { - warning("STUB: Lucerna::fadein()"); +void Lucerna::fadeIn(byte n) { + warning("STUB: Lucerna::fadeIn()"); } void Lucerna::dawn() { warning("STUB: Lucerna::dawn()"); } - - -void Lucerna::showrw() { // It's data is loaded in load_digits(). +void Lucerna::drawDirection() { // It's data is loaded in load_digits(). 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_); - putimage(0, 161, rwlite[with.rw], 0); - } -#endif + CursorMan.showMouse(false); _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161); CursorMan.showMouse(true); - //setactivepage(1 - cp); - - warning("STUB: Lucerna::showrw()"); } - - - - - -void Lucerna::calchand(uint16 ang, uint16 length, Common::Point &a, byte c) { - if (ang > 900) { - a.x = 177; +void Lucerna::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) { + if (angle > 900) { + endPoint.x = 177; return; } - a = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - ang, 450 - ang, length, c); + endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - angle, 450 - angle, length, color); } -void Lucerna::hand(const Common::Point &a, byte c) { - if (a.x == 177) +void Lucerna::drawHand(const Common::Point &endPoint, byte color) { + if (endPoint.x == 177) return; - _vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, a.x, a.y, c); -} - -void Lucerna::refresh_hands() { - const ByteField clockspace = {61, 166, 66, 200}; - - for (byte page_ = 0; page_ < 2; page_++) - _vm->_trip->getset[page_].remember(clockspace); + _vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, endPoint.x, endPoint.y, color); } -void Lucerna::plothands() { - // off; - //setactivepage(3); - calchand(_vm->_gyro->_onh, 14, ah, kColorYellow); - calchand(_vm->_gyro->_om * 6, 17, am, kColorYellow); - hand(ah, kColorBrown); - hand(am, kColorBrown); - - calchand(nh, 14, ah, kColorBrown); - calchand(_vm->_gyro->_minutes * 6, 17, am, kColorBrown); - hand(ah, kColorYellow); - hand(am, kColorYellow); - - //setactivepage(1 - cp); +void Lucerna::plotHands() { + calcHand(_vm->_gyro->_onh, 14, _clockHandHour, kColorYellow); + calcHand(_vm->_gyro->_om * 6, 17, _clockHandMinute, kColorYellow); + drawHand(_clockHandHour, kColorBrown); + drawHand(_clockHandMinute, kColorBrown); - refresh_hands(); - - // on; + calcHand(_hourAngle, 14, _clockHandHour, kColorBrown); + calcHand(_vm->_gyro->_minutes * 6, 17, _clockHandMinute, kColorBrown); + drawHand(_clockHandHour, kColorYellow); + drawHand(_clockHandMinute, kColorYellow); } void Lucerna::chime() { warning("STUB: Lucerna::chime()"); } -void Lucerna::clock_lucerna() { - // ...Clock. +void Lucerna::updateClock() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them. TimeDate t; _vm->_system->getTimeAndDate(t); _vm->_gyro->_hours = t.tm_hour; _vm->_gyro->_minutes = t.tm_min; _vm->_gyro->_seconds = t.tm_sec; - nh = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2; + _hourAngle = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2; if (_vm->_gyro->_oh != _vm->_gyro->_hours) { - plothands(); + plotHands(); chime(); } if (_vm->_gyro->_om != _vm->_gyro->_minutes) - plothands(); + plotHands(); 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->_onh = _hourAngle; _vm->_gyro->_om = _vm->_gyro->_minutes; } - - -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); -} - -void Lucerna::gameover() { +void Lucerna::gameOver() { _vm->_gyro->_dna._userMovesAvvy = false; int16 sx = _vm->_trip->tr[0].x; @@ -1307,36 +1190,32 @@ void Lucerna::gameover() { _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; } -/* OK. There are two kinds of redraw: Major and Minor. Minor is what happens - when you load a game, etc. Major redraws EVERYTHING. */ - -void Lucerna::minor_redraw() { +void Lucerna::minorRedraw() { dusk(); - enterroom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant. + enterRoom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant. - for (byte fv = 0; fv <= 1; fv++) { + for (byte i = 0; i <= 1; i++) { _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(); + drawScore(); dawn(); } -void Lucerna::major_redraw() { +void Lucerna::majorRedraw() { warning("STUB: Lucerna::major_redraw()"); } -uint16 Lucerna::bearing(byte whichped) { - byte pedId = whichped - 1; // Different array indexes in Pascal and C. +uint16 Lucerna::bearing(byte whichPed) { + byte pedId = whichPed - 1; // Different array indexes in Pascal and C. const double rad2deg = 180 / 3.14; // Pi @@ -1351,25 +1230,20 @@ uint16 Lucerna::bearing(byte whichped) { } } -void Lucerna::sprite_run() { -/* A sprite run is performed before displaying a scroll, if not all the - sprites are still. It performs two fast cycles, only using a few of - the links usually used, and without any extra animation. This should - make the sprites the same on both pages. */ +void Lucerna::spriteRun() { _vm->_gyro->_doingSpriteRun = true; _vm->_trip->get_back_loretta(); _vm->_trip->trippancy_link(); _vm->_gyro->_doingSpriteRun = false; - } -void Lucerna::fix_flashers() { +void Lucerna::fixFlashers() { _vm->_gyro->_ledStatus = 177; _vm->_gyro->_oldDirection = 177; _vm->_scrolls->state(2); - showrw(); + drawDirection(); } } // End of namespace Avalanche diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h index 1436e388b5..6835fe01c1 100644 --- a/engines/avalanche/lucerna2.h +++ b/engines/avalanche/lucerna2.h @@ -45,94 +45,69 @@ public: void init(); void callVerb(byte id); - void draw_also_lines(); - void mouse_init(); - void mousepage(uint16 page_); - void load(byte n); - void exitroom(byte x); - void enterroom(byte x, byte ped); - void thinkabout(byte z, bool th); // Hey!!! Get it and put it!!! - void load_digits(); // Load the scoring digits & rwlites - void toolbar(); - void showscore(); - void points(byte num); // Add on no. of points - void mouseway(const Common::Point &cursorPos); - void posxy(); - void fxtoggle(); - void objectlist(); - void checkclick(); - void errorled(); + void drawAlsoLines(); + void loadRoom(byte num); + void exitRoom(byte x); + void enterRoom(byte room, byte ped); + void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!! + void loadDigits(); // Load the scoring digits & rwlites + 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 showrw(); - void clock_lucerna(); - void delavvy(); - void gameover(); - void minor_redraw(); - void major_redraw(); - uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees. - void flesh_colors(); - void sprite_run(); - void fix_flashers(); - void load_also(Common::String n); + void drawDirection(); // Draws the little icon at the left end of the text input field. + void updateClock(); + void gameOver(); + uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees. + void fixFlashers(); + void loadAlso(byte num); -private: - AvalancheEngine *_vm; + // There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING. + void minorRedraw(); + void majorRedraw(); - struct rgbrec { - int16 red; - int16 green; - int16 blue; - }; + // A sprite run is performed before displaying a scroll, if not all the sprites are still. It performs two fast cycles, only using a few of + // the links usually used, and without any extra animation. This should make the sprites the same on both pages. + void spriteRun(); - struct palettetype { - int32 size; - rgbrec colors[256]; - }; +private: + AvalancheEngine *_vm; //Clock static const int16 _clockCenterX = 510; static const int16 _clockCenterY = 183; - Common::Point ah, am; - uint16 nh; - - - palettetype fxpal[4]; - - bool fxhidden; - - Common::File f; + Common::Point _clockHandHour, _clockHandMinute; // ah and am in the original. + uint16 _hourAngle; // nh in the original. + bool _fxHidden; // Will de used in dust() and dawn(). + Common::File file; + Common::String readAlsoStringFromFile(); // 'nexstring' in the original. + void scram(Common::String &str); + void unScramble(); - Common::String nextstring(); - void scram1(Common::String &x); - void unscramble(); - - void zoomout(int16 x, int16 y); - - void find_people(byte room); - - void new_town(); - - void put_geida_at(byte whichped, byte &ped); - - void topcheck(Common::Point cursorPos); - - void verte(Common::Point cursorPos); + void zoomOut(int16 x, int16 y); // Only used when entering the map. + void enterNewTown(); // Onyl when entering a NEW town! Not returning to the last one, but choosing another from the map. + void findPeople(byte room); + void putGeidaAt(byte whichPed, byte &ped); + void guideAvvy(Common::Point cursorPos); // 'verte' in the original. + // Used in dusk() and dawn(). int8 fades(int8 x); + void fadeOut(byte n); + void fadeIn(byte n); - void fadeout(byte n); - - void fadein(byte n); - - // clock_lucerna - void calchand(uint16 ang, uint16 length, Common::Point &a, byte c); - void hand(const Common::Point &a, byte c); - void refresh_hands(); - void plothands(); + // Clock + void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color); + void drawHand(const Common::Point &endPoint, byte color); + void plotHands(); void chime(); }; diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 67247a4483..16e0fb11ad 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -123,7 +123,6 @@ void Scrolls::normscroll() { _vm->_gyro->_seeScroll = true; CursorMan.showMouse(true); _vm->_gyro->newMouse(4); - _vm->_lucerna->mousepage(1 - _vm->_gyro->_cp); @@ -185,7 +184,6 @@ void Scrolls::normscroll() { state(0); _vm->_gyro->_seeScroll = false; - _vm->_lucerna->mousepage(_vm->_gyro->_cp); CursorMan.showMouse(false); _vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick(). @@ -258,7 +256,7 @@ void Scrolls::resetscrolldriver() { // phew void Scrolls::dingdongbell() { // Pussy's in the well. Who put her in? Little... for (byte fv = 0; fv < _vm->_gyro->_scrollBells; fv++) - _vm->_lucerna->errorled(); // ring the bell "x" times + _vm->_lucerna->errorLed(); // ring the bell "x" times } void Scrolls::dodgem() { @@ -666,7 +664,7 @@ void Scrolls::calldrivers() { break; if (call_spriterun) - _vm->_lucerna->sprite_run(); + _vm->_lucerna->spriteRun(); call_spriterun = false; drawscroll(&Avalanche::Scrolls::normscroll); @@ -685,14 +683,14 @@ void Scrolls::calldrivers() { break; if (call_spriterun) - _vm->_lucerna->sprite_run(); + _vm->_lucerna->spriteRun(); call_spriterun = false; if (param == 0) natural(); else if ((1 <= param) && (param <= 9)) { if ((param > _vm->_trip->kSpriteNumbMax) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid. - _vm->_lucerna->errorled(); + _vm->_lucerna->errorLed(); natural(); } else _vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine. @@ -706,7 +704,7 @@ void Scrolls::calldrivers() { _vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor; _vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors. } else { - _vm->_lucerna->errorled(); // Not valid. + _vm->_lucerna->errorLed(); // Not valid. natural(); } @@ -747,7 +745,7 @@ void Scrolls::calldrivers() { _vm->_visa->dixi('q', 37); // You find the sixpence. _vm->_gyro->_dna._money += 6; _vm->_gyro->_dna._boxContent = _vm->_acci->kNothing; - _vm->_lucerna->points(2); + _vm->_lucerna->incScore(2); return; } break; @@ -777,7 +775,7 @@ void Scrolls::calldrivers() { break; case kControlQuestion: { if (call_spriterun) - _vm->_lucerna->sprite_run(); + _vm->_lucerna->spriteRun(); call_spriterun = false; _vm->_gyro->_scrollNum++; @@ -850,7 +848,7 @@ void Scrolls::musical_scroll() { + kControlInsertSpaces + "Q W E R T Y U I O P [ ]" + kControlNewLine + kControlNewLine + "Or press Enter to stop playing." + kControlToBuffer); - _vm->_lucerna->sprite_run(); + _vm->_lucerna->spriteRun(); drawscroll(&Avalanche::Scrolls::music_scroll); diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index 085df26923..2383d02fac 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -239,13 +239,13 @@ void Timeout::avaricius_talks() { if (_vm->_gyro->_dna._avariciusTalk < 17) set_up_timer(177, procavaricius_talks, reason_avariciustalks); else - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); } void Timeout::urinate() { _vm->_trip->tr[0].turn(_vm->_trip->kDirUp); _vm->_trip->stopwalking(); - _vm->_lucerna->showrw(); + _vm->_lucerna->drawDirection(); set_up_timer(14, proctoilet2, reason_gototoilet); } @@ -349,7 +349,7 @@ void Timeout::after_the_shootemup() { _vm->_trip->apped(1, 2); _vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); // Same as the added line above: TODO: Remove it later!!! _vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.") @@ -399,7 +399,7 @@ void Timeout::jacques_wakes_up() { if (_vm->_gyro->_dna._jacquesState == 5) { _vm->_gyro->_dna._bellsAreRinging = true; _vm->_gyro->_dna._aylesIsAwake = true; - _vm->_lucerna->points(2); + _vm->_lucerna->incScore(2); } switch (_vm->_gyro->_dna._jacquesState) { @@ -480,9 +480,9 @@ void Timeout::jump() { _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_gyro->_dna._arrowInTheDoor = false; // You've got it. _vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_visa->dixi('q', 50); - _vm->_lucerna->points(3); + _vm->_lucerna->incScore(3); } } } @@ -513,14 +513,14 @@ void Timeout::buywine() { if (_vm->_gyro->decreaseMoney(3)) { _vm->_visa->dixi('D', 4); // You paid up. _vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); _vm->_gyro->_dna._wineState = 1; // OK Wine. } } void Timeout::callsguards() { _vm->_visa->dixi('Q', 58); // "GUARDS!!!" - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); } void Timeout::greetsmonk() { @@ -539,7 +539,7 @@ void Timeout::meet_avaroid() { if (_vm->_gyro->_dna._metAvaroid) { _vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that" + _vm->_scrolls->kControlRoman + " lucky twice in a row!"); - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); } else { _vm->_visa->dixi('Q', 60); _vm->_gyro->_dna._metAvaroid = true; @@ -663,7 +663,7 @@ void Timeout::spludwick_leaves_cauldron() { void Timeout::give_lute_to_geida() { // Moved here from Acci. _vm->_visa->dixi('Q', 86); - _vm->_lucerna->points(4); + _vm->_lucerna->incScore(4); _vm->_gyro->_dna._lustieIsAsleep = true; _vm->_sequence->first_show(5); _vm->_sequence->then_show(6); // He falls asleep... diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index c74efb5f92..b94697f385 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -263,7 +263,7 @@ void triptype::bounce() { else stopwalk(); _tr->_vm->_gyro->_onCanDoPageSwap = false; - _tr->_vm->_lucerna->showrw(); + _tr->_vm->_lucerna->drawDirection(); _tr->_vm->_gyro->_onCanDoPageSwap = true; } @@ -565,7 +565,7 @@ void Trip::catamove(byte ped) { } if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom) - _vm->_lucerna->load(29); + _vm->_lucerna->loadRoom(29); here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1]; switch (here & 0xf) { // West. @@ -928,7 +928,7 @@ void Trip::call_special(uint16 which) { tr[1].turn(kDirDown); tr[1].stopwalk(); tr[1].call_eachstep = false; // Geida - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); } break; case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood... @@ -955,7 +955,6 @@ void Trip::call_special(uint16 which) { catamove(4); if (_vm->_gyro->_dna._room != r__catacombs) return; - _vm->_lucerna->delavvy(); switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) { case 0x1: apped(1, 12); @@ -975,7 +974,6 @@ void Trip::call_special(uint16 which) { catamove(1); if (_vm->_gyro->_dna._room != r__catacombs) return; - _vm->_lucerna->delavvy(); apped(1, 1); getback(); dawndelay(); @@ -986,7 +984,6 @@ void Trip::call_special(uint16 which) { catamove(2); if (_vm->_gyro->_dna._room != r__catacombs) return; - _vm->_lucerna->delavvy(); apped(1, 2); getback(); dawndelay(); @@ -997,7 +994,6 @@ void Trip::call_special(uint16 which) { catamove(3); if (_vm->_gyro->_dna._room != r__catacombs) return; - _vm->_lucerna->delavvy(); apped(1, 3); getback(); dawndelay(); @@ -1224,7 +1220,7 @@ void Trip::arrow_procs(byte tripnum) { end; on; #endif - _vm->_lucerna->gameover(); + _vm->_lucerna->gameOver(); _vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him. _vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke); @@ -1499,7 +1495,7 @@ void Trip::fliproom(byte room, byte ped) { return; } - _vm->_lucerna->exitroom(_vm->_gyro->_dna._room); + _vm->_lucerna->exitRoom(_vm->_gyro->_dna._room); _vm->_lucerna->dusk(); getsetclear(); @@ -1512,12 +1508,12 @@ void Trip::fliproom(byte room, byte ped) { if (_vm->_gyro->_dna._room == r__lustiesroom) _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; - _vm->_lucerna->enterroom(room, ped); + _vm->_lucerna->enterRoom(room, ped); apped(1, ped); _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false; _vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; _vm->_gyro->_dna._direction = tr[0].face; - _vm->_lucerna->showrw(); + _vm->_lucerna->drawDirection(); for (fv = 0; fv <= 1; fv++) { _vm->_gyro->_cp = 1 - _vm->_gyro->_cp; diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 2f438ba5f9..bcdf7b73ac 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -175,8 +175,8 @@ void Visa::talkto(byte whom) { if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) { dixi('q', 68); _vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true; - _vm->_lucerna->objectlist(); - _vm->_lucerna->points(3); + _vm->_lucerna->refreshObjectList(); + _vm->_lucerna->incScore(3); return; } else { if (_vm->_gyro->_dna._talkedToCrapulus) @@ -277,7 +277,7 @@ void Visa::talkto(byte whom) { if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only _vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = true; - _vm->_lucerna->objectlist(); + _vm->_lucerna->refreshObjectList(); dixi('q', 1); // Circular from Cardiff. _vm->_gyro->_dna._talkedToCrapulus = true; @@ -286,7 +286,7 @@ void Visa::talkto(byte whom) { _vm->_trip->tr[1].vanishifstill = true; _vm->_trip->tr[1].walkto(3); // Walks away. - _vm->_lucerna->points(2); + _vm->_lucerna->incScore(2); } } |