diff options
author | uruk | 2013-07-24 18:25:07 +0200 |
---|---|---|
committer | uruk | 2013-07-24 18:25:07 +0200 |
commit | 10ec7e0e0f2d4cc246db0c3792c5af05e413976b (patch) | |
tree | 13516a3765905781cd17a1bb5c4c747436b9370a /engines/avalanche | |
parent | f035622b14966e3af0a1fe53b63619ee29591e3a (diff) | |
download | scummvm-rg350-10ec7e0e0f2d4cc246db0c3792c5af05e413976b.tar.gz scummvm-rg350-10ec7e0e0f2d4cc246db0c3792c5af05e413976b.tar.bz2 scummvm-rg350-10ec7e0e0f2d4cc246db0c3792c5af05e413976b.zip |
AVALANCHE: Change _gyro into pointer, update everything accordingly.
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/acci2.cpp | 454 | ||||
-rw-r--r-- | engines/avalanche/avalanche.cpp | 3 | ||||
-rw-r--r-- | engines/avalanche/avalanche.h | 2 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 86 | ||||
-rw-r--r-- | engines/avalanche/basher2.cpp | 16 | ||||
-rw-r--r-- | engines/avalanche/celer2.cpp | 88 | ||||
-rw-r--r-- | engines/avalanche/dropdown2.cpp | 148 | ||||
-rw-r--r-- | engines/avalanche/enid2.cpp | 34 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 10 | ||||
-rw-r--r-- | engines/avalanche/gyro2.h | 4 | ||||
-rw-r--r-- | engines/avalanche/logger2.cpp | 42 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.cpp | 390 | ||||
-rw-r--r-- | engines/avalanche/pingo2.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.cpp | 76 | ||||
-rw-r--r-- | engines/avalanche/sequence2.cpp | 10 | ||||
-rw-r--r-- | engines/avalanche/timeout2.cpp | 128 | ||||
-rw-r--r-- | engines/avalanche/trip6.cpp | 536 | ||||
-rw-r--r-- | engines/avalanche/visa2.cpp | 18 |
18 files changed, 1022 insertions, 1025 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index d16c8c6746..5e2fb23f1d 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -158,7 +158,7 @@ const Acci::vocab Acci::words[nowords] = { {178, "WITCH"}, /* Pronouns, 200-224 */ - {200, "_vm->_gyro.him"}, {200, "MAN"}, {200, "GUY"}, + {200, "_vm->_gyro->him"}, {200, "MAN"}, {200, "GUY"}, {200, "DUDE"}, {200, "CHAP"}, {200, "FELLOW"}, {201, "HER"}, {201, "GIRL"}, {201, "WOMAN"}, {202, "IT"}, {202, "THING"}, @@ -221,7 +221,7 @@ void Acci::setParent(AvalancheEngine *vm) { } void Acci::init() { - _vm->_gyro.weirdword = false; + _vm->_gyro->weirdword = false; } void Acci::checkword(Common::String &x) { /* Checks uint16 "fv". */ @@ -257,7 +257,7 @@ begin off; assign(f,'avvydump.avd'); rewrite(f,1); - blockwrite(f,_vm->_gyro.dna,177); { just anything } + blockwrite(f,_vm->_gyro->dna,177); { just anything } for bit:=0 to 3 do begin port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit; @@ -272,7 +272,7 @@ Common::String Acci::rank() { Common::String rank_result = ""; for (fv = 1; fv <= 8; fv++) { - if ((_vm->_gyro.dna.score >= ranks[fv].score) && (_vm->_gyro.dna.score < ranks[fv + 1].score)) { + if ((_vm->_gyro->dna.score >= ranks[fv].score) && (_vm->_gyro->dna.score < ranks[fv + 1].score)) { rank_result = ranks[fv].title; return rank_result; } @@ -430,30 +430,30 @@ void Acci::others() { void Acci::lookaround() { /* This is called when you say "look." */ - _vm->_scrolls.display(*_vm->_gyro.also[0][1]); - switch (_vm->_gyro.dna.room) { + _vm->_scrolls.display(*_vm->_gyro->also[0][1]); + switch (_vm->_gyro->dna.room) { case r__spludwicks: - if (_vm->_gyro.dna.avaricius_talk > 0) + if (_vm->_gyro->dna.avaricius_talk > 0) _vm->_visa.dixi('q', 23); else others(); break; case r__robins: - if (_vm->_gyro.dna.tied_up) + if (_vm->_gyro->dna.tied_up) _vm->_visa.dixi('q', 38); - if (_vm->_gyro.dna.mushroom_growing) + if (_vm->_gyro->dna.mushroom_growing) _vm->_visa.dixi('q', 55); break; case r__insidecardiffcastle: - if (!_vm->_gyro.dna.taken_pen) + if (!_vm->_gyro->dna.taken_pen) _vm->_visa.dixi('q', 49); break; case r__lustiesroom: - if (_vm->_gyro.dna.lustie_is_asleep) + if (_vm->_gyro->dna.lustie_is_asleep) _vm->_visa.dixi('q', 65); break; case r__catacombs: - switch (_vm->_gyro.dna.cat_y * 256 + _vm->_gyro.dna.cat_x) { + switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) { case 258 : _vm->_visa.dixi('q', 80); break; /* Inside art gallery */ @@ -473,7 +473,7 @@ void Acci::lookaround() { void Acci::opendoor() { /* so whaddya THINK this does?! */ byte fv; - switch (_vm->_gyro.dna.room) { /* Special cases. */ + switch (_vm->_gyro->dna.room) { /* Special cases. */ case r__yours: if (_vm->_trip.infield(2)) { /* Opening the box. */ @@ -491,30 +491,30 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */ } - if ((!_vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties)) + if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties)) return; /* No doors can open if you can't move Avvy. */ for (fv = 9; fv <= 15; fv++) { if (_vm->_trip.infield(fv)) { { - _vm->_gyro.portals[fv]; - switch (_vm->_gyro.portals[fv].op) { - case _vm->_gyro.exclaim: + _vm->_gyro->portals[fv]; + switch (_vm->_gyro->portals[fv].op) { + case _vm->_gyro->exclaim: _vm->_trip.tr[1].bounce(); - _vm->_visa.dixi('x', _vm->_gyro.portals[fv].data); + _vm->_visa.dixi('x', _vm->_gyro->portals[fv].data); break; - case _vm->_gyro.transport: - _vm->_trip.fliproom((_vm->_gyro.portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro.portals[fv].data) & 0x0F /*Low byte*/); + case _vm->_gyro->transport: + _vm->_trip.fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/); break; - case _vm->_gyro.unfinished: + case _vm->_gyro->unfinished: _vm->_trip.tr[1].bounce(); _vm->_scrolls.display("Sorry. This place is not available yet!"); break; - case _vm->_gyro.special: - _vm->_trip.call_special(_vm->_gyro.portals[fv].data); + case _vm->_gyro->special: + _vm->_trip.call_special(_vm->_gyro->portals[fv].data); break; - case _vm->_gyro.mopendoor: - _vm->_trip.open_the_door((_vm->_gyro.portals[fv].data) >> 8, (_vm->_gyro.portals[fv].data) & 0x0F, fv); + case _vm->_gyro->mopendoor: + _vm->_trip.open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv); break; } } @@ -522,7 +522,7 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */ } } - if (_vm->_gyro.dna.room == r__map) + if (_vm->_gyro->dna.room == r__map) _vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going " "to anywhere other than Argent, Birmingham, Cardiff, " "Nottingham and Norwich.")); @@ -552,16 +552,16 @@ void Acci::putproc() { /* Called when you call vb_put. */ putting it. */ /* Convenience thing. */ switch (thing2) { - case _vm->_gyro.wine: - if (thing == _vm->_gyro.onion) { - if (_vm->_gyro.dna.rotten_onion) + case _vm->_gyro->wine: + if (thing == _vm->_gyro->onion) { + if (_vm->_gyro->dna.rotten_onion) _vm->_scrolls.display(Common::String("That's a bit like shutting the stable door after the " "horse has bolted!")); else { /* Put onion into wine? */ - if (_vm->_gyro.dna.winestate != 3) + if (_vm->_gyro->dna.winestate != 3) _vm->_scrolls.display("\6Oignon au vin\22 is a bit too strong for your tastes!"); else { /* Put onion into vinegar! Yes! */ - _vm->_gyro.dna.onion_in_vinegar = true; + _vm->_gyro->dna.onion_in_vinegar = true; _vm->_lucerna.points(7); _vm->_visa.dixi('u', 9); } @@ -571,32 +571,32 @@ void Acci::putproc() { /* Called when you call vb_put. */ break; case 54: - if (_vm->_gyro.dna.room == 1) { /* Put something into the box. */ - if (_vm->_gyro.dna.box_contents != nowt) + if (_vm->_gyro->dna.room == 1) { /* Put something into the box. */ + if (_vm->_gyro->dna.box_contents != nowt) _vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking" " that out first.")); else { switch (thing) { - case _vm->_gyro.money: + case _vm->_gyro->money: _vm->_scrolls.display("You'd better keep some ready cash on you!"); break; - case _vm->_gyro.bell: + case _vm->_gyro->bell: _vm->_scrolls.display("That's a silly place to keep a bell."); break; - case _vm->_gyro.bodkin: + case _vm->_gyro->bodkin: _vm->_scrolls.display("But you might need it!"); break; - case _vm->_gyro.onion: + case _vm->_gyro->onion: _vm->_scrolls.display("Just give it to Spludwick, Avvy!"); break; default: /* Put the object into the box... */ - if (_vm->_gyro.dna.wearing == thing) - _vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro.get_better(thing) + " off first!"); + if (_vm->_gyro->dna.wearing == thing) + _vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!"); else { _vm->_celer.show_one(5); /* Open box. */ - _vm->_gyro.dna.box_contents = thing; - _vm->_gyro.dna.obj[thing] = false; + _vm->_gyro->dna.box_contents = thing; + _vm->_gyro->dna.obj[thing] = false; _vm->_lucerna.objectlist(); _vm->_scrolls.display("OK, it's in the box."); _vm->_celer.show_one(6); /* Shut box. */ @@ -617,7 +617,7 @@ void Acci::putproc() { /* Called when you call vb_put. */ void Acci::not_in_order() { _vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") + " What I need next is " + - _vm->_gyro.get_better(_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick]) + ".\232\2"); + _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ".\232\2"); } void Acci::go_to_cauldron() { @@ -629,39 +629,39 @@ void Acci::go_to_cauldron() { bool Acci::give2spludwick() { bool give2spludwick_result = false; - if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) { + if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != thing) { not_in_order(); return give2spludwick_result; } switch (thing) { - case _vm->_gyro.onion: - _vm->_gyro.dna.obj[_vm->_gyro.onion] = false; - if (_vm->_gyro.dna.rotten_onion) + case _vm->_gyro->onion: + _vm->_gyro->dna.obj[_vm->_gyro->onion] = false; + if (_vm->_gyro->dna.rotten_onion) _vm->_visa.dixi('q', 22); else { - _vm->_gyro.dna.given2spludwick += 1; + _vm->_gyro->dna.given2spludwick += 1; _vm->_visa.dixi('q', 20); go_to_cauldron(); _vm->_lucerna.points(3); } _vm->_lucerna.objectlist(); break; - case _vm->_gyro.ink: - _vm->_gyro.dna.obj[_vm->_gyro.ink] = false; + case _vm->_gyro->ink: + _vm->_gyro->dna.obj[_vm->_gyro->ink] = false; _vm->_lucerna.objectlist(); - _vm->_gyro.dna.given2spludwick += 1; + _vm->_gyro->dna.given2spludwick += 1; _vm->_visa.dixi('q', 24); go_to_cauldron(); _vm->_lucerna.points(3); break; - case _vm->_gyro.mushroom: - _vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false; + case _vm->_gyro->mushroom: + _vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false; _vm->_visa.dixi('q', 25); _vm->_lucerna.points(5); - _vm->_gyro.dna.given2spludwick += 1; + _vm->_gyro->dna.given2spludwick += 1; go_to_cauldron(); - _vm->_gyro.dna.obj[_vm->_gyro.potion] = true; + _vm->_gyro->dna.obj[_vm->_gyro->potion] = true; _vm->_lucerna.objectlist(); break; default: @@ -672,32 +672,32 @@ bool Acci::give2spludwick() { } void Acci::have_a_drink() { - _vm->_gyro.dna.alcohol += 1; - if (_vm->_gyro.dna.alcohol == 5) { - _vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */ - _vm->_gyro.dna.teetotal = true; - _vm->_gyro.dna.avvy_is_awake = false; - _vm->_gyro.dna.avvy_in_bed = true; + _vm->_gyro->dna.alcohol += 1; + if (_vm->_gyro->dna.alcohol == 5) { + _vm->_gyro->dna.obj[_vm->_gyro->key] = true; /* Get the key. */ + _vm->_gyro->dna.teetotal = true; + _vm->_gyro->dna.avvy_is_awake = false; + _vm->_gyro->dna.avvy_in_bed = true; _vm->_lucerna.objectlist(); _vm->_lucerna.dusk(); - _vm->_gyro.hang_around_for_a_while(); + _vm->_gyro->hang_around_for_a_while(); _vm->_trip.fliproom(1, 1); - _vm->_gyro.background(14); + _vm->_gyro->background(14); _vm->_trip.new_game_for_trippancy(); /* Not really */ } } void Acci::cardiff_climbing() { - if (_vm->_gyro.dna.standing_on_dais) { + if (_vm->_gyro->dna.standing_on_dais) { /* Clamber up. */ _vm->_scrolls.display("You climb down, back onto the floor."); - _vm->_gyro.dna.standing_on_dais = false; + _vm->_gyro->dna.standing_on_dais = false; _vm->_trip.apped(1, 3); } else { /* Clamber down. */ if (_vm->_trip.infield(1)) { _vm->_scrolls.display("You clamber up onto the dais."); - _vm->_gyro.dna.standing_on_dais = true; + _vm->_gyro->dna.standing_on_dais = true; _vm->_trip.apped(1, 2); } else _vm->_scrolls.display("Get a bit closer, Avvy."); @@ -711,21 +711,21 @@ void Acci::already() { } void Acci::stand_up() { - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__yours: /* Avvy isn't asleep. */ - if (_vm->_gyro.dna.avvy_in_bed) { /* But he's in bed. */ - if (_vm->_gyro.dna.teetotal) { + if (_vm->_gyro->dna.avvy_in_bed) { /* But he's in bed. */ + if (_vm->_gyro->dna.teetotal) { _vm->_visa.dixi('d', 12); - _vm->_gyro.background(0); + _vm->_gyro->background(0); _vm->_visa.dixi('d', 14); } _vm->_trip.tr[1].visible = true; - _vm->_gyro.dna.user_moves_avvy = true; + _vm->_gyro->dna.user_moves_avvy = true; _vm->_trip.apped(1, 2); - _vm->_gyro.dna.rw = _vm->_gyro.left; + _vm->_gyro->dna.rw = _vm->_gyro->left; _vm->_celer.show_one(4); /* Picture of empty pillow. */ _vm->_lucerna.points(1); - _vm->_gyro.dna.avvy_in_bed = false; + _vm->_gyro->dna.avvy_in_bed = false; _vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts); } else already(); @@ -736,12 +736,12 @@ void Acci::stand_up() { break; case r__nottspub: - if (_vm->_gyro.dna.sitting_in_pub) { + if (_vm->_gyro->dna.sitting_in_pub) { _vm->_celer.show_one(4); /* Not sitting down. */ _vm->_trip.tr[1].visible = true; /* But standing up. */ _vm->_trip.apped(1, 4); /* And walking away. */ - _vm->_gyro.dna.sitting_in_pub = false; /* Really not sitting down. */ - _vm->_gyro.dna.user_moves_avvy = true; /* And ambulant. */ + _vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */ + _vm->_gyro->dna.user_moves_avvy = true; /* And ambulant. */ } else already(); break; @@ -752,44 +752,44 @@ void Acci::stand_up() { void Acci::getproc(char thing) { - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__yours: if (_vm->_trip.infield(2)) { - if (_vm->_gyro.dna.box_contents == thing) { + if (_vm->_gyro->dna.box_contents == thing) { _vm->_celer.show_one(5); _vm->_scrolls.display("OK, I've got it."); - _vm->_gyro.dna.obj[thing] = true; + _vm->_gyro->dna.obj[thing] = true; _vm->_lucerna.objectlist(); - _vm->_gyro.dna.box_contents = nowt; + _vm->_gyro->dna.box_contents = nowt; _vm->_celer.show_one(6); } else - _vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro.get_better(thing) + " in the box."); + _vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box."); } else _vm->_visa.dixi('q', 57); break; case r__insidecardiffcastle: switch (thing) { - case _vm->_gyro.pen: + case _vm->_gyro->pen: if (_vm->_trip.infield(2)) { /* Standing on the dais. */ - if (_vm->_gyro.dna.taken_pen) + if (_vm->_gyro->dna.taken_pen) _vm->_scrolls.display("It's not there, Avvy."); else { /* OK: we're taking the pen, and it's there. */ _vm->_celer.show_one(4); /* No pen there now. */ _vm->_trip.call_special(3); /* Zap! */ - _vm->_gyro.dna.taken_pen = true; - _vm->_gyro.dna.obj[_vm->_gyro.pen] = true; + _vm->_gyro->dna.taken_pen = true; + _vm->_gyro->dna.obj[_vm->_gyro->pen] = true; _vm->_lucerna.objectlist(); _vm->_scrolls.display("Taken."); } - } else if (_vm->_gyro.dna.standing_on_dais) + } else if (_vm->_gyro->dna.standing_on_dais) _vm->_visa.dixi('q', 53); else _vm->_visa.dixi('q', 51); break; - case _vm->_gyro.bolt: + case _vm->_gyro->bolt: _vm->_visa.dixi('q', 52); break; default: @@ -797,12 +797,12 @@ void Acci::getproc(char thing) { } break; case r__robins: - if ((thing == _vm->_gyro.mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro.dna.mushroom_growing)) { + if ((thing == _vm->_gyro->mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro->dna.mushroom_growing)) { _vm->_celer.show_one(3); _vm->_scrolls.display("Got it!"); - _vm->_gyro.dna.mushroom_growing = false; - _vm->_gyro.dna.taken_mushroom = true; - _vm->_gyro.dna.obj[_vm->_gyro.mushroom] = true; + _vm->_gyro->dna.mushroom_growing = false; + _vm->_gyro->dna.taken_mushroom = true; + _vm->_gyro->dna.obj[_vm->_gyro->mushroom] = true; _vm->_lucerna.objectlist(); _vm->_lucerna.points(3); } else @@ -814,11 +814,11 @@ void Acci::getproc(char thing) { } void Acci::give_geida_the_lute() { - if (_vm->_gyro.dna.room != r__lustiesroom) { + if (_vm->_gyro->dna.room != r__lustiesroom) { _vm->_scrolls.display("Not yet. Try later!\232\2"); return; } - _vm->_gyro.dna.obj[_vm->_gyro.lute] = false; + _vm->_gyro->dna.obj[_vm->_gyro->lute] = false; _vm->_lucerna.objectlist(); _vm->_visa.dixi('q', 64); /* She plays it. */ @@ -851,14 +851,14 @@ void Acci::person_speaks() { if ((person == pardon) || (person == '\0')) { - if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room)) - person = _vm->_gyro.her; + if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him] != _vm->_gyro->dna.room)) + person = _vm->_gyro->her; else - person = _vm->_gyro.him; + person = _vm->_gyro->him; } - if (_vm->_gyro.whereis[person] != _vm->_gyro.dna.room) { - _vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro.himself! */ + if (_vm->_gyro->whereis[person] != _vm->_gyro->dna.room) { + _vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro->himself! */ return; } @@ -873,8 +873,8 @@ void Acci::person_speaks() { if (!found) { for (fv = 10; fv <= 25; fv++) { - _vm->_gyro.quasipeds[fv]; - if ((_vm->_gyro.quasipeds[fv].who == person) && (_vm->_gyro.quasipeds[fv].room == _vm->_gyro.dna.room)) { + _vm->_gyro->quasipeds[fv]; + if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room)) { _vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4'); } } @@ -884,7 +884,7 @@ void Acci::person_speaks() { void Acci::heythanks() { person_speaks(); _vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)"); - _vm->_gyro.dna.obj[thing] = false; + _vm->_gyro->dna.obj[thing] = false; } void Acci::do_that() { @@ -898,13 +898,13 @@ void Acci::do_that() { thats = ""; return; } - if (_vm->_gyro.weirdword) + if (_vm->_gyro->weirdword) return; if (thing < '\310') thing -= 49; /* "Slip" */ /* - if ((!_vm->_gyro.alive) & + if ((!_vm->_gyro->alive) & !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass, vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score, vb_highscores, vb_smartalec, eos).has(verb))) { @@ -913,7 +913,7 @@ void Acci::do_that() { return; } - if ((~ _vm->_gyro.dna.avvy_is_awake) & + if ((~ _vm->_gyro->dna.avvy_is_awake) & !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass, vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score, vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) { @@ -937,7 +937,7 @@ void Acci::do_that() { case vb_get: if (thing != pardon) { /* Legitimate try to pick something up. */ - if (_vm->_gyro.dna.carrying >= maxobjs) + if (_vm->_gyro->dna.carrying >= maxobjs) _vm->_scrolls.display("You can't carry any more!"); else getproc(thing); @@ -954,13 +954,13 @@ void Acci::do_that() { _vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") + "later it was gone! So now you never leave ANYTHING lying around. OK?"); break; - /* begin _vm->_gyro.dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/ + /* begin _vm->_gyro->dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/ case vb_inv: inv(); break; case vb_talk: if (person == pardon) { - if (_vm->_gyro.subjnumber == 99) /* They typed "say passuint16". */ + if (_vm->_gyro->subjnumber == 99) /* They typed "say passuint16". */ _vm->_scrolls.display("Yes, but what \6is\22 the passuint16?"); /* else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) { @@ -970,7 +970,7 @@ void Acci::do_that() { do_that(); return; } else { - person = _vm->_gyro.subjnumber; + person = _vm->_gyro->subjnumber; subjnumber = 0; if (set::of(pardon, '\0', eos).has(person)) _vm->_scrolls.display("Talk to whom?"); @@ -990,56 +990,56 @@ void Acci::do_that() { _vm->_scrolls.display("Give to whom?"); else if (personshere()) { switch (thing) { - case _vm->_gyro.money : + case _vm->_gyro->money : _vm->_scrolls.display("You can't bring yourself to give away your moneybag."); break; - case _vm->_gyro.bodkin: - case _vm->_gyro.bell: - case _vm->_gyro.clothes: - case _vm->_gyro.habit : + case _vm->_gyro->bodkin: + case _vm->_gyro->bell: + case _vm->_gyro->clothes: + case _vm->_gyro->habit : _vm->_scrolls.display("Don't give it away, it might be useful!"); break; default: switch (person) { - case _vm->_gyro.pcrapulus: + case _vm->_gyro->pcrapulus: switch (thing) { - case _vm->_gyro.wine: + case _vm->_gyro->wine: _vm->_scrolls.display("Crapulus grabs the wine and gulps it down."); - _vm->_gyro.dna.obj[_vm->_gyro.wine] = false; + _vm->_gyro->dna.obj[_vm->_gyro->wine] = false; break; default: heythanks(); } break; - case _vm->_gyro.pcwytalot: + case _vm->_gyro->pcwytalot: /*if (set::of(crossbow, bolt, eos).has(thing)) _vm->_scrolls.display(Common::String("You might be able to influence ") + "Cwytalot more if you used it!"); else */heythanks(); break; - case _vm->_gyro.pspludwick: + case _vm->_gyro->pspludwick: if (give2spludwick()) heythanks(); break; - case _vm->_gyro.pibythneth: - if (thing == _vm->_gyro.badge) { + case _vm->_gyro->pibythneth: + if (thing == _vm->_gyro->badge) { _vm->_visa.dixi('q', 32); /* Thanks! Wow! */ _vm->_lucerna.points(3); - _vm->_gyro.dna.obj[_vm->_gyro.badge] = false; - _vm->_gyro.dna.obj[_vm->_gyro.habit] = true; - _vm->_gyro.dna.givenbadgetoiby = true; + _vm->_gyro->dna.obj[_vm->_gyro->badge] = false; + _vm->_gyro->dna.obj[_vm->_gyro->habit] = true; + _vm->_gyro->dna.givenbadgetoiby = true; _vm->_celer.show_one(8); _vm->_celer.show_one(9); } else heythanks(); break; - case _vm->_gyro.payles: - if (_vm->_gyro.dna.ayles_is_awake) { - if (thing == _vm->_gyro.pen) { - _vm->_gyro.dna.obj[_vm->_gyro.pen] = false; + case _vm->_gyro->payles: + if (_vm->_gyro->dna.ayles_is_awake) { + if (thing == _vm->_gyro->pen) { + _vm->_gyro->dna.obj[_vm->_gyro->pen] = false; _vm->_visa.dixi('q', 54); - _vm->_gyro.dna.obj[_vm->_gyro.ink] = true; - _vm->_gyro.dna.given_pen_to_ayles = true; + _vm->_gyro->dna.obj[_vm->_gyro->ink] = true; + _vm->_gyro->dna.given_pen_to_ayles = true; _vm->_lucerna.objectlist(); _vm->_lucerna.points(2); } else @@ -1047,26 +1047,26 @@ void Acci::do_that() { } else _vm->_scrolls.display("But he's asleep!"); break; - case _vm->_gyro.pgeida: + case _vm->_gyro->pgeida: switch (thing) { - case _vm->_gyro.potion: - _vm->_gyro.dna.obj[_vm->_gyro.potion] = false; + case _vm->_gyro->potion: + _vm->_gyro->dna.obj[_vm->_gyro->potion] = false; _vm->_visa.dixi('u', 16); /* She drinks it. */ _vm->_lucerna.points(2); - _vm->_gyro.dna.geida_given_potion = true; + _vm->_gyro->dna.geida_given_potion = true; _vm->_lucerna.objectlist(); break; - case _vm->_gyro.lute: + case _vm->_gyro->lute: give_geida_the_lute(); break; default: heythanks(); } break; - case _vm->_gyro.parkata: + case _vm->_gyro->parkata: switch (thing) { - case _vm->_gyro.potion: - if (_vm->_gyro.dna.geida_given_potion) + case _vm->_gyro->potion: + if (_vm->_gyro->dna.geida_given_potion) winsequence(); else _vm->_visa.dixi('q', 77); @@ -1093,7 +1093,7 @@ void Acci::do_that() { _vm->_enid.edna_load(realwords[2]); break; case vb_save: - if (_vm->_gyro.alive) + if (_vm->_gyro->alive) _vm->_enid.edna_save(realwords[2]); else _vm->_scrolls.display("It's a bit late now to save your game!"); @@ -1108,7 +1108,7 @@ void Acci::do_that() { _vm->_scrolls.display("Vandalism is prohibited within this game!"); break; case vb_quit: /* quit */ - //if (_vm->_gyro.demo) { + //if (_vm->_gyro->demo) { // _vm->_visa.dixi('q', 31); // close(demofile); // exit(0); /* Change this later!!! */ @@ -1116,7 +1116,7 @@ void Acci::do_that() { if (!polite) _vm->_scrolls.display("How about a `please\", Avvy?"); else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?")) - _vm->_gyro.lmo = true; + _vm->_gyro->lmo = true; break; case vb_go: _vm->_scrolls.display("Just use the arrow keys to walk there."); @@ -1132,16 +1132,16 @@ void Acci::do_that() { _vm->_scrolls.display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" + "The medi‘val descendant of" + '\15' + "Denarius Avaricius Sextus" + - '\15' + '\15' + "version " + _vm->_gyro.vernum + '\15' + '\15' + "Copyright ï " - + _vm->_gyro.copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26'); + '\15' + '\15' + "version " + _vm->_gyro->vernum + '\15' + '\15' + "Copyright ï " + + _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26'); _vm->_scrolls.aboutscroll = false; break; case vb_undress: - if (_vm->_gyro.dna.wearing == nowt) + if (_vm->_gyro->dna.wearing == nowt) _vm->_scrolls.display("You're already stark naked!"); - else if (_vm->_gyro.dna.avvys_in_the_cupboard) { - _vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro.get_better(_vm->_gyro.dna.wearing) + '.'); - _vm->_gyro.dna.wearing = nowt; + else if (_vm->_gyro->dna.avvys_in_the_cupboard) { + _vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.'); + _vm->_gyro->dna.wearing = nowt; _vm->_lucerna.objectlist(); } else _vm->_scrolls.display("Hadn't you better find somewhere more private, Avvy?"); @@ -1150,23 +1150,23 @@ void Acci::do_that() { if (holding()) { /* wear something */ switch (thing) { - case _vm->_gyro.chastity: + case _vm->_gyro->chastity: _vm->_scrolls.display("Hey, what kind of a weirdo are you\??!"); break; - case _vm->_gyro.clothes: - case _vm->_gyro.habit: /* Change this! */ - if (_vm->_gyro.dna.wearing != nowt) { - if (_vm->_gyro.dna.wearing == thing) + case _vm->_gyro->clothes: + case _vm->_gyro->habit: /* Change this! */ + if (_vm->_gyro->dna.wearing != nowt) { + if (_vm->_gyro->dna.wearing == thing) _vm->_scrolls.display("You're already wearing that."); else _vm->_scrolls.display(Common::String("You'll be rather warm wearing two ") + "sets of clothes!"); return; } else - _vm->_gyro.dna.wearing = thing; + _vm->_gyro->dna.wearing = thing; _vm->_lucerna.objectlist(); - if (thing == _vm->_gyro.habit) + if (thing == _vm->_gyro->habit) fv = 3; else fv = 0; @@ -1187,7 +1187,7 @@ void Acci::do_that() { break; case vb_play: if (thing == pardon) { - switch (_vm->_gyro.dna.room) { /* They just typed "play"... */ + switch (_vm->_gyro->dna.room) { /* They just typed "play"... */ case r__argentpub: // play_nim(); // I just don't plan to implement Nim yet. @@ -1198,22 +1198,22 @@ void Acci::do_that() { } } else if (holding()) { switch (thing) { - case _vm->_gyro.lute : + case _vm->_gyro->lute : _vm->_visa.dixi('U', 7); - if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room) + if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot] == _vm->_gyro->dna.room) _vm->_visa.dixi('U', 10); - if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room) + if (_vm->_gyro->whereis[_vm->_gyro->pdulustie] == _vm->_gyro->dna.room) _vm->_visa.dixi('U', 15); break; case 52: - if (_vm->_gyro.dna.room == r__musicroom) + if (_vm->_gyro->dna.room == r__musicroom) play_harp(); else _vm->_scrolls.display(what); break; case 55: - if (_vm->_gyro.dna.room == r__argentpub) + if (_vm->_gyro->dna.room == r__argentpub) ; /*play_nim(); - Don't implement yet.*/ else _vm->_scrolls.display(what); @@ -1225,9 +1225,9 @@ void Acci::do_that() { break; case vb_ring: if (holding()) { - if (thing == _vm->_gyro.bell) { + if (thing == _vm->_gyro->bell) { _vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong..."); - if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B'))) + if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B'))) _vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)"); } else _vm->_scrolls.display(what); @@ -1248,7 +1248,7 @@ void Acci::do_that() { // I don't want to implement bosskey yet. break; case vb_pee: - if (_vm->_gyro.flagset('P')) { + if (_vm->_gyro->flagset('P')) { _vm->_scrolls.display("Hmm, I don't think anyone will notice..."); _vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet); } else @@ -1256,16 +1256,16 @@ void Acci::do_that() { break; case vb_cheat: _vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled."); - _vm->_gyro.cheat = true; + _vm->_gyro->cheat = true; break; case vb_magic: - if (_vm->_gyro.dna.avaricius_talk > 0) + if (_vm->_gyro->dna.avaricius_talk > 0) _vm->_visa.dixi('q', 19); else { - if ((_vm->_gyro.dna.room == 12) & (_vm->_trip.infield(2))) { + if ((_vm->_gyro->dna.room == 12) & (_vm->_trip.infield(2))) { /* Avaricius appears! */ _vm->_visa.dixi('q', 17); - if (_vm->_gyro.whereis['\227'] == 12) + if (_vm->_gyro->whereis['\227'] == 12) _vm->_visa.dixi('q', 18); else { _vm->_trip.tr[2].init(1, false, &_vm->_trip); /* Avaricius */ @@ -1273,7 +1273,7 @@ void Acci::do_that() { _vm->_trip.tr[2].walkto(5); _vm->_trip.tr[2].call_eachstep = true; _vm->_trip.tr[2].eachstep = _vm->_trip.procback_and_forth; - _vm->_gyro.dna.avaricius_talk = 14; + _vm->_gyro->dna.avaricius_talk = 14; _vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks); } } else @@ -1284,7 +1284,7 @@ void Acci::do_that() { _vm->_scrolls.display("Listen, smart alec, that was just rhetoric."); break; case vb_expletive: - switch (_vm->_gyro.dna.swore) { + switch (_vm->_gyro->dna.swore) { case 0: _vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") + "(I shouldn't say it again, if I were you!)"); @@ -1299,20 +1299,20 @@ void Acci::do_that() { "and fries you.\r\r(`Such is the anger of the gods, Avvy!\")"); _vm->_lucerna.gameover(); } - _vm->_gyro.dna.swore++; + _vm->_gyro->dna.swore++; break; case vb_listen: - if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B'))) + if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B'))) _vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") + "the bells."); - else if (_vm->_gyro.listen == "") + else if (_vm->_gyro->listen == "") _vm->_scrolls.display("You can't hear anything much at the moment, Avvy."); else - _vm->_scrolls.display(_vm->_gyro.listen); + _vm->_scrolls.display(_vm->_gyro->listen); break; case vb_buy: /* What are they trying to buy? */ - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__argentpub: if (_vm->_trip.infield(6)) { /* We're in a pub, and near the bar. */ @@ -1321,49 +1321,49 @@ void Acci::do_that() { case '\65': case '\66': case '\72': /* Beer, whisky, cider or mead */ - if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */ + if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */ _vm->_visa.dixi('D', 15); return; } - if (_vm->_gyro.dna.teetotal) { + if (_vm->_gyro->dna.teetotal) { _vm->_visa.dixi('D', 6); return; } - if (_vm->_gyro.dna.alcohol == 0) + if (_vm->_gyro->dna.alcohol == 0) _vm->_lucerna.points(3); _vm->_celer.show_one(12); _vm->_scrolls.display(booze[thing] + ", please.\231\2"); - _vm->_gyro.dna.drinking = thing; + _vm->_gyro->dna.drinking = thing; _vm->_celer.show_one(10); - _vm->_gyro.dna.malagauche = 177; + _vm->_gyro->dna.malagauche = 177; _vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks); break; case '\64': examine(); break; /* We have a right one here- buy Pepsi??! */ - case _vm->_gyro.wine: - if (_vm->_gyro.dna.obj[_vm->_gyro.wine]) /* We've already got the wine! */ + case _vm->_gyro->wine: + if (_vm->_gyro->dna.obj[_vm->_gyro->wine]) /* We've already got the wine! */ _vm->_visa.dixi('D', 2); /* 1 bottle's shufishent! */ else { - if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */ + if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */ _vm->_visa.dixi('D', 15); return; } - if (_vm->_gyro.dna.carrying >= maxobjs) { + if (_vm->_gyro->dna.carrying >= maxobjs) { _vm->_scrolls.display("Your hands are full."); return; } _vm->_celer.show_one(12); _vm->_scrolls.display("Wine, please.\231\2"); - if (_vm->_gyro.dna.alcohol == 0) + if (_vm->_gyro->dna.alcohol == 0) _vm->_lucerna.points(3); _vm->_celer.show_one(10); - _vm->_gyro.dna.malagauche = 177; + _vm->_gyro->dna.malagauche = 177; _vm->_timeout.set_up_timer(27, _vm->_timeout.procbuywine, _vm->_timeout.reason_drinks); } @@ -1375,24 +1375,24 @@ void Acci::do_that() { case r__outsideducks: if (_vm->_trip.infield(6)) { - if (thing == _vm->_gyro.onion) { - if (_vm->_gyro.dna.obj[_vm->_gyro.onion]) + if (thing == _vm->_gyro->onion) { + if (_vm->_gyro->dna.obj[_vm->_gyro->onion]) _vm->_visa.dixi('D', 10); /* not planning to juggle with the things! */ - else if (_vm->_gyro.dna.carrying >= maxobjs) + else if (_vm->_gyro->dna.carrying >= maxobjs) _vm->_scrolls.display("Before you ask, you remember that your hands are full."); else { - if (_vm->_gyro.dna.bought_onion) + if (_vm->_gyro->dna.bought_onion) _vm->_visa.dixi('D', 11); else { _vm->_visa.dixi('D', 9); _vm->_lucerna.points(3); } - _vm->_gyro.pennycheck(3); /* It costs thruppence. */ - _vm->_gyro.dna.obj[_vm->_gyro.onion] = true; + _vm->_gyro->pennycheck(3); /* It costs thruppence. */ + _vm->_gyro->dna.obj[_vm->_gyro->onion] = true; _vm->_lucerna.objectlist(); - _vm->_gyro.dna.bought_onion = true; - _vm->_gyro.dna.rotten_onion = false; /* It's OK when it leaves the stall! */ - _vm->_gyro.dna.onion_in_vinegar = false; + _vm->_gyro->dna.bought_onion = true; + _vm->_gyro->dna.rotten_onion = false; /* It's OK when it leaves the stall! */ + _vm->_gyro->dna.onion_in_vinegar = false; } } else _vm->_visa.dixi('D', 0); @@ -1408,10 +1408,10 @@ void Acci::do_that() { } break; case vb_attack: - if ((_vm->_gyro.dna.room == r__brummieroad) && - ((person == '\235') || (thing == _vm->_gyro.crossbow) || (thing == _vm->_gyro.bolt)) - && (_vm->_gyro.whereis['\235'] == _vm->_gyro.dna.room)) { - switch (_vm->_gyro.dna.obj[_vm->_gyro.bolt] + _vm->_gyro.dna.obj[_vm->_gyro.crossbow] * 2) { + if ((_vm->_gyro->dna.room == r__brummieroad) && + ((person == '\235') || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt)) + && (_vm->_gyro->whereis['\235'] == _vm->_gyro->dna.room)) { + switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow] * 2) { /* 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both. */ case 0: @@ -1419,7 +1419,7 @@ void Acci::do_that() { _vm->_scrolls.display("(At the very least, don't use your bare hands!)"); break; case 1: - _vm->_scrolls.display(Common::String("Attack _vm->_gyro.him with only a crossbow bolt? Are you ") + + _vm->_scrolls.display(Common::String("Attack _vm->_gyro->him with only a crossbow bolt? Are you ") + "planning on playing darts?!"); break; case 2: @@ -1428,16 +1428,16 @@ void Acci::do_that() { break; case 3: _vm->_visa.dixi('Q', 11); - _vm->_gyro.dna.cwytalot_gone = true; - _vm->_gyro.dna.obj[_vm->_gyro.bolt] = false; - _vm->_gyro.dna.obj[_vm->_gyro.crossbow] = false; + _vm->_gyro->dna.cwytalot_gone = true; + _vm->_gyro->dna.obj[_vm->_gyro->bolt] = false; + _vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false; _vm->_lucerna.objectlist(); - _vm->_gyro.magics[12].op = _vm->_gyro.nix; + _vm->_gyro->magics[12].op = _vm->_gyro->nix; _vm->_lucerna.points(7); _vm->_trip.tr[2].walkto(2); _vm->_trip.tr[2].vanishifstill = true; _vm->_trip.tr[2].call_eachstep = false; - _vm->_gyro.whereis['\235'] = 177; + _vm->_gyro->whereis['\235'] = 177; break; default: _vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */ @@ -1446,27 +1446,27 @@ void Acci::do_that() { _vm->_visa.dixi('Q', 10); break; case vb_password: - if (_vm->_gyro.dna.room != r__bridge) + if (_vm->_gyro->dna.room != r__bridge) _vm->_visa.dixi('Q', 12); else { ok = true; for (ff = 1; ff <= thats.size(); ff++) { - for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv++) { + for (fv = 1; fv <= words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++) { Common::String temp = realwords[ff]; temp.toUppercase(); - if (words[_vm->_gyro.dna.pass_num + first_password].w[fv] != temp[fv]) + if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv]) ok = false; } } if (ok) { - if (_vm->_gyro.dna.drawbridge_open != 0) + if (_vm->_gyro->dna.drawbridge_open != 0) _vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again."); else { _vm->_lucerna.points(4); _vm->_scrolls.display("The drawbridge opens!"); _vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls); - _vm->_gyro.dna.drawbridge_open = 1; + _vm->_gyro->dna.drawbridge_open = 1; } } else _vm->_visa.dixi('Q', 12); @@ -1479,7 +1479,7 @@ void Acci::do_that() { _vm->_lucerna.gameover(); break; case vb_score: - _vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro.strf(_vm->_gyro.dna.score) + ",\3\rout of a " + + _vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ",\3\rout of a " + "possible 128.\r\rThis gives you a rank of " + rank() + ".\r\r" + totaltime()); break; @@ -1495,13 +1495,13 @@ void Acci::do_that() { _vm->_scrolls.display("Kiss whom?"); else if (personshere()) { switch (person) { - case _vm->_gyro.parkata: + case _vm->_gyro->parkata: _vm->_visa.dixi('U', 12); break; - case _vm->_gyro.pgeida: + case _vm->_gyro->pgeida: _vm->_visa.dixi('U', 13); break; - case _vm->_gyro.pwisewoman: + case _vm->_gyro->pwisewoman: _vm->_visa.dixi('U', 14); break; default: @@ -1513,7 +1513,7 @@ void Acci::do_that() { break; case vb_climb: - if (_vm->_gyro.dna.room == r__insidecardiffcastle) + if (_vm->_gyro->dna.room == r__insidecardiffcastle) cardiff_climbing(); else /* In the wrong room! */ _vm->_scrolls.display("Not with your head for heights, Avvy!"); @@ -1521,7 +1521,7 @@ void Acci::do_that() { case vb_jump: _vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping); - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.user_moves_avvy = false; break; case vb_highscores: @@ -1533,23 +1533,23 @@ void Acci::do_that() { if (personshere()) switch (person) { case pardon: - case _vm->_gyro.pavalot: + case _vm->_gyro->pavalot: case '\0': - if (!_vm->_gyro.dna.avvy_is_awake) { - _vm->_gyro.dna.avvy_is_awake = true; + if (!_vm->_gyro->dna.avvy_is_awake) { + _vm->_gyro->dna.avvy_is_awake = true; _vm->_lucerna.points(1); - _vm->_gyro.dna.avvy_in_bed = true; + _vm->_gyro->dna.avvy_in_bed = true; _vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */ - if (_vm->_gyro.dna.teetotal) + if (_vm->_gyro->dna.teetotal) _vm->_visa.dixi('d', 13); } else _vm->_scrolls.display("You're already awake, Avvy!"); break; - case _vm->_gyro.payles: - if (!_vm->_gyro.dna.ayles_is_awake) - _vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself."); + case _vm->_gyro->payles: + if (!_vm->_gyro->dna.ayles_is_awake) + _vm->_scrolls.display("You can't seem to wake _vm->_gyro->him by yourself."); break; - case _vm->_gyro.pjacques: + case _vm->_gyro->pjacques: _vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") + "Hmmm... that doesn't seem to do any good..."); break; @@ -1559,17 +1559,17 @@ void Acci::do_that() { break; case vb_sit: - if (_vm->_gyro.dna.room == r__nottspub) { - if (_vm->_gyro.dna.sitting_in_pub) + if (_vm->_gyro->dna.room == r__nottspub) { + if (_vm->_gyro->dna.sitting_in_pub) _vm->_scrolls.display("You're already sitting!"); else { - _vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro.him down. */ + _vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */ _vm->_timeout.set_up_timer(1, _vm->_timeout.procavvy_sit_down, _vm->_timeout.reason_sitting_down); } } else { /* Default doodah. */ _vm->_lucerna.dusk(); - _vm->_gyro.hang_around_for_a_while(); + _vm->_gyro->hang_around_for_a_while(); _vm->_lucerna.dawn(); _vm->_scrolls.display("A few hours later...\20nothing much has happened..."); } @@ -1578,7 +1578,7 @@ void Acci::do_that() { case vb_restart: if (_vm->_scrolls.ask("Restart game and lose changes?")) { _vm->_lucerna.dusk(); - _vm->_gyro.newgame(); + _vm->_gyro->newgame(); _vm->_lucerna.dawn(); } break; diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 55bbf33498..d5187f1fa8 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -59,13 +59,14 @@ AvalancheEngine::~AvalancheEngine() { delete _graphics; delete _avalot; + delete _gyro; } Common::ErrorCode AvalancheEngine::initialize() { _graphics = new Graphics(this); _avalot = new Avalot(this); - _gyro.setParent(this); + _gyro = new Gyro(this); _enhanced.setParent(this); _logger.setParent(this); _pingo.setParent(this); diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 99540b4a18..49c02ff141 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -68,7 +68,7 @@ public: Graphics *_graphics; Avalot *_avalot; - Gyro _gyro; + Gyro *_gyro; Enhanced _enhanced; Logger _logger; Pingo _pingo; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 61d5ad34e4..6ce6348e58 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -66,41 +66,41 @@ void Avalot::setup() { int16 gd, gm; checkbreak = false; - _vm->_gyro.visible = _vm->_gyro.m_no; - _vm->_gyro.to_do = 0; - _vm->_gyro.lmo = false; + _vm->_gyro->visible = _vm->_gyro->m_no; + _vm->_gyro->to_do = 0; + _vm->_gyro->lmo = false; _vm->_scrolls.resetscroll(); - _vm->_gyro.setup_vmc(); - _vm->_gyro.on_virtual(); + _vm->_gyro->setup_vmc(); + _vm->_gyro->on_virtual(); gd = 3; gm = 0; //initgraph(gd: gm: ""); - _vm->_gyro.holdthedawn = true; + _vm->_gyro->holdthedawn = true; _vm->_lucerna.dusk(); - _vm->_gyro.cmp = 177; + _vm->_gyro->cmp = 177; _vm->_lucerna.mouse_init(); /*on;*/ - _vm->_gyro.dropsok = true; - _vm->_gyro.ctrl = ckey; - _vm->_gyro.oldjw = 177; - _vm->_gyro.mousetext = ""; - _vm->_gyro.c = 999; + _vm->_gyro->dropsok = true; + _vm->_gyro->ctrl = ckey; + _vm->_gyro->oldjw = 177; + _vm->_gyro->mousetext = ""; + _vm->_gyro->c = 999; //settextjustify(0: 0); - _vm->_gyro.ddmnow = false; + _vm->_gyro->ddmnow = false; _vm->_lucerna.load_digits(); - _vm->_gyro.cheat = false; - _vm->_gyro.cp = 0; - _vm->_gyro.curpos = 1; - _vm->_gyro.quote = true; - _vm->_gyro.ledstatus = 177; - _vm->_gyro.defaultled = 2; + _vm->_gyro->cheat = false; + _vm->_gyro->cp = 0; + _vm->_gyro->curpos = 1; + _vm->_gyro->quote = true; + _vm->_gyro->ledstatus = 177; + _vm->_gyro->defaultled = 2; /* TSkellern:=0; { Replace with a more local variable sometime }*/ - _vm->_gyro.dna.rw = _vm->_gyro.stopped; - _vm->_gyro.enid_filename = ""; /* undefined. */ + _vm->_gyro->dna.rw = _vm->_gyro->stopped; + _vm->_gyro->enid_filename = ""; /* undefined. */ _vm->_lucerna.toolbar(); _vm->_scrolls.state(2); _vm->_graphics->refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality. for (byte i = 0; i < 3; i++) - _vm->_gyro.lastscore[i] = -1; /* impossible digits */ + _vm->_gyro->lastscore[i] = -1; /* impossible digits */ /* for gd:=0 to 1 do begin @@ -109,45 +109,45 @@ void Avalot::setup() { _vm->_trip.loadtrip(); - _vm->_gyro.reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game. + _vm->_gyro->reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game. - if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded)) - _vm->_gyro.newgame(); /* no game was requested- load the default */ + if ((_vm->_gyro->filetoload.empty()) && (! _vm->_gyro->reloaded)) + _vm->_gyro->newgame(); /* no game was requested- load the default */ else { - if (! _vm->_gyro.reloaded) + if (! _vm->_gyro->reloaded) _vm->_enid.avvy_background(); _vm->_dropdown.standard_bar(); _vm->_lucerna.sprite_run(); - if (_vm->_gyro.reloaded) + if (_vm->_gyro->reloaded) _vm->_enid.edna_reload(); else { /* Filename given on the command line (or loadfirst) */ - _vm->_enid.edna_load(_vm->_gyro.filetoload); + _vm->_enid.edna_load(_vm->_gyro->filetoload); if (_vm->_enid.there_was_a_problem()) { _vm->_scrolls.display("So let's start from the beginning instead..."); - _vm->_gyro.holdthedawn = true; + _vm->_gyro->holdthedawn = true; _vm->_lucerna.dusk(); - _vm->_gyro.newgame(); + _vm->_gyro->newgame(); } } } - if (! _vm->_gyro.reloaded) { - _vm->_gyro.soundfx = ! _vm->_gyro.soundfx; + if (! _vm->_gyro->reloaded) { + _vm->_gyro->soundfx = ! _vm->_gyro->soundfx; _vm->_lucerna.fxtoggle(); - _vm->_lucerna.thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing); + _vm->_lucerna.thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); } _vm->_trip.get_back_loretta(); //gm = getpixel(0: 0); //setcolor(7); - _vm->_gyro.holdthedawn = false; + _vm->_gyro->holdthedawn = false; _vm->_lucerna.dawn(); - _vm->_gyro.cursoron = false; + _vm->_gyro->cursoron = false; _vm->_basher.cursor_on(); _vm->_trip.newspeed(); - if (! _vm->_gyro.reloaded) + if (! _vm->_gyro->reloaded) _vm->_visa.dixi('q', 83); /* Info on the game: etc. */ } @@ -184,18 +184,18 @@ void Avalot::run(Common::String arg) { _vm->_basher.keyboard_link(); _vm->_dropdown.menu_link(); _vm->_trip.readstick(); - _vm->_gyro.force_numlock(); + _vm->_gyro->force_numlock(); _vm->_trip.get_back_loretta(); _vm->_trip.trippancy_link(); _vm->_celer.pics_link(); _vm->_lucerna.checkclick(); - if (_vm->_gyro.visible == _vm->_gyro.m_virtual) - _vm->_gyro.plot_vmc(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.cp); + if (_vm->_gyro->visible == _vm->_gyro->m_virtual) + _vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp); _vm->_lucerna.flip_page(); /* <<<! */ - _vm->_gyro.slowdown(); - if (_vm->_gyro.visible == _vm->_gyro.m_virtual) - _vm->_gyro.wipe_vmc(_vm->_gyro.cp); + _vm->_gyro->slowdown(); + if (_vm->_gyro->visible == _vm->_gyro->m_virtual) + _vm->_gyro->wipe_vmc(_vm->_gyro->cp); _vm->_timeout.one_tick(); @@ -207,7 +207,7 @@ void Avalot::run(Common::String arg) { _vm->_graphics->refreshScreen(); // TODO: Maybe it'll have a better place later. Move it there when it's needed. - } while (! _vm->_gyro.lmo); + } while (! _vm->_gyro->lmo); //restorecrtmode(); //if (logging) diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp index 176cbfcc31..3f2b01bdb6 100644 --- a/engines/avalanche/basher2.cpp +++ b/engines/avalanche/basher2.cpp @@ -56,13 +56,13 @@ void Basher::setParent(AvalancheEngine *vm) { void Basher::init() { /* new(previous);*/ - if (!_vm->_gyro.last.empty()) - _vm->_gyro.last.clear(); + if (!_vm->_gyro->last.empty()) + _vm->_gyro->last.clear(); normal_edit(); - if (_vm->_gyro.demo) { - if (!_vm->_gyro.demofile.open("demo.avd")) { + if (_vm->_gyro->demo) { + if (!_vm->_gyro->demofile.open("demo.avd")) { warning("AVALANCHE: Basher: File not found: demo.avd"); throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here. } @@ -71,7 +71,7 @@ void Basher::init() { // Not sure that the following part will be used ever... #ifdef RECORD count = 0; - if (!_vm->_gyro.demofile_save.open("demo.avd")) { + if (!_vm->_gyro->demofile_save.open("demo.avd")) { warning("AVALANCHE: Basher: File not found: demo.avd"); throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here. } @@ -183,10 +183,10 @@ void Basher::filename_edit() { void Basher::normal_edit() { entering_filename = false; - /*if (!_vm->_gyro.current.empty()) - _vm->_gyro.current.clear();*/ + /*if (!_vm->_gyro->current.empty()) + _vm->_gyro->current.clear();*/ left_margin = 1; - _vm->_gyro.curpos = 1; + _vm->_gyro->curpos = 1; } } // End of namespace Avalanche. diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index cc44021531..e73f51c835 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -53,36 +53,36 @@ void Celer::setParent(AvalancheEngine *vm) { void Celer::pics_link() { byte xx; - if (_vm->_gyro.ddmnow) + if (_vm->_gyro->ddmnow) return; /* No animation when the menus are up. */ - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__outsideargentpub: - if ((_vm->_gyro.roomtime % int32(12)) == 0) - show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4)); + if ((_vm->_gyro->roomtime % int32(12)) == 0) + show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(4)); break; case r__brummieroad: - if ((_vm->_gyro.roomtime % int32(2)) == 0) - show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4)); + if ((_vm->_gyro->roomtime % int32(2)) == 0) + show_one(int32(1) + (_vm->_gyro->roomtime / int32(2)) % int32(4)); break; case r__bridge: - if ((_vm->_gyro.roomtime % int32(2)) == 0) - show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4)); + if ((_vm->_gyro->roomtime % int32(2)) == 0) + show_one(int32(4) + (_vm->_gyro->roomtime / int32(2)) % int32(4)); break; case r__yours: - if ((!_vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0)) - show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2)); + if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % int32(4)) == 0)) + show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(2)); break; case r__argentpub: - if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) { + if (((_vm->_gyro->roomtime % int32(7)) == 1) && (_vm->_gyro->dna.malagauche != 177)) { /* Malagauche cycle */ - _vm->_gyro.dna.malagauche += 1; - switch (_vm->_gyro.dna.malagauche) { + _vm->_gyro->dna.malagauche += 1; + switch (_vm->_gyro->dna.malagauche) { case 1: case 11: case 21: @@ -98,12 +98,12 @@ void Celer::pics_link() { show_one(13); break; /* Winks. */ case 33: - _vm->_gyro.dna.malagauche = 0; + _vm->_gyro->dna.malagauche = 0; break; } } - switch (_vm->_gyro.roomtime % 200) { + switch (_vm->_gyro->roomtime % 200) { case 179: case 197: show_one(5); @@ -116,11 +116,11 @@ void Celer::pics_link() { show_one(7); break; case 199: - _vm->_gyro.dna.dogfoodpos = 177; + _vm->_gyro->dna.dogfoodpos = 177; break; /* Impossible value for this. */ } - if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */ + if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { /* Normally. */ if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360))) xx = 3; else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357)) @@ -128,16 +128,16 @@ void Celer::pics_link() { else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292)) xx = 4; - if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ + if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ show_one(xx); - _vm->_gyro.dna.dogfoodpos = xx; + _vm->_gyro->dna.dogfoodpos = xx; } } break; case r__westhall: - if ((_vm->_gyro.roomtime % int32(3)) == 0) { - switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) { + if ((_vm->_gyro->roomtime % int32(3)) == 0) { + switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) { case 4: show_one(1); break; @@ -155,8 +155,8 @@ void Celer::pics_link() { break; case r__lustiesroom: - if (!(_vm->_gyro.dna.lustie_is_asleep)) { - if ((_vm->_gyro.roomtime % int32(45)) > 42) + if (!(_vm->_gyro->dna.lustie_is_asleep)) { + if ((_vm->_gyro->roomtime % int32(45)) > 42) xx = 4; /* du Lustie blinks */ /* Bearing of Avvy from du Lustie. */ @@ -167,16 +167,16 @@ void Celer::pics_link() { else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314)) xx = 3; /* Right. */ - if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ + if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ show_one(xx); - _vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ + _vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ } } break; case r__aylesoffice: - if ((!_vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) { - switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) { + if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % int32(14) == 0)) { + switch ((_vm->_gyro->roomtime / int32(14)) % int32(2)) { case 0: show_one(1); break; /* Frame 2: EGA. */ @@ -188,8 +188,8 @@ void Celer::pics_link() { break; case r__robins: - if (_vm->_gyro.dna.tied_up) { - switch (_vm->_gyro.roomtime % int32(54)) { + if (_vm->_gyro->dna.tied_up) { + switch (_vm->_gyro->roomtime % int32(54)) { case 20: show_one(4); break; /* Frame 4: Avalot blinks. */ @@ -209,15 +209,15 @@ void Celer::pics_link() { else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314)) xx = 8; /* Right. */ - if ((_vm->_gyro.roomtime % int32(60)) > 57) + if ((_vm->_gyro->roomtime % int32(60)) > 57) xx--; /* Blinks */ - if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ + if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ show_one(xx); - _vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ + _vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ } - switch (_vm->_gyro.roomtime % 50) { + switch (_vm->_gyro->roomtime % 50) { case 45 : show_one(9); break; /* Spurge blinks */ @@ -228,8 +228,8 @@ void Celer::pics_link() { break; case r__ducks: - if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */ - show_one(1 + (_vm->_gyro.roomtime / 3) % 3); + if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */ + show_one(1 + (_vm->_gyro->roomtime / 3) % 3); {/* _vm->_lucerna.bearing of Avvy from Duck. */ if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360))) @@ -239,26 +239,26 @@ void Celer::pics_link() { else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314)) xx = 8; /* Right. */ - if ((_vm->_gyro.roomtime % int32(45)) > 42) + if ((_vm->_gyro->roomtime % int32(45)) > 42) xx += 1; /* Duck blinks */ - if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ + if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ show_one(xx); - _vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ + _vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ } break; } } - if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B'))) { + if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) { /* They're ringing the bells. */ - switch (_vm->_gyro.roomtime % int32(4)) { + switch (_vm->_gyro->roomtime % int32(4)) { case 1: - if (_vm->_gyro.dna.nextbell < 5) - _vm->_gyro.dna.nextbell = 12; - _vm->_gyro.dna.nextbell -= 1; - _vm->_gyro.note(_vm->_gyro.notes[_vm->_gyro.dna.nextbell]); + if (_vm->_gyro->dna.nextbell < 5) + _vm->_gyro->dna.nextbell = 12; + _vm->_gyro->dna.nextbell -= 1; + _vm->_gyro->note(_vm->_gyro->notes[_vm->_gyro->dna.nextbell]); break; case 2: //nosound; diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index 219df15fc2..985eb7f088 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -58,14 +58,14 @@ headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, f } void headtype::display() { - _dr->_vm->_gyro.off(); /*MT*/ + _dr->_vm->_gyro->off(); /*MT*/ _dr->chalk(xpos, 1, trigger, title, true); - _dr->_vm->_gyro.on(); /*MT*/ + _dr->_vm->_gyro->on(); /*MT*/ } void headtype::highlight() { - _dr->_vm->_gyro.off(); - _dr->_vm->_gyro.off_virtual(); + _dr->_vm->_gyro->off(); + _dr->_vm->_gyro->off_virtual(); //nosound(); //setactivepage(cp); @@ -75,10 +75,10 @@ void headtype::highlight() { { _dr->ddm_o.left = xpos; _dr->ddm_o.menunow = true; - _dr->_vm->_gyro.ddmnow = true; + _dr->_vm->_gyro->ddmnow = true; _dr->ddm_o.menunum = position; } - _dr->_vm->_gyro.cmp = 177; /* Force redraw of cursor. */ + _dr->_vm->_gyro->cmp = 177; /* Force redraw of cursor. */ } bool headtype::extdparse(char c) { @@ -95,7 +95,7 @@ bool headtype::extdparse(char c) { onemenu *onemenu::init(Dropdown *dr) { _dr = dr; menunow = false; - _dr->_vm->_gyro.ddmnow = false; + _dr->_vm->_gyro->ddmnow = false; menunum = 1; return this; } @@ -140,10 +140,10 @@ void onemenu::movehighlight(int8 add) { void onemenu::lightup() { /* This makes the menu highlight follow the mouse.*/ warning("STUB: Dropdown::onemenu::lightup()"); - /*if ((_dr->_vm->_gyro.mx < flx1 * 8) || (_dr->_vm->_gyro.mx > flx2 * 8) || - (_dr->_vm->_gyro.my <= 12) || (_dr->_vm->_gyro.my > fly - 3)) + /*if ((_dr->_vm->_gyro->mx < flx1 * 8) || (_dr->_vm->_gyro->mx > flx2 * 8) || + (_dr->_vm->_gyro->my <= 12) || (_dr->_vm->_gyro->my > fly - 3)) return; - highlightnum = (_dr->_vm->_gyro.my - 13) / 10; + highlightnum = (_dr->_vm->_gyro->my - 13) / 10; if (highlightnum == oldy) return; movehighlight(0);*/ @@ -172,7 +172,7 @@ void onemenu::keystroke(char c) { } } if (! found) - _dr->_vm->_gyro.blip(); + _dr->_vm->_gyro->blip(); } @@ -199,8 +199,8 @@ void menuset::update() { bar(0, 0, 640, 9);*/ _dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->menu_b); - savecp = _dr->_vm->_gyro.cp; - _dr->_vm->_gyro.cp = 3; + savecp = _dr->_vm->_gyro->cp; + _dr->_vm->_gyro->cp = 3; for (fv = 1; fv <= howmany; fv ++) ddms[fv].display(); @@ -208,7 +208,7 @@ void menuset::update() { for (page_ = 0; page_ <= 1; page_ ++) _dr->_vm->_trip.getset[page_].remember(menuspace); - _dr->_vm->_gyro.cp = savecp; + _dr->_vm->_gyro->cp = savecp; } void menuset::extd(char c) { @@ -251,30 +251,30 @@ void Dropdown::setParent(AvalancheEngine *vm) { } void Dropdown::find_what_you_can_do_with_it() { - switch (_vm->_gyro.thinks) { - case _vm->_gyro.wine: - case _vm->_gyro.potion: - case _vm->_gyro.ink: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink; + switch (_vm->_gyro->thinks) { + case _vm->_gyro->wine: + case _vm->_gyro->potion: + case _vm->_gyro->ink: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink; break; - case _vm->_gyro.bell: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring; + case _vm->_gyro->bell: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring; break; - case _vm->_gyro.chastity: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear; + case _vm->_gyro->chastity: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear; break; - case _vm->_gyro.lute: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play; + case _vm->_gyro->lute: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play; break; - case _vm->_gyro.mushroom: - case _vm->_gyro.onion: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat; + case _vm->_gyro->mushroom: + case _vm->_gyro->onion: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat; break; - case _vm->_gyro.clothes: - _vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear; + case _vm->_gyro->clothes: + _vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear; break; default: - _vm->_gyro.verbstr = _vm->_acci.vb_exam; /* anything else */ + _vm->_gyro->verbstr = _vm->_acci.vb_exam; /* anything else */ } } @@ -287,7 +287,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) { for (byte fv = 0; fv < z.size(); fv++) for (byte ff = 0; ff < 8; ff++) { - byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator! + byte pixel = ~(_vm->_gyro->little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator! for (byte bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; *_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2); @@ -398,9 +398,9 @@ void Dropdown::ddm__file() { ddm_o.start_afresh(); ddm_o.opt("New game", 'N', "f4", true); ddm_o.opt("Load...", 'L', "^f3", true); - ddm_o.opt("Save", 'S', "^f2", _vm->_gyro.alive); - ddm_o.opt("Save As...", 'v', "", _vm->_gyro.alive); - ddm_o.opt("DOS Shell", 'D', _vm->_gyro.atkey + '1', true); + ddm_o.opt("Save", 'S', "^f2", _vm->_gyro->alive); + ddm_o.opt("Save As...", 'v', "", _vm->_gyro->alive); + ddm_o.opt("DOS Shell", 'D', _vm->_gyro->atkey + '1', true); ddm_o.opt("Quit", 'Q', "alt-X", true); ddm_o.display(); } @@ -408,7 +408,7 @@ void Dropdown::ddm__file() { void Dropdown::ddm__action() { Common::String n; - n = Common::String(_vm->_gyro.f5_does().c_str() + 2, 253); + n = Common::String(_vm->_gyro->f5_does().c_str() + 2, 253); { ddm_o.start_afresh(); @@ -417,13 +417,13 @@ void Dropdown::ddm__action() { else ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true); ddm_o.opt("Pause game", 'P', "f6", true); - if (_vm->_gyro.dna.room == 99) + if (_vm->_gyro->dna.room == 99) ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip.neardoor()); else ddm_o.opt("Open the door", 'O', "f7", _vm->_trip.neardoor()); ddm_o.opt("Look around", 'L', "f8", true); ddm_o.opt("Inventory", 'I', "Tab", true); - if (_vm->_trip.tr[1].xs == _vm->_gyro.walk) + if (_vm->_trip.tr[1].xs == _vm->_gyro->walk) ddm_o.opt("Run fast", 'R', "^R", true); else ddm_o.opt("Walk slowly", 'W', "^W", true); @@ -436,13 +436,13 @@ void Dropdown::ddm__people() { char fv; people = ""; - here = _vm->_gyro.dna.room; + here = _vm->_gyro->dna.room; { ddm_o.start_afresh(); for (fv = '\226'; fv <= '\262'; fv ++) - if (_vm->_gyro.whereis[fv] == here) { - ddm_o.opt(_vm->_gyro.getname(fv), _vm->_gyro.getnamechar(fv), "", true); + if (_vm->_gyro->whereis[fv] == here) { + ddm_o.opt(_vm->_gyro->getname(fv), _vm->_gyro->getnamechar(fv), "", true); people = people + fv; } ddm_o.display(); @@ -454,8 +454,8 @@ void Dropdown::ddm__objects() { { ddm_o.start_afresh(); for (fv = '\1'; fv <= numobjs; fv ++) - if (_vm->_gyro.dna.obj[fv]) - ddm_o.opt(_vm->_gyro.get_thing(fv), _vm->_gyro.get_thingchar(fv), "", true); + if (_vm->_gyro->dna.obj[fv]) + ddm_o.opt(_vm->_gyro->get_thing(fv), _vm->_gyro->get_thingchar(fv), "", true); ddm_o.display(); } } @@ -553,7 +553,7 @@ void Dropdown::do__action() { case 0: { _vm->_acci.person = _vm->_acci.pardon; _vm->_acci.thing = _vm->_acci.pardon; - n = _vm->_gyro.f5_does(); + n = _vm->_gyro->f5_does(); _vm->_lucerna.callverb(n[1]); } break; @@ -570,8 +570,8 @@ void Dropdown::do__action() { _vm->_lucerna.callverb(_vm->_acci.vb_inv); break; case 5: { - if (_vm->_trip.tr[1].xs == _vm->_gyro.walk) _vm->_trip.tr[1].xs = _vm->_gyro.run; - else _vm->_trip.tr[1].xs = _vm->_gyro.walk; + if (_vm->_trip.tr[1].xs == _vm->_gyro->walk) _vm->_trip.tr[1].xs = _vm->_gyro->run; + else _vm->_trip.tr[1].xs = _vm->_gyro->walk; _vm->_trip.newspeed(); } break; @@ -579,28 +579,28 @@ void Dropdown::do__action() { } void Dropdown::do__objects() { - _vm->_lucerna.thinkabout(_vm->_gyro.objlist[ddm_o.choicenum + 1], _vm->_gyro.a_thing); + _vm->_lucerna.thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing); } void Dropdown::do__people() { - _vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro.a_person); - _vm->_gyro.last_person = people[ddm_o.choicenum + 1]; + _vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person); + _vm->_gyro->last_person = people[ddm_o.choicenum + 1]; } void Dropdown::do__with() { - _vm->_acci.thing = _vm->_gyro.thinks; + _vm->_acci.thing = _vm->_gyro->thinks; - if (_vm->_gyro.thinkthing) { + if (_vm->_gyro->thinkthing) { _vm->_acci.thing += 49; - if (_vm->_gyro.verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give) - _vm->_acci.person = _vm->_gyro.last_person; + if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give) + _vm->_acci.person = _vm->_gyro->last_person; else _vm->_acci.person = '\376'; } else { - switch (_vm->_gyro.verbstr[ddm_o.choicenum + 1]) { + switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) { case '\144': { _vm->_acci.thing = '\144'; _vm->_lucerna.callverb(_vm->_acci.vb_buy); @@ -643,7 +643,7 @@ void Dropdown::do__with() { } } } - _vm->_lucerna.callverb(_vm->_gyro.verbstr[ddm_o.choicenum + 1]); + _vm->_lucerna.callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]); } /*$F- That's all. Now for the ...bar funcs. */ @@ -680,26 +680,26 @@ begin; end;*/ void Dropdown::checkclick() { /* only for when the menu's displayed */ - if (_vm->_gyro.mpress > 0) { - if (_vm->_gyro.mpy > 10) { + if (_vm->_gyro->mpress > 0) { + if (_vm->_gyro->mpy > 10) { if (!((ddm_o.firstlix) && - ((_vm->_gyro.mpx >= ddm_o.flx1 * 8) && (_vm->_gyro.mpx <= ddm_o.flx2 * 8) && - (_vm->_gyro.mpy >= 12) && (_vm->_gyro.mpy <= ddm_o.fly)))) { + ((_vm->_gyro->mpx >= ddm_o.flx1 * 8) && (_vm->_gyro->mpx <= ddm_o.flx2 * 8) && + (_vm->_gyro->mpy >= 12) && (_vm->_gyro->mpy <= ddm_o.fly)))) { /* Clicked OUTSIDE the menu. */ if (ddm_o.menunow) ddm_o.wipe(); } /* No "else"- clicking on menu has no effect (only releasing) */ } else { /* Clicked on menu bar */ - ddm_m.getmenu(_vm->_gyro.mpx); + ddm_m.getmenu(_vm->_gyro->mpx); } } else { ; /* NOT clicked button... */ - if (_vm->_gyro.mrelease > 0) { + if (_vm->_gyro->mrelease > 0) { if ((ddm_o.firstlix) && - ((_vm->_gyro.mrx >= ddm_o.flx1 * 8) && (_vm->_gyro.mrx <= ddm_o.flx2 * 8) && - (_vm->_gyro.mry >= 12) && (_vm->_gyro.mry <= ddm_o.fly))) - ddm_o.select((_vm->_gyro.mry - 13) / 10); + ((_vm->_gyro->mrx >= ddm_o.flx1 * 8) && (_vm->_gyro->mrx <= ddm_o.flx2 * 8) && + (_vm->_gyro->mry >= 12) && (_vm->_gyro->mry <= ddm_o.fly))) + ddm_o.select((_vm->_gyro->mry - 13) / 10); } } } @@ -707,22 +707,22 @@ void Dropdown::checkclick() { /* only for when the menu's displayed */ void Dropdown::menu_link() { if (! ddm_o.menunow) return; - _vm->_gyro.check(); /* find mouse coords & click information */ + _vm->_gyro->check(); /* find mouse coords & click information */ checkclick(); /* work out click codes */ /* Change arrow... */ - if ((_vm->_gyro.my >= 0) && (_vm->_gyro.my <= 10)) - _vm->_gyro.newpointer(1); /* up-arrow */ - else if ((_vm->_gyro.my >= 11) && (_vm->_gyro.my <= 169)) { - if ((_vm->_gyro.mx >= ddm_o.flx1 * 8) && (_vm->_gyro.mx <= ddm_o.flx2 * 8) - && (_vm->_gyro.my > 10) && (_vm->_gyro.my <= ddm_o.fly)) - _vm->_gyro.newpointer(3); /* right-arrow */ + if ((_vm->_gyro->my >= 0) && (_vm->_gyro->my <= 10)) + _vm->_gyro->newpointer(1); /* up-arrow */ + else if ((_vm->_gyro->my >= 11) && (_vm->_gyro->my <= 169)) { + if ((_vm->_gyro->mx >= ddm_o.flx1 * 8) && (_vm->_gyro->mx <= ddm_o.flx2 * 8) + && (_vm->_gyro->my > 10) && (_vm->_gyro->my <= ddm_o.fly)) + _vm->_gyro->newpointer(3); /* right-arrow */ else - _vm->_gyro.newpointer(4); /* fletch */ - } else if ((_vm->_gyro.my >= 169) && (_vm->_gyro.my <= 200)) - _vm->_gyro.newpointer(2); /* screwdriver */ + _vm->_gyro->newpointer(4); /* fletch */ + } else if ((_vm->_gyro->my >= 169) && (_vm->_gyro->my <= 200)) + _vm->_gyro->newpointer(2); /* screwdriver */ if (! ddm_o.menunow) return; diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp index 107330a678..7284b888b4 100644 --- a/engines/avalanche/enid2.cpp +++ b/engines/avalanche/enid2.cpp @@ -94,7 +94,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) { break; } - day = _vm->_gyro.strf(d); + day = _vm->_gyro->strf(d); if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31))) { switch (d % 10) { @@ -112,7 +112,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) { } } - expanddate_result = day + ' ' + month + ' ' + _vm->_gyro.strf(y); + expanddate_result = day + ' ' + month + ' ' + _vm->_gyro->strf(y); return expanddate_result; } @@ -148,8 +148,8 @@ void Enid::edna_save(Common::String name) { } void Enid::loaderror(Common::String x, char icon) { - if (_vm->_gyro.holdthedawn) { - _vm->_gyro.holdthedawn = false; + if (_vm->_gyro->holdthedawn) { + _vm->_gyro->holdthedawn = false; _vm->_lucerna.dawn(); } _vm->_scrolls.display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error: " + "\r\r\22" + x); @@ -250,17 +250,17 @@ void Enid::avvy_background() { /* Not really a filing procedure, } void Enid::to_sundry(sundry &sund) { - sund.qenid_filename = _vm->_gyro.enid_filename; - sund.qsoundfx = _vm->_gyro.soundfx; - sund.qthinks = _vm->_gyro.thinks; - sund.qthinkthing = _vm->_gyro.thinkthing; + sund.qenid_filename = _vm->_gyro->enid_filename; + sund.qsoundfx = _vm->_gyro->soundfx; + sund.qthinks = _vm->_gyro->thinks; + sund.qthinkthing = _vm->_gyro->thinkthing; } void Enid::from_sundry(sundry sund) { - _vm->_gyro.enid_filename = sund.qenid_filename; - _vm->_gyro.soundfx = sund.qsoundfx; - _vm->_gyro.thinks = sund.qthinks; - _vm->_gyro.thinkthing = sund.qthinkthing; + _vm->_gyro->enid_filename = sund.qenid_filename; + _vm->_gyro->soundfx = sund.qsoundfx; + _vm->_gyro->thinks = sund.qthinks; + _vm->_gyro->thinkthing = sund.qthinkthing; } void Enid::restore_dna() { @@ -274,19 +274,19 @@ void Enid::edna_reload() { restore_dna(); - _vm->_gyro.seescroll = true; /* This prevents display of the new sprites before the + _vm->_gyro->seescroll = true; /* This prevents display of the new sprites before the new picture is loaded. */ _vm->_lucerna.major_redraw(); - _vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room; + _vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room; - _vm->_gyro.alive = true; + _vm->_gyro->alive = true; _vm->_lucerna.objectlist(); - if (_vm->_gyro.holdthedawn) { - _vm->_gyro.holdthedawn = false; + if (_vm->_gyro->holdthedawn) { + _vm->_gyro->holdthedawn = false; _vm->_lucerna.dawn(); } } diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index aba169c6b8..dd1157b628 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -246,7 +246,9 @@ const char Gyro::betterchar[] = "WMBParCLguKeSnIohn"; -Gyro::Gyro() : interrogation(0), oncandopageswap(true) { +Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) { + _vm = vm; + /* Needed becouse of Lucerna::load_also() */ for (int fv = 0; fv < 31; fv++) for (int ff = 0; ff < 2; ff++) @@ -265,10 +267,6 @@ Gyro::~Gyro() { } -void Gyro::setParent(AvalancheEngine *vm) { - _vm = vm; -} - void Gyro::newpointer(byte m) { if (m == cmp) return; cmp = m; @@ -359,7 +357,7 @@ void Gyro::newgame() { /* This sets up the DNA for a completely new game. */ alive = true; score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/ - memset(&_vm->_gyro.dna, 0, sizeof(dnatype)); + memset(&_vm->_gyro->dna, 0, sizeof(dnatype)); _vm->_scrolls.natural(); _vm->_basher.normal_edit(); _vm->_lucerna.mousepage(0); diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 29de10ca90..58b5844906 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -610,12 +610,10 @@ public: bool use_joy_a; - Gyro(); + Gyro(AvalancheEngine *vm); ~Gyro(); - void setParent(AvalancheEngine *vm); - void newpointer(byte m); void wait(); /* makes hourglass */ diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp index eeedb2301e..20ca558e41 100644 --- a/engines/avalanche/logger2.cpp +++ b/engines/avalanche/logger2.cpp @@ -82,7 +82,7 @@ void Logger::setParent(AvalancheEngine *vm) { void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */ byte fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::centre()"); @@ -109,13 +109,13 @@ void Logger::log_setup(Common::String name, bool printing) { /* Sets up. */ void Logger::log_divider() { /* Prints the divider sign. */ byte fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_divider()"); /* - if (_vm->_gyro.log_epson) { + if (_vm->_gyro->log_epson) { output << logfile << Common::String(' ') + double_width; for (fv = 1; fv <= divide_indent; fv++) output << logfile << ' '; @@ -129,19 +129,19 @@ void Logger::log_divider() { /* Prints the divider sign. */ } void Logger::log_command(Common::String x) { /* Prints a command */ - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_command()"); - /*if (_vm->_gyro.log_epson) + /*if (_vm->_gyro->log_epson) output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL; else output << logfile << Common::String("> ") + x << NL;*/ } void Logger::log_addstuff(Common::String x) { - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; scroll_line += x; @@ -149,7 +149,7 @@ void Logger::log_addstuff(Common::String x) { void Logger::log_scrollchar(Common::String x) { /* print one character */ Common::String z; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; switch (x[1]) { @@ -170,34 +170,34 @@ void Logger::log_scrollchar(Common::String x) { /* print one character */ } void Logger::log_italic() { - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_italic()"); - /*if (_vm->_gyro.log_epson) + /*if (_vm->_gyro->log_epson) log_addstuff(italic); else log_addstuff("*");*/ } void Logger::log_roman() { - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_roman()"); - /* if (_vm->_gyro.log_epson) + /* if (_vm->_gyro->log_epson) log_addstuff(italic_off); else log_addstuff("*");*/ } void Logger::log_epsonroman() { /* This only sends the Roman code if you're on Epson.*/ - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; - if (_vm->_gyro.log_epson) + if (_vm->_gyro->log_epson) log_addstuff(italic_off); } @@ -208,7 +208,7 @@ void Logger::log_scrollline() { /* Set up a line for the scroll driver */ void Logger::log_scrollendline(bool centred) { byte x, fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; x = 17; if (centred) @@ -223,7 +223,7 @@ void Logger::log_scrollendline(bool centred) { void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) { byte fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_bubbleline()"); @@ -242,30 +242,30 @@ void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) { void Logger::log_newline() { warning("STUB: Logger::log_newline()"); - //if (_vm->_gyro.logging) + //if (_vm->_gyro->logging) // output << logfile << NL; } void Logger::log_newroom(Common::String where) { byte fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_newroom()"); /*for (fv = 1; fv <= 20; fv++) output << logfile << ' '; - if (_vm->_gyro.log_epson) + if (_vm->_gyro->log_epson) output << logfile << emph_on; output << logfile << Common::String('(') + where + ')'; - if (_vm->_gyro.log_epson) + if (_vm->_gyro->log_epson) output << logfile << emph_off; output << logfile << NL;*/ } void Logger::log_aside(Common::String what) { /* This writes "asides" to the printer. For example, moves in Nim. */ - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_aside()"); @@ -276,7 +276,7 @@ void Logger::log_aside(Common::String what) { void Logger::log_score(uint16 credit, uint16 now) { byte fv; - if (!_vm->_gyro.logging) + if (!_vm->_gyro->logging) return; warning("STUB: Logger::log_score()"); diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index aefa6bff97..f2690085e0 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -61,10 +61,10 @@ void Lucerna::setParent(AvalancheEngine *vm) { } void Lucerna::init() { - _vm->_gyro.oh = 17717; - _vm->_gyro.om = 17717; - if (_vm->_enhanced.atbios) _vm->_gyro.atkey = "f1"; - else _vm->_gyro.atkey = "alt-"; + _vm->_gyro->oh = 17717; + _vm->_gyro->om = 17717; + if (_vm->_enhanced.atbios) _vm->_gyro->atkey = "f1"; + else _vm->_gyro->atkey = "alt-"; } void Lucerna::callverb(char n) { @@ -74,7 +74,7 @@ void Lucerna::callverb(char n) { "assigned to it. You may press alt-A to see what the " + "current setting of this key is."); } else { - _vm->_gyro.weirdword = false; + _vm->_gyro->weirdword = false; _vm->_acci.polite = true; _vm->_acci.verb = n; _vm->_acci.do_that(); @@ -108,10 +108,10 @@ void Lucerna::scram1(Common::String &x) { 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); + if (_vm->_gyro->also[fv][ff] != 0) + scram1(*_vm->_gyro->also[fv][ff]); + scram1(_vm->_gyro->listen); + scram1(_vm->_gyro->flags); /* for fz:=1 to length(also[fv,ff]^) do also[fv,ff]^[fz]:=chr(ord(also[fv,ff]^[fz]) xor 177);*/ } @@ -121,9 +121,9 @@ void Lucerna::load_also(Common::String n) { 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; + if (_vm->_gyro->also[fv][ff] != 0) { + delete _vm->_gyro->also[fv][ff]; + _vm->_gyro->also[fv][ff] = 0; } Common::String filename; @@ -138,58 +138,58 @@ void Lucerna::load_also(Common::String n) { 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(); + _vm->_gyro->also[fv][ff] = new Common::String; + *_vm->_gyro->also[fv][ff] = nextstring(); } - *_vm->_gyro.also[fv][0] = Common::String(157) + *_vm->_gyro.also[fv][0] + 157; + *_vm->_gyro->also[fv][0] = Common::String(157) + *_vm->_gyro->also[fv][0] + 157; } - memset(_vm->_gyro.lines, 0xFF, sizeof(_vm->_gyro.lines)); + memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines)); //fv = getpixel(0, 0); fv = f.readByte(); for (byte i = 0; i < fv; 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].col = f.readByte(); + _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].col = f.readByte(); } - memset(_vm->_gyro.peds, 177, sizeof(_vm->_gyro.peds)); + 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].dir = f.readByte(); + _vm->_gyro->peds[i].x = f.readSint16LE(); + _vm->_gyro->peds[i].y = f.readSint16LE(); + _vm->_gyro->peds[i].dir = f.readByte(); } - _vm->_gyro.numfields = f.readByte(); - for (byte i = 0; i < _vm->_gyro.numfields; 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->numfields = f.readByte(); + for (byte i = 0; i < _vm->_gyro->numfields; 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(); } for (byte i = 0; i < 15; i++) { - _vm->_gyro.magics[i].op = f.readByte(); - _vm->_gyro.magics[i].data = f.readUint16LE(); + _vm->_gyro->magics[i].op = f.readByte(); + _vm->_gyro->magics[i].data = f.readUint16LE(); } for (byte i = 0; i < 7; i++) { - _vm->_gyro.portals[i].op = f.readByte(); - _vm->_gyro.portals[i].data = f.readUint16LE(); + _vm->_gyro->portals[i].op = f.readByte(); + _vm->_gyro->portals[i].data = f.readUint16LE(); } - _vm->_gyro.flags.clear(); + _vm->_gyro->flags.clear(); for (byte i = 0; i < 26; i++) - _vm->_gyro.flags += f.readByte(); + _vm->_gyro->flags += f.readByte(); int16 listen_length = f.readByte(); - _vm->_gyro.listen.clear(); + _vm->_gyro->listen.clear(); for (byte i = 0; i < listen_length; i++) - _vm->_gyro.listen += f.readByte(); + _vm->_gyro->listen += f.readByte(); draw_also_lines(); @@ -199,7 +199,7 @@ void Lucerna::load_also(Common::String n) { f.close(); unscramble(); for (fv = 0; fv <= minnames; fv++) - *_vm->_gyro.also[fv][0] = Common::String(',') + *_vm->_gyro.also[fv][0] + ','; + *_vm->_gyro->also[fv][0] = Common::String(',') + *_vm->_gyro->also[fv][0] + ','; } void Lucerna::load(byte n) { /* Load2, actually */ @@ -209,17 +209,17 @@ void Lucerna::load(byte n) { /* Load2, actually */ Common::String xx; bool was_virtual; - was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual; + was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual; if (was_virtual) - _vm->_gyro.off_virtual(); + _vm->_gyro->off_virtual(); else - _vm->_gyro.off(); + _vm->_gyro->off(); - _vm->_gyro.clear_vmc(); + _vm->_gyro->clear_vmc(); _vm->_graphics->flesh_colours(); - xx = _vm->_gyro.strf(n); + xx = _vm->_gyro->strf(n); Common::String filename; filename = filename.format("place%s.avd", xx.c_str()); if (!f.open(filename)) { @@ -229,7 +229,7 @@ void Lucerna::load(byte n) { /* Load2, actually */ f.seek(146); for (byte i = 0; i < 30; i++) - _vm->_gyro.roomname += f.readByte(); + _vm->_gyro->roomname += f.readByte(); /* Compression method byte follows this... */ f.seek(177); @@ -278,12 +278,12 @@ void Lucerna::load(byte n) { /* Load2, actually */ bit = *_vm->_graphics->getPixel(0,0); - _vm->_logger.log_newroom(_vm->_gyro.roomname); + _vm->_logger.log_newroom(_vm->_gyro->roomname); if (was_virtual) - _vm->_gyro.on_virtual(); + _vm->_gyro->on_virtual(); else - _vm->_gyro.on(); + _vm->_gyro->on(); } @@ -297,28 +297,28 @@ void Lucerna::zoomout(int16 x, int16 y) { void Lucerna::find_people(byte room) { for (byte fv = 151; fv <= 178; fv++) - if (_vm->_gyro.whereis[fv] == room) { + if (_vm->_gyro->whereis[fv] == room) { if (fv < 175) - _vm->_gyro.him = fv; + _vm->_gyro->him = fv; else - _vm->_gyro.her = fv; + _vm->_gyro->her = fv; } } void Lucerna::exitroom(byte x) { //nosound(); _vm->_celer.forget_chunks(); - _vm->_gyro.seescroll = true; /* This stops the trippancy system working over the length of this procedure. */ + _vm->_gyro->seescroll = true; /* This stops the trippancy system working over the length of this procedure. */ switch (x) { case r__spludwicks: _vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks); - _vm->_gyro.dna.avaricius_talk = 0; + _vm->_gyro->dna.avaricius_talk = 0; /* He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. */ break; case r__bridge: - if (_vm->_gyro.dna.drawbridge_open > 0) { - _vm->_gyro.dna.drawbridge_open = 4; /* Fully open. */ + if (_vm->_gyro->dna.drawbridge_open > 0) { + _vm->_gyro->dna.drawbridge_open = 4; /* Fully open. */ _vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls); } break; @@ -330,39 +330,39 @@ void Lucerna::exitroom(byte x) { break; } - _vm->_gyro.interrogation = 0; /* Leaving the room cancels all the questions automatically. */ + _vm->_gyro->interrogation = 0; /* Leaving the room cancels all the questions automatically. */ - _vm->_gyro.seescroll = false; /* Now it can work again! */ + _vm->_gyro->seescroll = false; /* Now it can work again! */ - _vm->_gyro.dna.last_room = _vm->_gyro.dna.room; - if (_vm->_gyro.dna.room != r__map) - _vm->_gyro.dna.last_room_not_map = _vm->_gyro.dna.room; + _vm->_gyro->dna.last_room = _vm->_gyro->dna.room; + if (_vm->_gyro->dna.room != r__map) + _vm->_gyro->dna.last_room_not_map = _vm->_gyro->dna.room; } void Lucerna::new_town() { /* You've just entered a town from the map. */ _vm->_dropdown.standard_bar(); - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__outsidenottspub: /* Entry into Nottingham. */ - if ((_vm->_gyro.dna.rooms[r__robins] > 0) && (_vm->_gyro.dna.been_tied_up) && (! _vm->_gyro.dna.taken_mushroom)) - _vm->_gyro.dna.mushroom_growing = true; + if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (! _vm->_gyro->dna.taken_mushroom)) + _vm->_gyro->dna.mushroom_growing = true; break; case r__wisewomans: { /* Entry into Argent. */ - if (_vm->_gyro.dna.talked_to_crapulus && (! _vm->_gyro.dna.lustie_is_asleep)) { - _vm->_gyro.dna.spludwicks_here = !((_vm->_gyro.dna.rooms[r__wisewomans] % 3) == 1); - _vm->_gyro.dna.crapulus_will_tell = ! _vm->_gyro.dna.spludwicks_here; + if (_vm->_gyro->dna.talked_to_crapulus && (! _vm->_gyro->dna.lustie_is_asleep)) { + _vm->_gyro->dna.spludwicks_here = !((_vm->_gyro->dna.rooms[r__wisewomans] % 3) == 1); + _vm->_gyro->dna.crapulus_will_tell = ! _vm->_gyro->dna.spludwicks_here; } else { - _vm->_gyro.dna.spludwicks_here = true; - _vm->_gyro.dna.crapulus_will_tell = false; + _vm->_gyro->dna.spludwicks_here = true; + _vm->_gyro->dna.crapulus_will_tell = false; } - if (_vm->_gyro.dna.box_contents == _vm->_gyro.wine) _vm->_gyro.dna.winestate = 3; /* Vinegar */ + if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine) _vm->_gyro->dna.winestate = 3; /* Vinegar */ } break; } - if (_vm->_gyro.dna.room != r__outsideducks) { - if ((_vm->_gyro.dna.obj[_vm->_gyro.onion]) && !(_vm->_gyro.dna.onion_in_vinegar)) - _vm->_gyro.dna.rotten_onion = true; /* You're holding the onion */ + if (_vm->_gyro->dna.room != r__outsideducks) { + if ((_vm->_gyro->dna.obj[_vm->_gyro->onion]) && !(_vm->_gyro->dna.onion_in_vinegar)) + _vm->_gyro->dna.rotten_onion = true; /* You're holding the onion */ } } @@ -378,33 +378,33 @@ void Lucerna::put_geida_at(byte whichped, byte &ped) { } void Lucerna::enterroom(byte x, byte ped) { - _vm->_gyro.seescroll = true; /* This stops the trippancy system working over the length of this procedure. */ + _vm->_gyro->seescroll = true; /* This stops the trippancy system working over the length of this procedure. */ find_people(x); - _vm->_gyro.dna.room = x; + _vm->_gyro->dna.room = x; if (ped != 0) - _vm->_gyro.dna.rooms[x]++; + _vm->_gyro->dna.rooms[x]++; load(x); - if ((_vm->_gyro.dna.rooms[x] == 0) && (! _vm->_gyro.flagset('S'))) + if ((_vm->_gyro->dna.rooms[x] == 0) && (! _vm->_gyro->flagset('S'))) points(1); - _vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room; + _vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room; - if (_vm->_gyro.dna.geida_follows) - _vm->_gyro.whereis[_vm->_gyro.pgeida] = x; + if (_vm->_gyro->dna.geida_follows) + _vm->_gyro->whereis[_vm->_gyro->pgeida] = x; - _vm->_gyro.roomtime = 0; + _vm->_gyro->roomtime = 0; - if ((_vm->_gyro.dna.last_room == r__map) && (_vm->_gyro.dna.last_room_not_map != _vm->_gyro.dna.room)) + if ((_vm->_gyro->dna.last_room == r__map) && (_vm->_gyro->dna.last_room_not_map != _vm->_gyro->dna.room)) new_town(); switch (x) { case r__yours: - if (_vm->_gyro.dna.avvy_in_bed) { + if (_vm->_gyro->dna.avvy_in_bed) { _vm->_celer.show_one(3); _vm->_timeout.set_up_timer(100, _vm->_timeout.procarkata_shouts, _vm->_timeout.reason_arkata_shouts); } @@ -412,12 +412,12 @@ void Lucerna::enterroom(byte x, byte ped) { case r__outsideyours: if (ped > 0) { - if (! _vm->_gyro.dna.talked_to_crapulus) { + if (! _vm->_gyro->dna.talked_to_crapulus) { - _vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__outsideyours; + _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours; _vm->_trip.tr[2].init(8, false, &_vm->_trip); /* load Crapulus */ - if (_vm->_gyro.dna.rooms[r__outsideyours] == 1) { + if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) { _vm->_trip.apped(2, 4); /* Start on the right-hand side of the screen. */ _vm->_trip.tr[2].walkto(5); /* Walks up to greet you. */ } else { @@ -428,14 +428,14 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_trip.tr[2].call_eachstep = true; _vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* He always faces Avvy. */ - } else _vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__nowhere; + } else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere; - if (_vm->_gyro.dna.crapulus_will_tell) { + if (_vm->_gyro->dna.crapulus_will_tell) { _vm->_trip.tr[2].init(8, false, &_vm->_trip); _vm->_trip.apped(2, 2); _vm->_trip.tr[2].walkto(4); _vm->_timeout.set_up_timer(20, _vm->_timeout.proccrapulus_splud_out, _vm->_timeout.reason_crapulus_says_spludwick_out); - _vm->_gyro.dna.crapulus_will_tell = false; + _vm->_gyro->dna.crapulus_will_tell = false; } } break; @@ -443,40 +443,40 @@ void Lucerna::enterroom(byte x, byte ped) { /* Need to find out which room is this! case r__outsidespludwicks: - if ((_vm->_gyro.dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) { + if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) { _vm->_timeout.set_up_timer(20, _vm->_timeout.procbang, _vm->_timeout.reason_explosion); - _vm->_gyro.dna.spludwicks_here = true; + _vm->_gyro->dna.spludwicks_here = true; } break;*/ case r__spludwicks: - if (_vm->_gyro.dna.spludwicks_here) { + if (_vm->_gyro->dna.spludwicks_here) { if (ped > 0) { _vm->_trip.tr[2].init(2, false, &_vm->_trip); /* load Spludwick */ _vm->_trip.apped(2, 2); - _vm->_gyro.whereis['\227'] = r__spludwicks; + _vm->_gyro->whereis['\227'] = r__spludwicks; } - _vm->_gyro.dna.dogfoodpos = 0; /* _vm->_gyro.also Spludwick pos. */ + _vm->_gyro->dna.dogfoodpos = 0; /* _vm->_gyro->also Spludwick pos. */ _vm->_trip.tr[2].call_eachstep = true; _vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs; - } else _vm->_gyro.whereis['\227'] = r__nowhere; + } else _vm->_gyro->whereis['\227'] = r__nowhere; break; case r__brummieroad: { - if (_vm->_gyro.dna.geida_follows) put_geida_at(5, ped); - if (_vm->_gyro.dna.cwytalot_gone) { - _vm->_gyro.magics[lightred].op = _vm->_gyro.nix; - _vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__nowhere; + if (_vm->_gyro->dna.geida_follows) put_geida_at(5, ped); + if (_vm->_gyro->dna.cwytalot_gone) { + _vm->_gyro->magics[lightred].op = _vm->_gyro->nix; + _vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere; } else { if (ped > 0) { _vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot*/ _vm->_trip.tr[2].call_eachstep = true; _vm->_trip.tr[2].eachstep = _vm->_trip.procfollow_avvy_y; - _vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__brummieroad; + _vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad; - if (_vm->_gyro.dna.rooms[r__brummieroad] == 1) { /* First time here... */ + if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */ _vm->_trip.apped(2, 2); /* He appears on the right of the screen... */ _vm->_trip.tr[2].walkto(4); /* ...and he walks up... */ } else { @@ -490,32 +490,32 @@ void Lucerna::enterroom(byte x, byte ped) { break; case r__argentroad: { - dnatype &with = _vm->_gyro.dna; + dnatype &with = _vm->_gyro->dna; if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) && - (_vm->_gyro.dna.rooms[r__argentroad] > 3)) { + (_vm->_gyro->dna.rooms[r__argentroad] > 3)) { _vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot again*/ _vm->_trip.apped(2, 1); _vm->_trip.tr[2].walkto(2); _vm->_trip.tr[2].vanishifstill = true; with.cwytalot_in_herts = true; - /*_vm->_gyro.whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */ + /*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */ _vm->_timeout.set_up_timer(20, _vm->_timeout.proc_cwytalot_in_herts, _vm->_timeout.reason_cwytalot_in_herts); } } break; case r__bridge: { - if (_vm->_gyro.dna.drawbridge_open == 4) { /*open*/ + if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/ _vm->_celer.show_one(3); /* Position of drawbridge */ - _vm->_gyro.magics[green].op = _vm->_gyro.nix; /* You may enter the drawbridge. */ + _vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */ } - if (_vm->_gyro.dna.geida_follows) put_geida_at(ped + 3, ped); /* load Geida */ + if (_vm->_gyro->dna.geida_follows) put_geida_at(ped + 3, ped); /* load Geida */ } break; case r__robins: { if (ped > 0) { - if (! _vm->_gyro.dna.been_tied_up) { + if (! _vm->_gyro->dna.been_tied_up) { /* A welcome party... or maybe not... */ _vm->_trip.tr[2].init(6, false, &_vm->_trip); _vm->_trip.apped(2, 2); @@ -524,22 +524,22 @@ void Lucerna::enterroom(byte x, byte ped) { } } - if (_vm->_gyro.dna.been_tied_up) { - _vm->_gyro.whereis[_vm->_gyro.probinhood] = 0; - _vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 0; + if (_vm->_gyro->dna.been_tied_up) { + _vm->_gyro->whereis[_vm->_gyro->probinhood] = 0; + _vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 0; } - if (_vm->_gyro.dna.tied_up) + if (_vm->_gyro->dna.tied_up) _vm->_celer.show_one(2); - if (! _vm->_gyro.dna.mushroom_growing) + if (! _vm->_gyro->dna.mushroom_growing) _vm->_celer.show_one(3); } break; case r__outsidecardiffcastle: { if (ped > 0) - switch (_vm->_gyro.dna.cardiff_things) { + switch (_vm->_gyro->dna.cardiff_things) { case 0 : { /* You've answered NONE of his questions. */ _vm->_trip.tr[2].init(9, false, &_vm->_trip); _vm->_trip.apped(2, 2); @@ -548,7 +548,7 @@ void Lucerna::enterroom(byte x, byte ped) { } break; case 5 : - _vm->_gyro.magics[2].op = _vm->_gyro.nix; + _vm->_gyro->magics[2].op = _vm->_gyro->nix; break; /* You've answered ALL his questions. => nothing happens. */ default: { /* You've answered SOME of his questions. */ _vm->_trip.tr[2].init(9, false, &_vm->_trip); @@ -557,9 +557,9 @@ void Lucerna::enterroom(byte x, byte ped) { _vm->_timeout.set_up_timer(3, _vm->_timeout.proccardiff_return, _vm->_timeout.reason_cardiffsurvey); } } - if (_vm->_gyro.dna.cardiff_things < 5) - _vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things; - else _vm->_gyro.interrogation = 0; + if (_vm->_gyro->dna.cardiff_things < 5) + _vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things; + else _vm->_gyro->interrogation = 0; } break; @@ -574,9 +574,9 @@ void Lucerna::enterroom(byte x, byte ped) { break; case r__argentpub: { - if (_vm->_gyro.dna.wonnim) _vm->_celer.show_one(1); /* No lute by the settle. */ - _vm->_gyro.dna.malagauche = 0; /* Ready to boot Malagauche */ - if (_vm->_gyro.dna.givenbadgetoiby) { + if (_vm->_gyro->dna.wonnim) _vm->_celer.show_one(1); /* No lute by the settle. */ + _vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */ + if (_vm->_gyro->dna.givenbadgetoiby) { _vm->_celer.show_one(8); _vm->_celer.show_one(9); } @@ -584,27 +584,27 @@ void Lucerna::enterroom(byte x, byte ped) { break; case r__lustiesroom: { - _vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */ + _vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */ if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */ _vm->_timeout.set_up_timer(3, _vm->_timeout.proccallsguards, _vm->_timeout.reason_du_lustie_talks); - else if (! _vm->_gyro.dna.entered_lusties_room_as_monk) /*already*/ + else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/ /* Presumably, Avvy dressed as a monk. */ _vm->_timeout.set_up_timer(3, _vm->_timeout.procgreetsmonk, _vm->_timeout.reason_du_lustie_talks); - if (_vm->_gyro.dna.geida_follows) { + if (_vm->_gyro->dna.geida_follows) { put_geida_at(5, ped); - if (_vm->_gyro.dna.lustie_is_asleep) _vm->_celer.show_one(5); + if (_vm->_gyro->dna.lustie_is_asleep) _vm->_celer.show_one(5); } } break; case r__musicroom: { - if (_vm->_gyro.dna.jacques_awake > 0) { - _vm->_gyro.dna.jacques_awake = 5; + if (_vm->_gyro->dna.jacques_awake > 0) { + _vm->_gyro->dna.jacques_awake = 5; _vm->_celer.show_one(2); _vm->_celer.show_one(4); - _vm->_gyro.magics[brown].op = _vm->_gyro.nix; - _vm->_gyro.whereis[_vm->_gyro.pjacques] = 0; + _vm->_gyro->magics[brown].op = _vm->_gyro->nix; + _vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; } if (ped != 0) { _vm->_celer.show_one(6); @@ -636,7 +636,7 @@ void Lucerna::enterroom(byte x, byte ped) { case r__wisewomans: { _vm->_trip.tr[2].init(11, false, &_vm->_trip); - if ((_vm->_gyro.dna.rooms[r__wisewomans] == 1) && (ped > 0)) { + if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) { _vm->_trip.apped(2, 2); /* Start on the right-hand side of the screen. */ _vm->_trip.tr[2].walkto(4); /* Walks up to greet you. */ } else { @@ -653,18 +653,18 @@ void Lucerna::enterroom(byte x, byte ped) { if (ped > 0) { _vm->_trip.tr[2].init(10, false, &_vm->_trip); /* Define the dart. */ _vm->_sequence.first_show(1); - if (_vm->_gyro.dna.arrow_in_the_door) + if (_vm->_gyro->dna.arrow_in_the_door) _vm->_sequence.then_show(3); else _vm->_sequence.then_show(2); - if (_vm->_gyro.dna.taken_pen) + if (_vm->_gyro->dna.taken_pen) _vm->_celer.show_one(4); _vm->_sequence.start_to_close(); } else { _vm->_celer.show_one(1); - if (_vm->_gyro.dna.arrow_in_the_door) _vm->_celer.show_one(3); + if (_vm->_gyro->dna.arrow_in_the_door) _vm->_celer.show_one(3); else _vm->_celer.show_one(2); } break; @@ -689,7 +689,7 @@ void Lucerna::enterroom(byte x, byte ped) { break; case r__aylesoffice: - if (_vm->_gyro.dna.ayles_is_awake) + if (_vm->_gyro->dna.ayles_is_awake) _vm->_celer.show_one(2); break; /* Ayles awake. */ @@ -699,16 +699,16 @@ void Lucerna::enterroom(byte x, byte ped) { case r__easthall: case r__westhall: - if (_vm->_gyro.dna.geida_follows) put_geida_at(ped + 2, ped); + if (_vm->_gyro->dna.geida_follows) put_geida_at(ped + 2, ped); break; case r__lusties: - if (_vm->_gyro.dna.geida_follows) put_geida_at(ped + 6, ped); + if (_vm->_gyro->dna.geida_follows) put_geida_at(ped + 6, ped); break; case r__nottspub: { - if (_vm->_gyro.dna.sitting_in_pub) _vm->_celer.show_one(3); - _vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */ + if (_vm->_gyro->dna.sitting_in_pub) _vm->_celer.show_one(3); + _vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */ } break; @@ -723,12 +723,12 @@ void Lucerna::enterroom(byte x, byte ped) { } break; case r__ducks: - _vm->_gyro.dna.dogfoodpos = 1; + _vm->_gyro->dna.dogfoodpos = 1; break; /* Actually, Duck pos. */ } - _vm->_gyro.seescroll = false; /* Now it can work again! */ + _vm->_gyro->seescroll = false; /* Now it can work again! */ } @@ -736,10 +736,10 @@ void Lucerna::thinkabout(byte z, bool th) { /* Hey!!! Get it and put it!!! * const int16 picsize = 966; const bytefield thinkspace = {25, 170, 32, 200}; - _vm->_gyro.thinks = z; + _vm->_gyro->thinks = z; z--; - _vm->_gyro.wait(); + _vm->_gyro->wait(); if (th) { if (!f.open("thinks.avd")) { @@ -772,7 +772,7 @@ void Lucerna::thinkabout(byte z, bool th) { /* Hey!!! Get it and put it!!! * f.close(); - _vm->_gyro.off(); + _vm->_gyro->off(); /*setactivepage(3); putimage(x, y, p, 0); @@ -781,8 +781,8 @@ 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); - _vm->_gyro.on(); - _vm->_gyro.thinkthing = th; + _vm->_gyro->on(); + _vm->_gyro->thinkthing = th; } void Lucerna::load_digits() { /* Load the scoring digits & rwlites */ @@ -795,13 +795,13 @@ void Lucerna::load_digits() { /* Load the scoring digits & rwlites */ } for (byte fv = 0; fv < 10; fv ++) { - _vm->_gyro.digit[fv] = new byte[digitsize]; - f.read(_vm->_gyro.digit[fv], digitsize); + _vm->_gyro->digit[fv] = new byte[digitsize]; + f.read(_vm->_gyro->digit[fv], digitsize); } for (byte ff = 0; ff < 9; ff ++) { - _vm->_gyro.rwlite[ff] = new byte[rwlitesize]; - f.read(_vm->_gyro.rwlite[ff], rwlitesize); + _vm->_gyro->rwlite[ff] = new byte[rwlitesize]; + f.read(_vm->_gyro->rwlite[ff], rwlitesize); } f.close(); @@ -831,7 +831,7 @@ void Lucerna::toolbar() { /* on;*/ - _vm->_gyro.oldrw = 177; + _vm->_gyro->oldrw = 177; showrw(); } @@ -839,10 +839,10 @@ void Lucerna::showscore() { const bytefield scorespace = {33, 177, 39, 200}; - if (_vm->_gyro.demo) + if (_vm->_gyro->demo) return; - uint16 score = _vm->_gyro.dna.score; + uint16 score = _vm->_gyro->dna.score; int8 numbers[3] = {0, 0, 0}; for (byte i = 0; i < 2; i++) { byte divisor = 1; @@ -853,27 +853,27 @@ void Lucerna::showscore() { } numbers[2] = score; - _vm->_gyro.off(); + _vm->_gyro->off(); //setactivepage(3); for (byte fv = 0; fv < 3; fv ++) - if (_vm->_gyro.lastscore[fv] != numbers[fv]) - _vm->_graphics->drawPicture(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177); + if (_vm->_gyro->lastscore[fv] != numbers[fv]) + _vm->_graphics->drawPicture(_vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177); for (byte fv = 0; fv < 2; fv ++) _vm->_trip.getset[fv].remember(scorespace); //setactivepage(1 - cp); - _vm->_gyro.on(); + _vm->_gyro->on(); for (byte i = 0; i < 3; i++) - _vm->_gyro.lastscore[i] = numbers[i]; + _vm->_gyro->lastscore[i] = numbers[i]; } void Lucerna::points(byte num) { /* Add on no. of points */ for (byte q = 1; q <= num; q ++) { - _vm->_gyro.dna.score++; + _vm->_gyro->dna.score++; /*if (soundfx) for (byte fv = 1; fv <= 97; fv ++) sound(177 + dna.score * 3); @@ -881,13 +881,13 @@ void Lucerna::points(byte num) { /* Add on no. of points */ } warning("STUB: Lucerna::points()"); - _vm->_logger.log_score(num, _vm->_gyro.dna.score); + _vm->_logger.log_score(num, _vm->_gyro->dna.score); showscore(); } void Lucerna::topcheck() { /* Menuset */ - _vm->_dropdown.ddm_m.getmenu(_vm->_gyro.mpx); + _vm->_dropdown.ddm_m.getmenu(_vm->_gyro->mpx); /* Do this one */ } @@ -899,10 +899,10 @@ void Lucerna::inkey() { char r; - if (_vm->_gyro.demo) + if (_vm->_gyro->demo) return; /* Demo handles this itself. */ - if (_vm->_gyro.mousetext == "") { + if (_vm->_gyro->mousetext == "") { /* read keyboard */ _vm->_enhanced.readkeye(); if ((_vm->_enhanced.inchar == ' ') && ((_vm->_enhanced.shiftstate & 8) > 0)) { @@ -910,10 +910,10 @@ void Lucerna::inkey() { _vm->_enhanced.extd = '#'; /* alt-spacebar = alt-H */ } } else { - if (_vm->_gyro.mousetext[0] == '`') - _vm->_gyro.mousetext.setChar(13,0); /* Backquote = return in a macro */ - _vm->_enhanced.inchar = _vm->_gyro.mousetext[0]; - _vm->_gyro.mousetext = Common::String(_vm->_gyro.mousetext.c_str() + 2, 253); + if (_vm->_gyro->mousetext[0] == '`') + _vm->_gyro->mousetext.setChar(13,0); /* Backquote = return in a macro */ + _vm->_enhanced.inchar = _vm->_gyro->mousetext[0]; + _vm->_gyro->mousetext = Common::String(_vm->_gyro->mousetext.c_str() + 2, 253); } } @@ -926,34 +926,34 @@ void Lucerna::fxtoggle() { } void Lucerna::objectlist() { - _vm->_gyro.dna.carrying = 0; - if (_vm->_gyro.thinkthing && ! _vm->_gyro.dna.obj[_vm->_gyro.thinks]) - thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing); /* you always have money */ + _vm->_gyro->dna.carrying = 0; + if (_vm->_gyro->thinkthing && ! _vm->_gyro->dna.obj[_vm->_gyro->thinks]) + thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */ for (byte fv = 0; fv < numobjs; fv ++) - if (_vm->_gyro.dna.obj[fv]) { - _vm->_gyro.dna.carrying ++; - _vm->_gyro.objlist[_vm->_gyro.dna.carrying] = fv + 1; + if (_vm->_gyro->dna.obj[fv]) { + _vm->_gyro->dna.carrying ++; + _vm->_gyro->objlist[_vm->_gyro->dna.carrying] = fv + 1; } } void Lucerna::verte() { byte what; - if (! _vm->_gyro.dna.user_moves_avvy) + if (! _vm->_gyro->dna.user_moves_avvy) return; /* _vm->_trip.tr[0] : that's the only one we're interested in here */ - if (_vm->_gyro.mx < _vm->_trip.tr[0].x) + if (_vm->_gyro->mx < _vm->_trip.tr[0].x) what = 1; - else if (_vm->_gyro.mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) + else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) what = 2; else what = 0; /* On top */ - if (_vm->_gyro.my < _vm->_trip.tr[0].y) + if (_vm->_gyro->my < _vm->_trip.tr[0].y) what += 3; - else if (_vm->_gyro.my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl)) + else if (_vm->_gyro->my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl)) what += 6; switch (what) { @@ -994,7 +994,7 @@ void Lucerna::checkclick() { } void Lucerna::mouse_init() { - _vm->_gyro.wait(); + _vm->_gyro->wait(); } void Lucerna::mousepage(uint16 page_) { @@ -1042,19 +1042,19 @@ void Lucerna::dawn() { void Lucerna::showrw() { // It's data is loaded in load_digits(). - if (_vm->_gyro.oldrw == _vm->_gyro.dna.rw) + if (_vm->_gyro->oldrw == _vm->_gyro->dna.rw) return; - _vm->_gyro.oldrw = _vm->_gyro.dna.rw; - _vm->_gyro.off(); + _vm->_gyro->oldrw = _vm->_gyro->dna.rw; + _vm->_gyro->off(); /* for (byte page_ = 0; page_ <= 1; page_ ++) { setactivepage(page_); putimage(0, 161, rwlite[with.rw], 0); }*/ - _vm->_graphics->drawPicture(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161); + _vm->_graphics->drawPicture(_vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161); - _vm->_gyro.on(); + _vm->_gyro->on(); //setactivepage(1 - cp); warning("STUB: Lucerna::showrw()"); @@ -1207,21 +1207,21 @@ void Lucerna::flip_page() { void Lucerna::delavvy() { byte page_; - _vm->_gyro.off(); + _vm->_gyro->off(); triptype &with = _vm->_trip.tr[0]; for (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_); blitfix(); - _vm->_gyro.on(); + _vm->_gyro->on(); } void Lucerna::gameover() { byte fv; int16 sx, sy; - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.user_moves_avvy = false; sx = _vm->_trip.tr[1].x; sy = _vm->_trip.tr[1].y; @@ -1233,7 +1233,7 @@ void Lucerna::gameover() { _vm->_timeout.set_up_timer(3, _vm->_timeout.procavalot_falls, _vm->_timeout.reason_falling_over); /* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/ - _vm->_gyro.alive = false; + _vm->_gyro->alive = false; } /* OK. There are two kinds of redraw: Major and Minor. Minor is what happens @@ -1243,15 +1243,15 @@ void Lucerna::minor_redraw() { byte fv; dusk(); - enterroom(_vm->_gyro.dna.room, 0); /* Ped unknown or non-existant. */ + enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */ for (fv = 0; fv <= 1; fv ++) { - _vm->_gyro.cp = 1 - _vm->_gyro.cp; + _vm->_gyro->cp = 1 - _vm->_gyro->cp; _vm->_trip.getback(); } for (byte i = 0; i < 3; i++) - _vm->_gyro.lastscore[i] = -1; /* impossible digits */ + _vm->_gyro->lastscore[i] = -1; /* impossible digits */ showscore(); dawn(); @@ -1267,7 +1267,7 @@ uint16 Lucerna::bearing(byte whichped) { uint16 bearing_result; { - pedtype &with = _vm->_gyro.peds[whichped]; + pedtype &with = _vm->_gyro->peds[whichped]; if (_vm->_trip.tr[1].x == with.x) bearing_result = 0; /* This would cause a division by zero if we let it through. */ else { @@ -1290,7 +1290,7 @@ void Lucerna::sprite_run() { make the sprites the same on both pages. */ byte fv; - _vm->_gyro.doing_sprite_run = true; + _vm->_gyro->doing_sprite_run = true; for (fv = 0; fv <= 1; fv ++) { _vm->_trip.get_back_loretta(); @@ -1299,13 +1299,13 @@ void Lucerna::sprite_run() { flip_page(); } - _vm->_gyro.doing_sprite_run = false; + _vm->_gyro->doing_sprite_run = false; } void Lucerna::fix_flashers() { - _vm->_gyro.ledstatus = 177; - _vm->_gyro.oldrw = 177; + _vm->_gyro->ledstatus = 177; + _vm->_gyro->oldrw = 177; _vm->_scrolls.state(2); showrw(); } diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp index 7a468d4e41..1f7c35eea6 100644 --- a/engines/avalanche/pingo2.cpp +++ b/engines/avalanche/pingo2.cpp @@ -136,7 +136,7 @@ void Pingo::winning_pic() { _vm->_lucerna.dawn(); /*do { - _vm->_gyro.check(); + _vm->_gyro->check(); } while (!(keypressed() || (mrelease > 0))); while (keypressed()) r = readkey(); major_redraw();*/ diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 35ae4fc401..b0563c68a1 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -59,7 +59,7 @@ void Scrolls::init() { void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */ byte page_; - if (_vm->_gyro.ledstatus == x) + if (_vm->_gyro->ledstatus == x) return; /* Already like that! */ byte color; @@ -90,12 +90,12 @@ void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */ //} warning("STUB: Scrolls::state()"); - _vm->_gyro.super_off(); + _vm->_gyro->super_off(); _vm->_graphics->drawBar(419, 195, 438, 197, color); - _vm->_gyro.super_on(); - _vm->_gyro.ledstatus = x; + _vm->_gyro->super_on(); + _vm->_gyro->ledstatus = x; } void Scrolls::easteregg() { @@ -130,7 +130,7 @@ bool Scrolls::they_match(tunetype &played) { mistakes = 0; for (fv = 1; fv <= sizeof(played); fv ++) - if (played[fv] != _vm->_gyro.tune[fv]) { + if (played[fv] != _vm->_gyro->tune[fv]) { mistakes += 1; } @@ -144,32 +144,32 @@ void Scrolls::music_scroll() { /* ThatsAll, so put us back to */ /*$F-*/ void Scrolls::resetscrolldriver() { /* phew */ - _vm->_gyro.scrollbells = 0; + _vm->_gyro->scrollbells = 0; cfont = roman; _vm->_logger.log_epsonroman(); use_icon = 0; - _vm->_gyro.interrogation = 0; /* always reset after a scroll comes up. */ + _vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */ } void Scrolls::dingdongbell() { /* Pussy's in the well. Who put her in? Little... */ byte fv; - for (fv = 1; fv <= _vm->_gyro.scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */ + for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */ } void Scrolls::dodgem() { /* This moves the mouse pointer off the scroll so that you can read it. */ - _vm->_gyro.xycheck(); /* Mx & my now contain xy pos of mouse */ - dodgex = _vm->_gyro.mx; - dodgey = _vm->_gyro.my; /* Store 'em */ - _vm->_gyro.hopto(dodgex, _vm->_gyro.underscroll); /* Move the pointer off the scroll. */ + _vm->_gyro->xycheck(); /* Mx & my now contain xy pos of mouse */ + dodgex = _vm->_gyro->mx; + dodgey = _vm->_gyro->my; /* Store 'em */ + _vm->_gyro->hopto(dodgex, _vm->_gyro->underscroll); /* Move the pointer off the scroll. */ } void Scrolls::undodgem() { /* This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime. */ - _vm->_gyro.xycheck(); - if ((_vm->_gyro.mx == dodgex) && (_vm->_gyro.my == _vm->_gyro.underscroll)) + _vm->_gyro->xycheck(); + if ((_vm->_gyro->mx == dodgex) && (_vm->_gyro->my == _vm->_gyro->underscroll)) /* No change, so restore the pointer's original position. */ - _vm->_gyro.hopto(dodgex, dodgey); + _vm->_gyro->hopto(dodgex, dodgey); } void Scrolls::geticon(int16 x, int16 y, byte which) { @@ -200,7 +200,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) { int16 fv; uint16 st; - st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro.cp) * _vm->_gyro.pagetop); + st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop); Common::String filename; filename = filename.format("%s.avd", fn.c_str()); @@ -237,35 +237,35 @@ bool Scrolls::ask(Common::String question) { } void Scrolls::resetscroll() { - _vm->_gyro.scrolln = 1; + _vm->_gyro->scrolln = 1; for (int j = 0; j < 15; j ++) - for (int i = 0; i < _vm->_gyro.scroll[j].size(); i++) - _vm->_gyro.scroll[j].setChar(0, i); + for (int i = 0; i < _vm->_gyro->scroll[j].size(); i++) + _vm->_gyro->scroll[j].setChar(0, i); } void Scrolls::natural() { /* Natural state of bubbles */ - _vm->_gyro.talkx = 320; - _vm->_gyro.talky = 200; - _vm->_gyro.talkb = 8; - _vm->_gyro.talkf = 15; + _vm->_gyro->talkx = 320; + _vm->_gyro->talky = 200; + _vm->_gyro->talkb = 8; + _vm->_gyro->talkf = 15; } Common::String Scrolls::lsd() { Common::String x; Common::String lsd_result; - if (_vm->_gyro.dna.pence < 12) { + if (_vm->_gyro->dna.pence < 12) { /* just pence */ - x = _vm->_gyro.strf(_vm->_gyro.dna.pence) + 'd'; - } else if (_vm->_gyro.dna.pence < 240) { + x = _vm->_gyro->strf(_vm->_gyro->dna.pence) + 'd'; + } else if (_vm->_gyro->dna.pence < 240) { /* shillings & pence */ - x = _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(12)) + '/'; - if ((_vm->_gyro.dna.pence % int32(12)) == 0) x = x + '-'; - else x = x + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12)); + x = _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(12)) + '/'; + if ((_vm->_gyro->dna.pence % int32(12)) == 0) x = x + '-'; + else x = x + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12)); } else /* L, s & d */ - x = Common::String('œ') + _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(240)) + '.' + _vm->_gyro.strf((_vm->_gyro.dna.pence / int32(12)) % int32(20)) - + '.' + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12)); - if (_vm->_gyro.dna.pence > 12) x = x + " (that's " + _vm->_gyro.strf(_vm->_gyro.dna.pence) + "d)"; + x = Common::String('œ') + _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(240)) + '.' + _vm->_gyro->strf((_vm->_gyro->dna.pence / int32(12)) % int32(20)) + + '.' + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12)); + if (_vm->_gyro->dna.pence > 12) x = x + " (that's " + _vm->_gyro->strf(_vm->_gyro->dna.pence) + "d)"; lsd_result = x; return lsd_result; } @@ -286,8 +286,8 @@ void Scrolls::calldrivers() { } void Scrolls::display(Common::String z) { - _vm->_gyro.bufsize = z.size(); - memcpy(_vm->_gyro.buffer, z.c_str() + 1, _vm->_gyro.bufsize); + _vm->_gyro->bufsize = z.size(); + memcpy(_vm->_gyro->buffer, z.c_str() + 1, _vm->_gyro->bufsize); calldrivers(); } @@ -315,7 +315,7 @@ void Scrolls::loadfont() { return; } for (int16 i = 0; i < 256; i++) - f.read(_vm->_gyro.little[i],16); + f.read(_vm->_gyro->little[i],16); f.close(); } @@ -331,15 +331,15 @@ void Scrolls::musical_scroll() { _vm->_lucerna.sprite_run(); - was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual; + was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual; if (was_virtual) - _vm->_gyro.off_virtual(); + _vm->_gyro->off_virtual(); drawscroll(&Avalanche::Scrolls::music_scroll); if (was_virtual) - _vm->_gyro.on_virtual(); + _vm->_gyro->on_virtual(); resetscroll(); } diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp index f3ba72ad62..61198d297a 100644 --- a/engines/avalanche/sequence2.cpp +++ b/engines/avalanche/sequence2.cpp @@ -66,8 +66,8 @@ void Sequence::then_show(byte what) { void Sequence::then_flip(byte where, byte ped) { then_show(now_flip); - _vm->_gyro.dna.flip_to_where = where; - _vm->_gyro.dna.flip_to_ped = ped; + _vm->_gyro->dna.flip_to_where = where; + _vm->_gyro->dna.flip_to_ped = ped; } void Sequence::start_to_close() { @@ -76,7 +76,7 @@ void Sequence::start_to_close() { } void Sequence::start_to_open() { - _vm->_gyro.dna.user_moves_avvy = false; /* They can't move. */ + _vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */ _vm->_trip.stopwalking(); /* And they're not moving now. */ start_to_close(); /* Apart from that, it's the same thing. */ } @@ -94,8 +94,8 @@ void Sequence::call_sequencer() { return; break; /* No more routines. */ case 177: - _vm->_gyro.dna.user_moves_avvy = true; - _vm->_trip.fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */ + _vm->_gyro->dna.user_moves_avvy = true; + _vm->_trip.fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */ if (seq[0] == 177) shove_left(); break; diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index 623bb75e30..b10c1c18d6 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -73,7 +73,7 @@ void Timeout::set_up_timer(int32 howlong, byte whither, byte why) { } void Timeout::one_tick() { - if (_vm->_gyro.ddmnow) + if (_vm->_gyro->ddmnow) return; for (fv = 1; fv <= 7; fv++) { @@ -210,8 +210,8 @@ void Timeout::one_tick() { } } } - _vm->_gyro.roomtime += 1; /* Cycles since you've been in this room. */ - _vm->_gyro.dna.total_time += 1; /* Total amount of time for this game. */ + _vm->_gyro->roomtime += 1; /* Cycles since you've been in this room. */ + _vm->_gyro->dna.total_time += 1; /* Total amount of time for this game. */ } void Timeout::lose_timer(byte which) { @@ -240,11 +240,11 @@ end;*/ /* Timeout procedures: */ void Timeout::open_drawbridge() { - _vm->_gyro.dna.drawbridge_open++; - _vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1); + _vm->_gyro->dna.drawbridge_open++; + _vm->_celer.show_one(_vm->_gyro->dna.drawbridge_open - 1); - if (_vm->_gyro.dna.drawbridge_open == 4) - _vm->_gyro.magics[2].op = _vm->_gyro.nix; /* You may enter the drawbridge. */ + if (_vm->_gyro->dna.drawbridge_open == 4) + _vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */ else set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls); } @@ -252,10 +252,10 @@ void Timeout::open_drawbridge() { /* --- */ void Timeout::avaricius_talks() { - _vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk); - _vm->_gyro.dna.avaricius_talk++; + _vm->_visa.dixi('q', _vm->_gyro->dna.avaricius_talk); + _vm->_gyro->dna.avaricius_talk++; - if (_vm->_gyro.dna.avaricius_talk < 17) + if (_vm->_gyro->dna.avaricius_talk < 17) set_up_timer(177, procavaricius_talks, reason_avariciustalks); else _vm->_lucerna.points(3); @@ -282,25 +282,25 @@ void Timeout::bang2() { } void Timeout::stairs() { - _vm->_gyro.blip(); + _vm->_gyro->blip(); _vm->_trip.tr[0].walkto(4); _vm->_celer.show_one(2); - _vm->_gyro.dna.brummie_stairs = 2; - _vm->_gyro.magics[11].op = _vm->_gyro.special; - _vm->_gyro.magics[11].data = 2; /* Reached the bottom of the stairs. */ - _vm->_gyro.magics[4].op = _vm->_gyro.nix; /* Stop them hitting the sides (or the game will hang.) */ + _vm->_gyro->dna.brummie_stairs = 2; + _vm->_gyro->magics[11].op = _vm->_gyro->special; + _vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */ + _vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */ } void Timeout::cardiff_survey() { - switch (_vm->_gyro.dna.cardiff_things) { + switch (_vm->_gyro->dna.cardiff_things) { case 0: - _vm->_gyro.dna.cardiff_things += 1; + _vm->_gyro->dna.cardiff_things += 1; _vm->_visa.dixi('q', 27); break; } - _vm->_visa.dixi('z', _vm->_gyro.dna.cardiff_things); + _vm->_visa.dixi('z', _vm->_gyro->dna.cardiff_things); - _vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things; + _vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things; set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey); } @@ -315,8 +315,8 @@ void Timeout::cwytalot_in_herts() { void Timeout::get_tied_up() { _vm->_visa.dixi('q', 34); /* ...Trouble! */ - _vm->_gyro.dna.user_moves_avvy = false; - _vm->_gyro.dna.been_tied_up = true; + _vm->_gyro->dna.user_moves_avvy = false; + _vm->_gyro->dna.been_tied_up = true; _vm->_trip.stopwalking(); _vm->_trip.tr[2].stopwalk(); _vm->_trip.tr[2].stophoming(); @@ -328,14 +328,14 @@ void Timeout::get_tied_up() { void Timeout::get_tied_up2() { _vm->_trip.tr[1].walkto(4); _vm->_trip.tr[2].walkto(5); - _vm->_gyro.magics[4].op = _vm->_gyro.nix; /* No effect when you touch the boundaries. */ - _vm->_gyro.dna.friar_will_tie_you_up = true; + _vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */ + _vm->_gyro->dna.friar_will_tie_you_up = true; } void Timeout::hang_around() { _vm->_trip.tr[2].check_me = false; _vm->_trip.tr[1].init(7, true, &_vm->_trip); /* Robin Hood */ - _vm->_gyro.whereis[_vm->_gyro.probinhood] = r__robins; + _vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins; _vm->_trip.apped(1, 2); _vm->_visa.dixi('q', 39); _vm->_trip.tr[1].walkto(7); @@ -346,7 +346,7 @@ void Timeout::hang_around2() { _vm->_visa.dixi('q', 40); _vm->_trip.tr[2].vanishifstill = false; _vm->_trip.tr[2].walkto(4); - _vm->_gyro.whereis[_vm->_gyro.pfriartuck] = r__robins; + _vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins; _vm->_visa.dixi('q', 41); _vm->_trip.tr[1].done(); _vm->_trip.tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */ @@ -354,7 +354,7 @@ void Timeout::hang_around2() { set_up_timer(1, procafter_the_shootemup, reason_hanging_around); /* Immediately call the following proc (when you have a chance). */ - _vm->_gyro.dna.tied_up = false; + _vm->_gyro->dna.tied_up = false; _vm->_enid.back_to_bootstrap(1); /* Call the shoot-'em-up. */ } @@ -364,9 +364,9 @@ void Timeout::after_the_shootemup() { } void Timeout::jacques_wakes_up() { - _vm->_gyro.dna.jacques_awake += 1; + _vm->_gyro->dna.jacques_awake += 1; - switch (_vm->_gyro.dna.jacques_awake) { /* Additional pictures. */ + switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */ case 1 : _vm->_celer.show_one(1); /* Eyes open. */ _vm->_visa.dixi('Q', 45); @@ -374,23 +374,23 @@ void Timeout::jacques_wakes_up() { case 2 : /* Going through the door. */ _vm->_celer.show_one(2); /* Not on the floor. */ _vm->_celer.show_one(3); /* But going through the door. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* You can't wake him up now. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */ break; case 3 : /* Gone through the door. */ _vm->_celer.show_one(2); /* Not on the floor, either. */ _vm->_celer.show_one(4); /* He's gone... so the door's open. */ - _vm->_gyro.whereis[_vm->_gyro.pjacques] = 0; /* Gone! */ + _vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */ break; } - if (_vm->_gyro.dna.jacques_awake == 5) { - _vm->_gyro.dna.ringing_bells = true; - _vm->_gyro.dna.ayles_is_awake = true; + if (_vm->_gyro->dna.jacques_awake == 5) { + _vm->_gyro->dna.ringing_bells = true; + _vm->_gyro->dna.ayles_is_awake = true; _vm->_lucerna.points(2); } - switch (_vm->_gyro.dna.jacques_awake) { + switch (_vm->_gyro->dna.jacques_awake) { case 1: case 2: case 3: @@ -431,7 +431,7 @@ void Timeout::naughty_duke3() { } void Timeout::jump() { - dnatype &with = _vm->_gyro.dna; + dnatype &with = _vm->_gyro->dna; with.jumpstatus += 1; @@ -457,24 +457,24 @@ void Timeout::jump() { if (with.jumpstatus == 20) { /* End of jump. */ - _vm->_gyro.dna.user_moves_avvy = true; - _vm->_gyro.dna.jumpstatus = 0; + _vm->_gyro->dna.user_moves_avvy = true; + _vm->_gyro->dna.jumpstatus = 0; } else { /* Still jumping. */ set_up_timer(1, procjump, reason_jumping); } if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */ - && (_vm->_gyro.dna.room == r__insidecardiffcastle) - && (_vm->_gyro.dna.arrow_in_the_door == true) + && (_vm->_gyro->dna.room == r__insidecardiffcastle) + && (_vm->_gyro->dna.arrow_in_the_door == true) && (_vm->_trip.infield(3))) { /* beside the wall*/ /* Grab the arrow! */ - if (_vm->_gyro.dna.carrying >= maxobjs) + if (_vm->_gyro->dna.carrying >= maxobjs) _vm->_scrolls.display("You fail to grab it, because your hands are full."); else { _vm->_celer.show_one(2); - _vm->_gyro.dna.arrow_in_the_door = false; /* You've got it. */ - _vm->_gyro.dna.obj[_vm->_gyro.bolt] = true; + _vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */ + _vm->_gyro->dna.obj[_vm->_gyro->bolt] = true; _vm->_lucerna.objectlist(); _vm->_visa.dixi('q', 50); _vm->_lucerna.points(3); @@ -484,32 +484,32 @@ void Timeout::jump() { void Timeout::crapulus_says_splud_out() { _vm->_visa.dixi('q', 56); - _vm->_gyro.dna.crapulus_will_tell = false; + _vm->_gyro->dna.crapulus_will_tell = false; } void Timeout::buydrinks() { _vm->_celer.show_one(11); /* Malagauche gets up again. */ - _vm->_gyro.dna.malagauche = 0; + _vm->_gyro->dna.malagauche = 0; - _vm->_visa.dixi('D', _vm->_gyro.dna.drinking); /* _vm->_scrolls.display message about it. */ + _vm->_visa.dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls.display message about it. */ _vm->_pingo.wobble(); /* Do the special effects. */ _vm->_visa.dixi('D', 1); /* That'll be thruppence. */ - if (_vm->_gyro.pennycheck(3)) /* Pay 3d. */ + if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */ _vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */ _vm->_acci.have_a_drink(); } void Timeout::buywine() { _vm->_celer.show_one(11); /* Malagauche gets up again. */ - _vm->_gyro.dna.malagauche = 0; + _vm->_gyro->dna.malagauche = 0; _vm->_visa.dixi('D', 50); /* You buy the wine. */ _vm->_visa.dixi('D', 1); /* It'll be thruppence. */ - if (_vm->_gyro.pennycheck(3)) { + if (_vm->_gyro->pennycheck(3)) { _vm->_visa.dixi('D', 4); /* You paid up. */ - _vm->_gyro.dna.obj[_vm->_gyro.wine] = true; + _vm->_gyro->dna.obj[_vm->_gyro->wine] = true; _vm->_lucerna.objectlist(); - _vm->_gyro.dna.winestate = 1; /* OK Wine */ + _vm->_gyro->dna.winestate = 1; /* OK Wine */ } } @@ -520,23 +520,23 @@ void Timeout::callsguards() { void Timeout::greetsmonk() { _vm->_visa.dixi('Q', 59); - _vm->_gyro.dna.entered_lusties_room_as_monk = true; + _vm->_gyro->dna.entered_lusties_room_as_monk = true; } void Timeout::fall_down_oubliette() { - _vm->_gyro.magics[9].op = _vm->_gyro.nix; + _vm->_gyro->magics[9].op = _vm->_gyro->nix; _vm->_trip.tr[1].iy += 1; /* increments dx/dy! */ _vm->_trip.tr[1].y += _vm->_trip.tr[1].iy; /* Dowwwn we go... */ set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette); } void Timeout::meet_avaroid() { - if (_vm->_gyro.dna.met_avaroid) { + if (_vm->_gyro->dna.met_avaroid) { _vm->_scrolls.display("You can't expect to be \6that\22 lucky twice in a row!"); _vm->_lucerna.gameover(); } else { _vm->_visa.dixi('Q', 60); - _vm->_gyro.dna.met_avaroid = true; + _vm->_gyro->dna.met_avaroid = true; set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette); triptype &with = _vm->_trip.tr[1]; @@ -545,7 +545,7 @@ void Timeout::meet_avaroid() { with.ix = -3; with.iy = -5; - _vm->_gyro.background(2); + _vm->_gyro->background(2); } } @@ -558,7 +558,7 @@ void Timeout::rise_up_oubliette() { if (with.iy > 0) set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette); else - _vm->_gyro.dna.user_moves_avvy = true; + _vm->_gyro->dna.user_moves_avvy = true; } void Timeout::robin_hood_and_geida() { @@ -568,7 +568,7 @@ void Timeout::robin_hood_and_geida() { _vm->_trip.tr[2].stopwalk(); _vm->_trip.tr[2].face = _vm->_trip.left; set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida); - _vm->_gyro.dna.geida_follows = false; + _vm->_gyro->dna.geida_follows = false; } void Timeout::robin_hood_and_geida_talk() { @@ -586,7 +586,7 @@ void Timeout::avalot_returns() { _vm->_trip.tr[1].init(0, true, &_vm->_trip); _vm->_trip.apped(1, 1); _vm->_visa.dixi('q', 67); - _vm->_gyro.dna.user_moves_avvy = true; + _vm->_gyro->dna.user_moves_avvy = true; } void Timeout::avvy_sit_down() { @@ -596,8 +596,8 @@ void Timeout::avvy_sit_down() { set_up_timer(1, procavvy_sit_down, reason_sitting_down); else { _vm->_celer.show_one(3); - _vm->_gyro.dna.sitting_in_pub = true; - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.sitting_in_pub = true; + _vm->_gyro->dna.user_moves_avvy = false; _vm->_trip.tr[1].visible = false; } } @@ -607,7 +607,7 @@ void Timeout::ghost_room_phew() { } void Timeout::arkata_shouts() { - if (_vm->_gyro.dna.teetotal) + if (_vm->_gyro->dna.teetotal) return; _vm->_visa.dixi('q', 76); @@ -620,10 +620,10 @@ void Timeout::winning() { do { _vm->_lucerna.checkclick(); - } while (!(_vm->_gyro.mrelease == 0)); + } while (!(_vm->_gyro->mrelease == 0)); _vm->_lucerna.callverb(_vm->_acci.vb_score); _vm->_scrolls.display(" T H E E N D "); - _vm->_gyro.lmo = true; + _vm->_gyro->lmo = true; } void Timeout::avalot_falls() { @@ -648,7 +648,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->_gyro.dna.lustie_is_asleep = true; + _vm->_gyro->dna.lustie_is_asleep = true; _vm->_sequence.first_show(5); _vm->_sequence.then_show(6); /* He falls asleep... */ _vm->_sequence.start_to_close(); /* Not really closing, but we're using the same procedure. */ diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index f9e8faa1e2..00fac658ab 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -166,8 +166,8 @@ void triptype::turn(byte whichway) { void triptype::appear(int16 wx, int16 wy, byte wf) { x = (wx / 8) * 8; y = wy; - ox[_tr->_vm->_gyro.cp] = wx; - oy[_tr->_vm->_gyro.cp] = wy; + ox[_tr->_vm->_gyro->cp] = wx; + oy[_tr->_vm->_gyro->cp] = wy; turn(wf); visible = true; ix = 0; @@ -199,12 +199,12 @@ void triptype::walk() { r.x2 = ((x + _info.xl) / 8) + 1; r.y2 = y + _info.yl + 2; } - _tr->getset[1 - _tr->_vm->_gyro.cp].remember(r); + _tr->getset[1 - _tr->_vm->_gyro->cp].remember(r); } - if (!_tr->_vm->_gyro.doing_sprite_run) { - ox[_tr->_vm->_gyro.cp] = x; - oy[_tr->_vm->_gyro.cp] = y; + if (!_tr->_vm->_gyro->doing_sprite_run) { + ox[_tr->_vm->_gyro->cp] = x; + oy[_tr->_vm->_gyro->cp] = y; if (homing) homestep(); x = x + ix; y = y + iy; @@ -216,38 +216,38 @@ void triptype::walk() { return; } - tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro.cp], y, _info.yl); + tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl); - if ((tc != 0) & (!_tr->_vm->_gyro.doing_sprite_run)) { - switch (_tr->_vm->_gyro.magics[tc].op) { - case _tr->_vm->_gyro.exclaim: { + if ((tc != 0) & (!_tr->_vm->_gyro->doing_sprite_run)) { + switch (_tr->_vm->_gyro->magics[tc].op) { + case _tr->_vm->_gyro->exclaim: { bounce(); _tr->mustexclaim = true; - _tr->saywhat = _tr->_vm->_gyro.magics[tc].data; + _tr->saywhat = _tr->_vm->_gyro->magics[tc].data; } break; - case _tr->_vm->_gyro.bounces: + case _tr->_vm->_gyro->bounces: bounce(); break; - case _tr->_vm->_gyro.transport: - _tr->fliproom(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff); + case _tr->_vm->_gyro->transport: + _tr->fliproom(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff); break; - case _tr->_vm->_gyro.unfinished: { + case _tr->_vm->_gyro->unfinished: { bounce(); _tr->_vm->_scrolls.display("\7Sorry.\3\rThis place is not available yet!"); } break; - case _tr->_vm->_gyro.special: - _tr->call_special(_tr->_vm->_gyro.magics[tc].data); + case _tr->_vm->_gyro->special: + _tr->call_special(_tr->_vm->_gyro->magics[tc].data); break; - case _tr->_vm->_gyro.mopendoor: - _tr->open_the_door(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff, tc); + case _tr->_vm->_gyro->mopendoor: + _tr->open_the_door(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff, tc); break; } } } - if (!_tr->_vm->_gyro.doing_sprite_run) { + if (!_tr->_vm->_gyro->doing_sprite_run) { count += 1; if (((ix != 0) || (iy != 0)) && (count > 1)) { step += 1; @@ -258,15 +258,15 @@ void triptype::walk() { } void triptype::bounce() { - x = ox[_tr->_vm->_gyro.cp]; - y = oy[_tr->_vm->_gyro.cp]; + x = ox[_tr->_vm->_gyro->cp]; + y = oy[_tr->_vm->_gyro->cp]; if (check_me) _tr->stopwalking(); else stopwalk(); - _tr->_vm->_gyro.oncandopageswap = false; + _tr->_vm->_gyro->oncandopageswap = false; _tr->_vm->_lucerna.showrw(); - _tr->_vm->_gyro.oncandopageswap = true; + _tr->_vm->_gyro->oncandopageswap = true; } int8 triptype::sgn(int16 x) { @@ -281,9 +281,9 @@ int8 triptype::sgn(int16 x) { } void triptype::walkto(byte pednum) { - speed(sgn(_tr->_vm->_gyro.peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro.peds[pednum].y - y)); - hx = _tr->_vm->_gyro.peds[pednum].x - _info.xl / 2; - hy = _tr->_vm->_gyro.peds[pednum].y - _info.yl; + speed(sgn(_tr->_vm->_gyro->peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro->peds[pednum].y - y)); + hx = _tr->_vm->_gyro->peds[pednum].x - _info.xl / 2; + hy = _tr->_vm->_gyro->peds[pednum].y - _info.yl; homing = true; } @@ -347,10 +347,10 @@ void triptype::stopwalk() { } void triptype::chatter() { - _tr->_vm->_gyro.talkx = x + _info.xl / 2; - _tr->_vm->_gyro.talky = y; - _tr->_vm->_gyro.talkf = a.fgc; - _tr->_vm->_gyro.talkb = a.bgc; + _tr->_vm->_gyro->talkx = x + _info.xl / 2; + _tr->_vm->_gyro->talky = y; + _tr->_vm->_gyro->talkf = a.fgc; + _tr->_vm->_gyro->talkb = a.bgc; } void triptype::set_up_saver(trip_saver_type &v) { @@ -535,8 +535,8 @@ void Trip::catamove(byte ped) { - xy_uint16 = _vm->_gyro.dna.cat_x + _vm->_gyro.dna.cat_y * 256; - _vm->_gyro.dna.geida_spin = 0; + xy_uint16 = _vm->_gyro->dna.cat_x + _vm->_gyro->dna.cat_y * 256; + _vm->_gyro->dna.geida_spin = 0; switch (xy_uint16) { case 1801: /* Exit catacombs */ @@ -553,78 +553,78 @@ void Trip::catamove(byte ped) { case 2307: fliproom(r__lusties, 5); _vm->_scrolls.display("Oh no... here we go again..."); - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.user_moves_avvy = false; tr[1].iy = 1; tr[1].ix = 0; return; } - if (!_vm->_gyro.dna.enter_catacombs_from_lusties_room) + if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room) _vm->_lucerna.load(29); - here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x]; + here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x]; switch (here & 0xf) { /* West. */ case 0: /* no connection (wall) */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(28); break; case 0x1: /* no connection (wall + shield), */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(29); /* ...shield. */ break; case 0x2: /* wall with door */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(30); /* ...door. */ break; case 0x3: /* wall with door and shield */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(30); /* ...door, and... */ _vm->_celer.show_one(29); /* ...shield. */ break; case 0x4: /* no connection (wall + window), */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(5); /* ...window. */ break; case 0x5: /* wall with door and window */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(30); /* ...door, and... */ _vm->_celer.show_one(5); /* ...window. */ break; case 0x6: /* no connection (wall + torches), */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.nix; /* No door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->nix; /* No door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(7); /* ...torches. */ break; case 0x7: /* wall with door and torches */ - _vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(28); /* Wall, plus... */ _vm->_celer.show_one(30); /* ...door, and... */ _vm->_celer.show_one(7); /* ...torches. */ break; case 0xf: /* straight-through corridor. */ - _vm->_gyro.magics[2].op = _vm->_gyro.nix; /* Sloping wall. */ - _vm->_gyro.magics[3].op = _vm->_gyro.special; /* Straight wall. */ + _vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Sloping wall. */ + _vm->_gyro->magics[3].op = _vm->_gyro->special; /* Straight wall. */ break; } @@ -632,52 +632,52 @@ void Trip::catamove(byte ped) { switch ((here & 0xf0) >> 4) { /* East */ case 0: /* no connection (wall) */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(19); break; case 0x1: /* no connection (wall + window), */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(19); /* Wall, plus... */ _vm->_celer.show_one(20); /* ...window. */ break; case 0x2: /* wall with door */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(19); /* Wall, plus... */ _vm->_celer.show_one(21); /* ...door. */ break; case 0x3: /* wall with door and window */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(19); /* Wall, plus... */ _vm->_celer.show_one(20); /* ...door, and... */ _vm->_celer.show_one(21); /* ...window. */ break; case 0x6: /* no connection (wall + torches), */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.nix; /* No door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->nix; /* No door. */ _vm->_celer.show_one(19); /* Wall, plus... */ _vm->_celer.show_one(18); /* ...torches. */ break; case 0x7: /* wall with door and torches */ - _vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */ _vm->_celer.show_one(19); /* Wall, plus... */ _vm->_celer.show_one(21); /* ...door, and... */ _vm->_celer.show_one(18); /* ...torches. */ break; case 0xf: /* straight-through corridor. */ - _vm->_gyro.magics[5].op = _vm->_gyro.nix; /* Sloping wall. */ - _vm->_gyro.magics[6].op = _vm->_gyro.special; /* Straight wall. */ - _vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Sloping wall. */ + _vm->_gyro->magics[6].op = _vm->_gyro->special; /* Straight wall. */ + _vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */ break; } @@ -685,75 +685,75 @@ void Trip::catamove(byte ped) { switch ((here & 0xf00) >> 8) { /* South */ case 0: /* No connection. */ - _vm->_gyro.magics[7].op = _vm->_gyro.bounces; - _vm->_gyro.magics[12].op = _vm->_gyro.bounces; - _vm->_gyro.magics[13].op = _vm->_gyro.bounces; + _vm->_gyro->magics[7].op = _vm->_gyro->bounces; + _vm->_gyro->magics[12].op = _vm->_gyro->bounces; + _vm->_gyro->magics[13].op = _vm->_gyro->bounces; break; case 0x1: _vm->_celer.show_one(22); - if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows)) - _vm->_gyro.magics[13].op = _vm->_gyro.exclaim; + if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows)) + _vm->_gyro->magics[13].op = _vm->_gyro->exclaim; else - _vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */ + _vm->_gyro->magics[13].op = _vm->_gyro->special; /* Right exit south. */ - _vm->_gyro.magics[7].op = _vm->_gyro.bounces; - _vm->_gyro.magics[12].op = _vm->_gyro.bounces; + _vm->_gyro->magics[7].op = _vm->_gyro->bounces; + _vm->_gyro->magics[12].op = _vm->_gyro->bounces; break; case 0x2: _vm->_celer.show_one(23); - _vm->_gyro.magics[7].op = _vm->_gyro.special; /* Middle exit south. */ - _vm->_gyro.magics[12].op = _vm->_gyro.bounces; - _vm->_gyro.magics[13].op = _vm->_gyro.bounces; + _vm->_gyro->magics[7].op = _vm->_gyro->special; /* Middle exit south. */ + _vm->_gyro->magics[12].op = _vm->_gyro->bounces; + _vm->_gyro->magics[13].op = _vm->_gyro->bounces; break; case 0x3: _vm->_celer.show_one(24); - _vm->_gyro.magics[12].op = _vm->_gyro.special; /* Left exit south. */ - _vm->_gyro.magics[7].op = _vm->_gyro.bounces; - _vm->_gyro.magics[13].op = _vm->_gyro.bounces; + _vm->_gyro->magics[12].op = _vm->_gyro->special; /* Left exit south. */ + _vm->_gyro->magics[7].op = _vm->_gyro->bounces; + _vm->_gyro->magics[13].op = _vm->_gyro->bounces; break; } switch ((here & 0xf000) >> 12) { /* North */ case 0: /* No connection */ - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; - _vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; + _vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */ break; // LEFT handles: /* case 0x1: _vm->_celer.show_one(4); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! } - _vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. } + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! } + _vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. } break; */ case 0x2: _vm->_celer.show_one(4); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; // Middle exit north. - _vm->_gyro.portals[12].op = _vm->_gyro.special; // Door. + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Middle exit north. + _vm->_gyro->portals[12].op = _vm->_gyro->special; // Door. break; /* case 0x3: _vm->_celer.show_one(4); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. } { Change magic number! } - _vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. } + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! } + _vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. } break; // RIGHT handles: case 0x4: _vm->_celer.show_one(3); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! } - _vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. } + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! } + _vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. } break; */ case 0x5: _vm->_celer.show_one(3); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */ - _vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Middle exit north. */ + _vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */ break; /* case 0x6: _vm->_celer.show_one(3); - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. } - _vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. } + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } + _vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. } break; */ // ARCHWAYS: @@ -767,26 +767,26 @@ void Trip::catamove(byte ped) { if (((here & 0xf000) >> 12) == 0x9) _vm->_celer.show_one(32); - _vm->_gyro.magics[1].op = _vm->_gyro.special; /* Middle arch north. */ - _vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[1].op = _vm->_gyro->special; /* Middle arch north. */ + _vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */ } break; /* DECORATIONS: */ case 0xd: /* No connection + WINDOW */ - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; - _vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; + _vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(14); break; case 0xe: /* No connection + TORCH */ - _vm->_gyro.magics[1].op = _vm->_gyro.bounces; - _vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */ + _vm->_gyro->magics[1].op = _vm->_gyro->bounces; + _vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */ _vm->_celer.show_one(8); break; /* Recessed door: */ case 0xf: - _vm->_gyro.magics[1].op = _vm->_gyro.nix; /* Door to Geida's room. */ + _vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Door to Geida's room. */ _vm->_celer.show_one(1); - _vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */ + _vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */ break; } @@ -822,7 +822,7 @@ void Trip::catamove(byte ped) { break; /* [1,1] : the other two. */ } - if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) { + if ((_vm->_gyro->dna.geida_follows) & (ped > 0)) { triptype &with = tr[2]; if (!with.quick) /* If we don't already have her... */ @@ -835,36 +835,36 @@ void Trip::catamove(byte ped) { -/* This proc gets called whenever you touch a line defined as _vm->_gyro.special. */ +/* This proc gets called whenever you touch a line defined as _vm->_gyro->special. */ void Trip::dawndelay() { _vm->_timeout.set_up_timer(2, _vm->_timeout.procdawn_delay, _vm->_timeout.reason_dawndelay); } void Trip::call_special(uint16 which) { switch (which) { - case 1: /* _vm->_gyro.special 1: Room 22: top of stairs. */ + case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */ _vm->_celer.show_one(1); - _vm->_gyro.dna.brummie_stairs = 1; - _vm->_gyro.magics[10].op = _vm->_gyro.nix; + _vm->_gyro->dna.brummie_stairs = 1; + _vm->_gyro->magics[10].op = _vm->_gyro->nix; _vm->_timeout.set_up_timer(10, _vm->_timeout.procstairs, _vm->_timeout.reason_brummiestairs); stopwalking(); - _vm->_gyro.dna.user_moves_avvy = false; - break; - case 2: /* _vm->_gyro.special 2: Room 22: bottom of stairs. */ - _vm->_gyro.dna.brummie_stairs = 3; - _vm->_gyro.magics[11].op = _vm->_gyro.nix; - _vm->_gyro.magics[12].op = _vm->_gyro.exclaim; - _vm->_gyro.magics[12].data = 5; - _vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Now works as planned! */ + _vm->_gyro->dna.user_moves_avvy = false; + break; + case 2: /* _vm->_gyro->special 2: Room 22: bottom of stairs. */ + _vm->_gyro->dna.brummie_stairs = 3; + _vm->_gyro->magics[11].op = _vm->_gyro->nix; + _vm->_gyro->magics[12].op = _vm->_gyro->exclaim; + _vm->_gyro->magics[12].data = 5; + _vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Now works as planned! */ stopwalking(); _vm->_visa.dixi('q', 26); - _vm->_gyro.dna.user_moves_avvy = true; + _vm->_gyro->dna.user_moves_avvy = true; break; - case 3: /* _vm->_gyro.special 3: Room 71: triggers dart. */ + case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */ tr[1].bounce(); /* Must include that. */ - if (!_vm->_gyro.dna.arrow_triggered) { - _vm->_gyro.dna.arrow_triggered = true; + if (!_vm->_gyro->dna.arrow_triggered) { + _vm->_gyro->dna.arrow_triggered = true; apped(2, 4); /* The dart starts at ped 4, and... */ tr[2].walkto(5); /* flies to ped 5. */ tr[2].face = 0; /* Only face. */ @@ -883,33 +883,33 @@ void Trip::call_special(uint16 which) { _vm->_enid.back_to_bootstrap(3); break; case 5: - if (_vm->_gyro.dna.friar_will_tie_you_up) { - /* _vm->_gyro.special 5: Room 42: touched tree, and get tied up. */ - _vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Boundary effect is now working again. */ + if (_vm->_gyro->dna.friar_will_tie_you_up) { + /* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */ + _vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */ _vm->_visa.dixi('q', 35); tr[1].done(); /*tr[1].vanishifstill:=true;*/ _vm->_celer.show_one(2); _vm->_visa.dixi('q', 36); - _vm->_gyro.dna.tied_up = true; - _vm->_gyro.dna.friar_will_tie_you_up = false; + _vm->_gyro->dna.tied_up = true; + _vm->_gyro->dna.friar_will_tie_you_up = false; tr[2].walkto(3); tr[2].vanishifstill = true; tr[2].check_me = true; /* One of them must have Check_Me switched on. */ - _vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 177; /* Not here, then. */ + _vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 177; /* Not here, then. */ _vm->_timeout.set_up_timer(364, _vm->_timeout.prochang_around, _vm->_timeout.reason_hanging_around); } break; - case 6: /* _vm->_gyro.special 6: fall down oubliette. */ - _vm->_gyro.dna.user_moves_avvy = false; + case 6: /* _vm->_gyro->special 6: fall down oubliette. */ + _vm->_gyro->dna.user_moves_avvy = false; tr[1].ix = 3; tr[1].iy = 0; tr[1].face = right; _vm->_timeout.set_up_timer(1, _vm->_timeout.procfall_down_oubliette, _vm->_timeout.reason_falling_down_oubliette); break; - case 7: /* _vm->_gyro.special 7: stop falling down oubliette. */ + case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */ tr[1].visible = false; - _vm->_gyro.magics[10].op = _vm->_gyro.nix; + _vm->_gyro->magics[10].op = _vm->_gyro->nix; stopwalking(); _vm->_timeout.lose_timer(_vm->_timeout.reason_falling_down_oubliette); _vm->_lucerna.mblit(12, 80, 38, 160, 3, 0); @@ -917,8 +917,8 @@ void Trip::call_special(uint16 which) { _vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette."); _vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid); break; - case 8: /* _vm->_gyro.special 8: leave du Lustie's room. */ - if ((_vm->_gyro.dna.geida_follows) && (!_vm->_gyro.dna.lustie_is_asleep)) { + case 8: /* _vm->_gyro->special 8: leave du Lustie's room. */ + if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) { _vm->_visa.dixi('q', 63); tr[2].turn(down); tr[2].stopwalk(); @@ -926,19 +926,19 @@ void Trip::call_special(uint16 which) { _vm->_lucerna.gameover(); } break; - case 9: /* _vm->_gyro.special 9: lose Geida to Robin Hood... */ - if (!_vm->_gyro.dna.geida_follows) + case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */ + if (!_vm->_gyro->dna.geida_follows) return; /* DOESN'T COUNT: no Geida. */ tr[2].call_eachstep = false; /* She no longer follows Avvy around. */ tr[2].walkto(4); /* She walks to somewhere... */ tr[1].done(); /* Lose Avvy. */ - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.user_moves_avvy = false; _vm->_timeout.set_up_timer(40, _vm->_timeout.procrobin_hood_and_geida, _vm->_timeout.reason_robin_hood_and_geida); break; - case 10: /* _vm->_gyro.special 10: transfer north in catacombs. */ - if ((_vm->_gyro.dna.cat_x == 4) && (_vm->_gyro.dna.cat_y == 1)) { + case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */ + if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) { /* Into Geida's room. */ - if (_vm->_gyro.dna.obj[_vm->_gyro.key]) + if (_vm->_gyro->dna.obj[_vm->_gyro->key]) _vm->_visa.dixi('q', 62); else { _vm->_visa.dixi('q', 61); @@ -946,12 +946,12 @@ void Trip::call_special(uint16 which) { } } _vm->_lucerna.dusk(); - _vm->_gyro.dna.cat_y -= 1; + _vm->_gyro->dna.cat_y -= 1; catamove(4); - if (_vm->_gyro.dna.room != r__catacombs) + if (_vm->_gyro->dna.room != r__catacombs) return; _vm->_lucerna.delavvy(); - switch ((_vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x] & 0xf00) >> 8) { + switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x] & 0xf00) >> 8) { case 0x1: apped(1, 12); break; @@ -964,33 +964,33 @@ void Trip::call_special(uint16 which) { getback(); dawndelay(); break; - case 11: /* _vm->_gyro.special 11: transfer east in catacombs. */ + case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */ _vm->_lucerna.dusk(); - _vm->_gyro.dna.cat_x += 1; + _vm->_gyro->dna.cat_x += 1; catamove(1); - if (_vm->_gyro.dna.room != r__catacombs) + if (_vm->_gyro->dna.room != r__catacombs) return; _vm->_lucerna.delavvy(); apped(1, 1); getback(); dawndelay(); break; - case 12: /* _vm->_gyro.special 12: transfer south in catacombs. */ + case 12: /* _vm->_gyro->special 12: transfer south in catacombs. */ _vm->_lucerna.dusk(); - _vm->_gyro.dna.cat_y += 1; + _vm->_gyro->dna.cat_y += 1; catamove(2); - if (_vm->_gyro.dna.room != r__catacombs) + if (_vm->_gyro->dna.room != r__catacombs) return; _vm->_lucerna.delavvy(); apped(1, 2); getback(); dawndelay(); break; - case 13: /* _vm->_gyro.special 13: transfer west in catacombs. */ + case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */ _vm->_lucerna.dusk(); - _vm->_gyro.dna.cat_x -= 1; + _vm->_gyro->dna.cat_x -= 1; catamove(3); - if (_vm->_gyro.dna.room != r__catacombs) + if (_vm->_gyro->dna.room != r__catacombs) return; _vm->_lucerna.delavvy(); apped(1, 3); @@ -1006,7 +1006,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) { /* This slides the door open. (The data really ought to be saved in the Also file, and will be next time. However, for now, they're here.) */ - switch (_vm->_gyro.dna.room) { + switch (_vm->_gyro->dna.room) { case r__outsideyours: case r__outsidenottspub: case r__outsideducks: @@ -1032,7 +1032,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) { case r__lusties: switch (magicnum) { case 14: - if (_vm->_gyro.dna.avvys_in_the_cupboard) { + if (_vm->_gyro->dna.avvys_in_the_cupboard) { hide_in_the_cupboard(); _vm->_sequence.first_show(8); _vm->_sequence.then_show(7); @@ -1094,8 +1094,8 @@ void Trip::rwsp(byte t, byte r) { } void Trip::apped(byte trn, byte np) { - tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro.peds[np].dir); - rwsp(trn, _vm->_gyro.peds[np].dir); + tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir); + rwsp(trn, _vm->_gyro->peds[np].dir); } @@ -1104,12 +1104,12 @@ void Trip::apped(byte trn, byte np) { begin { By De Morgan's law: } overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1); end;*/ -/* x1,x2 - as _vm->_gyro.bytefield, but *8. y1,y2 - as _vm->_gyro.bytefield. +/* x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield. x3,y3 = mx,my. x4,y4 = mx+16,my+16. */ bool Trip::overlaps_with_mouse() { bool overlaps_with_mouse_result; overlaps_with_mouse_result = - (r.x2 * 8 >= _vm->_gyro.mx) && (_vm->_gyro.mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro.my) && (_vm->_gyro.my + 16 >= r.y1); + (r.x2 * 8 >= _vm->_gyro->mx) && (_vm->_gyro->mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro->my) && (_vm->_gyro->my + 16 >= r.y1); return overlaps_with_mouse_result; } @@ -1121,8 +1121,8 @@ void Trip::getback() { endangered = false; /* Super_Off;*/ - while (getset[1 - _vm->_gyro.cp].numleft > 0) { - getset[1 - _vm->_gyro.cp].recall(r); + while (getset[1 - _vm->_gyro->cp].numleft > 0) { + getset[1 - _vm->_gyro->cp].recall(r); /* if overlaps_with_mouse and not endangered then @@ -1133,7 +1133,7 @@ void Trip::getback() { end; */ - _vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp); + _vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp); } _vm->_lucerna.blitfix(); @@ -1213,13 +1213,13 @@ void Trip::arrow_procs(byte tripnum) { _vm->_lucerna.gameover(); - _vm->_gyro.dna.user_moves_avvy = false; /* Stop the user from moving him. */ + _vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */ _vm->_timeout.set_up_timer(55, _vm->_timeout.procnaughty_duke, _vm->_timeout.reason_naughty_duke); } } else { /* Arrow has hit the wall! */ tr[tripnum].done(); /* Deallocate the arrow. */ _vm->_celer.show_one(3); /* Show pic of arrow stuck into the door. */ - _vm->_gyro.dna.arrow_in_the_door = true; /* So that we can pick it up. */ + _vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */ } } @@ -1230,7 +1230,7 @@ begin with tr[tripnum] do if not homing then { We only need to do anything if Spludwick *stops* walking. } - with _vm->_gyro.dna do + with _vm->_gyro->dna do begin inc(DogfoodPos); if DogfoodPos=8 then DogfoodPos:=1; @@ -1279,21 +1279,21 @@ void Trip::spin(byte whichway, byte &tripnum) { if (tr[tripnum].whichsprite == 2) return; /* Not for Spludwick */ - _vm->_gyro.dna.geida_spin += 1; - _vm->_gyro.dna.geida_time = 20; - if (_vm->_gyro.dna.geida_spin == 5) { + _vm->_gyro->dna.geida_spin += 1; + _vm->_gyro->dna.geida_time = 20; + if (_vm->_gyro->dna.geida_spin == 5) { _vm->_scrolls.display("Steady on, Avvy, you'll make the poor girl dizzy!"); - _vm->_gyro.dna.geida_spin = 0; - _vm->_gyro.dna.geida_time = 0; /* knock out records */ + _vm->_gyro->dna.geida_spin = 0; + _vm->_gyro->dna.geida_time = 0; /* knock out records */ } } } void Trip::geida_procs(byte tripnum) { - if (_vm->_gyro.dna.geida_time > 0) { - _vm->_gyro.dna.geida_time -= 1; - if (_vm->_gyro.dna.geida_time == 0) - _vm->_gyro.dna.geida_spin = 0; + if (_vm->_gyro->dna.geida_time > 0) { + _vm->_gyro->dna.geida_time -= 1; + if (_vm->_gyro->dna.geida_time == 0) + _vm->_gyro->dna.geida_spin = 0; } if (tr[tripnum].y < (tr[1].y - 2)) { @@ -1363,7 +1363,7 @@ void Trip::call_andexors() { void Trip::trippancy_link() { byte fv; - if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll) + if (_vm->_gyro->ddmnow | _vm->_gyro->ontoolbar | _vm->_gyro->seescroll) return; for (fv = 1; fv <= numtr; fv++) { if (tr[fv].quick) @@ -1418,71 +1418,71 @@ void Trip::get_back_loretta() { void Trip::stopwalking() { tr[1].stopwalk(); - _vm->_gyro.dna.rw = stopped; - if (_vm->_gyro.alive) + _vm->_gyro->dna.rw = stopped; + if (_vm->_gyro->alive) tr[1].step = 1; } void Trip::tripkey(char dir) { - if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy)) + if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy)) return; triptype &with = tr[1]; switch (dir) { case 'H': - if (_vm->_gyro.dna.rw != up) { - _vm->_gyro.dna.rw = up; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != up) { + _vm->_gyro->dna.rw = up; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'P': - if (_vm->_gyro.dna.rw != down) { - _vm->_gyro.dna.rw = down; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != down) { + _vm->_gyro->dna.rw = down; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'K': - if (_vm->_gyro.dna.rw != left) { - _vm->_gyro.dna.rw = left; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != left) { + _vm->_gyro->dna.rw = left; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'M': - if (_vm->_gyro.dna.rw != right) { - _vm->_gyro.dna.rw = right; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != right) { + _vm->_gyro->dna.rw = right; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'I': - if (_vm->_gyro.dna.rw != ur) { - _vm->_gyro.dna.rw = ur; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != ur) { + _vm->_gyro->dna.rw = ur; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'Q': - if (_vm->_gyro.dna.rw != dr) { - _vm->_gyro.dna.rw = dr; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != dr) { + _vm->_gyro->dna.rw = dr; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'O': - if (_vm->_gyro.dna.rw != dl) { - _vm->_gyro.dna.rw = dl; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != dl) { + _vm->_gyro->dna.rw = dl; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; case 'G': - if (_vm->_gyro.dna.rw != ul) { - _vm->_gyro.dna.rw = ul; - rwsp(1, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != ul) { + _vm->_gyro->dna.rw = ul; + rwsp(1, _vm->_gyro->dna.rw); } else stopwalking(); break; @@ -1504,15 +1504,15 @@ void Trip::getsetclear() { void Trip::hide_in_the_cupboard() { const char nowt = 250; /* As in Acci. */ - if (_vm->_gyro.dna.avvys_in_the_cupboard) { - if (_vm->_gyro.dna.wearing == nowt) + if (_vm->_gyro->dna.avvys_in_the_cupboard) { + if (_vm->_gyro->dna.wearing == nowt) _vm->_scrolls.display("\6AVVY!\22 Get dressed first!"); else { tr[1].visible = true; - _vm->_gyro.dna.user_moves_avvy = true; + _vm->_gyro->dna.user_moves_avvy = true; apped(1, 3); /* Walk out of the cupboard. */ _vm->_scrolls.display("You leave the cupboard. Nice to be out of there!"); - _vm->_gyro.dna.avvys_in_the_cupboard = false; + _vm->_gyro->dna.avvys_in_the_cupboard = false; _vm->_sequence.first_show(8); _vm->_sequence.then_show(7); _vm->_sequence.start_to_close(); @@ -1520,11 +1520,11 @@ void Trip::hide_in_the_cupboard() { } else { /* Not hiding in the cupboard */ tr[1].visible = false; - _vm->_gyro.dna.user_moves_avvy = false; + _vm->_gyro->dna.user_moves_avvy = false; _vm->_scrolls.display(Common::String("You walk into the room...\20It seems to be an empty, ") + "but dusty, cupboard. Hmmmm... you leave the door slightly open to " + "avoid suffocation."); - _vm->_gyro.dna.avvys_in_the_cupboard = true; + _vm->_gyro->dna.avvys_in_the_cupboard = true; _vm->_celer.show_one(8); } } @@ -1535,36 +1535,36 @@ void Trip::tidy_up(int16 a, int16 b, int16 c, int16 d) { void Trip::tidy_after_mouse() { tidy_up(beforex, beforey, beforex + 15, beforey + 15); - _vm->_gyro.xycheck(); - tidy_up(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.mx + 15, _vm->_gyro.my + 15); + _vm->_gyro->xycheck(); + tidy_up(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->mx + 15, _vm->_gyro->my + 15); } void Trip::fliproom(byte room, byte ped) { byte fv; - if (!_vm->_gyro.alive) { + if (!_vm->_gyro->alive) { /* You can't leave the room if you're dead. */ tr[1].ix = 0; tr[1].iy = 0; /* Stop him from moving. */ return; } - if ((ped == 177) && (_vm->_gyro.dna.room == r__lusties)) { + if ((ped == 177) && (_vm->_gyro->dna.room == r__lusties)) { hide_in_the_cupboard(); return; } - if ((_vm->_gyro.dna.jumpstatus > 0) && (_vm->_gyro.dna.room == r__insidecardiffcastle)) { + if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) { /* You can't *jump* out of Cardiff Castle! */ tr[1].ix = 0; return; } - _vm->_gyro.xycheck(); - beforex = _vm->_gyro.mx; - beforey = _vm->_gyro.my; + _vm->_gyro->xycheck(); + beforex = _vm->_gyro->mx; + beforey = _vm->_gyro->my; - _vm->_lucerna.exitroom(_vm->_gyro.dna.room); + _vm->_lucerna.exitroom(_vm->_gyro->dna.room); _vm->_lucerna.dusk(); getsetclear(); @@ -1574,18 +1574,18 @@ void Trip::fliproom(byte room, byte ped) { tr[fv].done(); } /* Deallocate sprite */ - if (_vm->_gyro.dna.room == r__lustiesroom) - _vm->_gyro.dna.enter_catacombs_from_lusties_room = true; + if (_vm->_gyro->dna.room == r__lustiesroom) + _vm->_gyro->dna.enter_catacombs_from_lusties_room = true; _vm->_lucerna.enterroom(room, ped); apped(1, ped); - _vm->_gyro.dna.enter_catacombs_from_lusties_room = false; - _vm->_gyro.oldrw = _vm->_gyro.dna.rw; - _vm->_gyro.dna.rw = tr[1].face; + _vm->_gyro->dna.enter_catacombs_from_lusties_room = false; + _vm->_gyro->oldrw = _vm->_gyro->dna.rw; + _vm->_gyro->dna.rw = tr[1].face; _vm->_lucerna.showrw(); for (fv = 0; fv <= 1; fv++) { - _vm->_gyro.cp = 1 - _vm->_gyro.cp; + _vm->_gyro->cp = 1 - _vm->_gyro->cp; getback(); } _vm->_lucerna.dawn(); @@ -1598,8 +1598,8 @@ bool Trip::infield(byte which) { /* returns True if you're within field "which" */ int16 yy = tr[1].y + tr[1]._info.yl; - return (tr[1].x >= _vm->_gyro.fields[which].x1) && (tr[1].x <= _vm->_gyro.fields[which].x2) - && (yy >= _vm->_gyro.fields[which].y1) && (yy <= _vm->_gyro.fields[which].y2); + return (tr[1].x >= _vm->_gyro->fields[which].x1) && (tr[1].x <= _vm->_gyro->fields[which].x2) + && (yy >= _vm->_gyro->fields[which].y1) && (yy <= _vm->_gyro->fields[which].y2); } @@ -1609,7 +1609,7 @@ bool Trip::neardoor() { /* returns True if you're near a door! */ bool nd; bool neardoor_result; - if (_vm->_gyro.numfields < 9) { + if (_vm->_gyro->numfields < 9) { /* there ARE no doors here! */ neardoor_result = false; return neardoor_result; @@ -1619,11 +1619,11 @@ bool Trip::neardoor() { /* returns True if you're near a door! */ uy = tr[1].y + tr[1]._info.yl; nd = false; - for (fv = 9; fv <= _vm->_gyro.numfields; fv++) { - _vm->_gyro.fields[fv]; + for (fv = 9; fv <= _vm->_gyro->numfields; fv++) { + _vm->_gyro->fields[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)) + 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; @@ -1636,65 +1636,65 @@ void Trip::new_game_for_trippancy() { /* Called by gyro.newgame */ void Trip::handleMoveKey(const Common::Event &event) { - //if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy)) + //if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy)) // return; // // We don't mess around with the joystick. switch (event.kbd.keycode) { case Common::KEYCODE_UP: - if (_vm->_gyro.dna.rw != up) { - _vm->_gyro.dna.rw = up; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != up) { + _vm->_gyro->dna.rw = up; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_DOWN: - if (_vm->_gyro.dna.rw != down) { - _vm->_gyro.dna.rw = down; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != down) { + _vm->_gyro->dna.rw = down; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_LEFT: - if (_vm->_gyro.dna.rw != left) { - _vm->_gyro.dna.rw = left; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != left) { + _vm->_gyro->dna.rw = left; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_RIGHT: - if (_vm->_gyro.dna.rw != right) { - _vm->_gyro.dna.rw = right; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != right) { + _vm->_gyro->dna.rw = right; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_PAGEUP: - if (_vm->_gyro.dna.rw != ur) { - _vm->_gyro.dna.rw = ur; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != ur) { + _vm->_gyro->dna.rw = ur; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_PAGEDOWN: - if (_vm->_gyro.dna.rw != dr) { - _vm->_gyro.dna.rw = dr; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != dr) { + _vm->_gyro->dna.rw = dr; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_END: - if (_vm->_gyro.dna.rw != dl) { - _vm->_gyro.dna.rw = dl; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != dl) { + _vm->_gyro->dna.rw = dl; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; case Common::KEYCODE_HOME: - if (_vm->_gyro.dna.rw != ul) { - _vm->_gyro.dna.rw = ul; - rwsp(0, _vm->_gyro.dna.rw); + if (_vm->_gyro->dna.rw != ul) { + _vm->_gyro->dna.rw = ul; + rwsp(0, _vm->_gyro->dna.rw); } else stopwalking(); break; diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index ea5144f2a9..935959533f 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -49,13 +49,13 @@ namespace Avalanche { bool Visa::report_dixi_errors = true; void Visa::unskrimble() { - for (uint16 fv = 0; fv < _vm->_gyro.bufsize; fv++) - _vm->_gyro.buffer[fv] = (char)((!(_vm->_gyro.buffer[fv]) - fv) % 256); + for (uint16 fv = 0; fv < _vm->_gyro->bufsize; fv++) + _vm->_gyro->buffer[fv] = (char)((!(_vm->_gyro->buffer[fv]) - fv) % 256); } void Visa::do_the_bubble() { - _vm->_gyro.bufsize++; - _vm->_gyro.buffer[_vm->_gyro.bufsize] = 2; + _vm->_gyro->bufsize++; + _vm->_gyro->buffer[_vm->_gyro->bufsize] = 2; } void Visa::dixi(char block, byte point) { @@ -85,7 +85,7 @@ namespace Avalanche { if (error) { if (report_dixi_errors) { Common::String todisplay; - todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro.strf(point).c_str()); + todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str()); _vm->_scrolls.display(todisplay); } return; @@ -96,8 +96,8 @@ namespace Avalanche { return; } sezfile.seek(sez_offset); - _vm->_gyro.bufsize = sezfile.readUint16LE(); - sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize); + _vm->_gyro->bufsize = sezfile.readUint16LE(); + sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize); sezfile.close(); unskrimble(); @@ -145,8 +145,8 @@ namespace Avalanche { return; } sezfile.seek(sez_offset); - _vm->_gyro.bufsize = sezfile.readUint16LE(); - sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize); + _vm->_gyro->bufsize = sezfile.readUint16LE(); + sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize); sezfile.close(); unskrimble(); |