diff options
author | uruk | 2013-08-23 16:58:22 +0200 |
---|---|---|
committer | uruk | 2013-08-23 16:58:22 +0200 |
commit | c19b50b3f4228cea0d672982bf3a7bc94e9050b2 (patch) | |
tree | 16531960c1594421ea9d67860bbc16aab024c631 /engines | |
parent | 38c51209a406ac3ed8c5c0fbfd250ca3c01e4c10 (diff) | |
download | scummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.tar.gz scummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.tar.bz2 scummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.zip |
AVALANCHE: Upgrade Trip::infield(), update the rest of the code accordingly. Repair Trip::neardoor(). Introduce Parser::handleFunctionKey(), partially implement it. Implement Gyro::f5_does(). Implement missing part of Lucerna::enterroom().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/acci2.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 28 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 30 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.cpp | 18 | ||||
-rw-r--r-- | engines/avalanche/parser.cpp | 14 | ||||
-rw-r--r-- | engines/avalanche/parser.h | 2 | ||||
-rw-r--r-- | engines/avalanche/trip6.cpp | 25 | ||||
-rw-r--r-- | engines/avalanche/trip6.h | 4 |
8 files changed, 90 insertions, 35 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index a8fb0a6a85..77f7b44f5e 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -771,7 +771,7 @@ void Acci::lookaround() { void Acci::opendoor() { /* so whaddya THINK this does?! */ switch (_vm->_gyro->dna.room) { /* Special cases. */ case r__yours: - if (_vm->_trip->infield(1)) { + if (_vm->_trip->infield(2)) { /* Opening the box. */ thing = 54; /* The box. */ person = pardon; examine(); @@ -791,7 +791,7 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */ return; /* No doors can open if you can't move Avvy. */ for (byte fv = 8; fv < 15; fv++) - if (_vm->_trip->infield(fv)) { + if (_vm->_trip->infield(fv + 1)) { fv -= 8; switch (_vm->_gyro->portals[fv].op) { diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 6968932cfb..95f564e011 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -67,8 +67,11 @@ void Avalot::handleKeyDown(Common::Event &event) { // click(); // // To be implemented later with the sounds, I assume. + - if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47)) + if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15)) + _vm->_parser->handleFunctionKey(event); + else if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47)) _vm->_parser->handleInputText(event); else switch (event.kbd.keycode) { // We can control Avvy with the numpad as well. @@ -211,13 +214,13 @@ void Avalot::setup() { void Avalot::run(Common::String arg) { setup(); - - do { uint32 beginLoop = _vm->_system->getMillis(); _vm->updateEvents(); // The event handler. + + _vm->_lucerna->clock_lucerna(); _vm->_dropdown->menu_link(); _vm->_trip->readstick(); @@ -226,24 +229,27 @@ void Avalot::run(Common::String arg) { _vm->_celer->pics_link(); _vm->_trip->trippancy_link(); _vm->_lucerna->checkclick(); - _vm->_timeout->one_tick(); - // Not in the original: + // ONLY FOR TESTING!!! + 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->numfields; i++) { + if (_vm->_gyro->fields[i].x1 < 640) + _vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta); + } + // ONYL FOR TESTING!!! + + _vm->_graphics->refreshScreen(); // TODO: Maybe it'll have a better place later. Move it there when it's needed. 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->lmo); //restorecrtmode(); diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index a7305c9aa3..4ae61c2bf5 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -498,8 +498,34 @@ Common::String Gyro::get_better(byte which) { Common::String Gyro::f5_does() { - warning("STUB: Gyro::f5_does()"); - return "STUB: Gyro::f5_does()"; + Common::String f5_does_result; + switch (dna.room) { + case r__yours: { + if (!dna.avvy_is_awake) + return Common::String(_vm->_acci->vb_wake) + "WWake up"; + else if (dna.avvy_in_bed) + return Common::String(_vm->_acci->vb_stand) + "GGet up"; + } + break; + case r__insidecardiffcastle: + if (dna.standing_on_dais) + return Common::String(_vm->_acci->vb_climb) + "CClimb down"; + else + return Common::String(_vm->_acci->vb_climb) + "CClimb up"; + break; + case r__nottspub: + if (dna.sitting_in_pub) + return Common::String(_vm->_acci->vb_stand) + "SStand up"; + else + return Common::String(_vm->_acci->vb_sit) + "SSit down"; + break; + case r__musicroom: + if (_vm->_trip->infield(7)) + return Common::String(_vm->_acci->vb_play) + "PPlay the harp"; + break; + } + + return Common::String(_vm->_acci->pardon); /* If all else fails... */ } void Gyro::load_a_mouse(byte which) { diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 277069d30e..48b17c43cc 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -549,7 +549,23 @@ void Lucerna::enterroom(byte x, byte ped) { break; case r__map: { - warning("STUB: Lucerna::enterroom() - case: r__map"); + /* You're entering the map. */ + dawn(); + //setactivepage(cp); + if (ped > 0) + zoomout(_vm->_gyro->peds[ped - 1].x, _vm->_gyro->peds[ped - 1].y); + //setactivepage(1 - cp); + + { + dnatype &with = _vm->_gyro->dna; + if ((_vm->_gyro->dna.obj[_vm->_gyro->wine]) && (_vm->_gyro->dna.winestate != 3)) { + _vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */ + _vm->_gyro->dna.obj[_vm->_gyro->wine] = false; + objectlist(); + } + } + + _vm->_visa->dixi('q', 69); } break; diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index c996a304eb..d52ab868c3 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -85,6 +85,20 @@ void Parser::handleReturn() { } } +void Parser::handleFunctionKey(const Common::Event &event) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F5: { + _vm->_acci->person = _vm->_acci->pardon; + _vm->_acci->thing = _vm->_acci->pardon; + _vm->_lucerna->callverb(_vm->_gyro->f5_does()[0]); + } + break; + case Common::KEYCODE_F7: + _vm->_lucerna->callverb(_vm->_acci->vb_open); + break; + } +} + void Parser::plotText() { if (_vm->_gyro->mouse_near_text()) CursorMan.showMouse(false); diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index cac8aa22b7..da2b761417 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -52,6 +52,8 @@ public: void handleReturn(); + void handleFunctionKey(const Common::Event &event); + void plotText(); void cursorOn(); diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index d55567c64c..7dbda47eea 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -1641,7 +1641,8 @@ void Trip::fliproom(byte room, byte ped) { } bool Trip::infield(byte which) { -/* returns True if you're within field "which" */ + which--; // Pascal -> C: different array indexes. + int16 yy = tr[0].y + tr[0]._info.yl; return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2) @@ -1649,29 +1650,19 @@ bool Trip::infield(byte which) { } -bool Trip::neardoor() { /* returns True if you're near a door! */ - int16 ux, uy; - byte fv; - bool nd; - - bool neardoor_result; +bool Trip::neardoor() { if (_vm->_gyro->numfields < 9) { /* there ARE no doors here! */ - neardoor_result = false; - return neardoor_result; + return false; } - ux = tr[1].x; - uy = tr[1].y + tr[1]._info.yl; - - nd = false; - for (fv = 9; fv <= _vm->_gyro->numfields; fv++) { - _vm->_gyro->fields[fv]; - + int16 ux = tr[0].x; + int16 uy = tr[0].y + tr[0]._info.yl; + bool nd = false; + for (byte fv = 9; fv <= _vm->_gyro->numfields; 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)) nd = true; - } return nd; } diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h index 7c86b40121..cc13c9bf75 100644 --- a/engines/avalanche/trip6.h +++ b/engines/avalanche/trip6.h @@ -206,9 +206,9 @@ public: void fliproom(byte room, byte ped); - bool infield(byte which); /* returns True if you're within field "which" */ + bool infield(byte which); // Returns true if you're within field "which". - bool neardoor(); /* returns True if you're near a door! */ + bool neardoor(); // Returns True if you're near a door. void readstick(); |