diff options
author | uruk | 2013-09-08 00:02:20 +0200 |
---|---|---|
committer | uruk | 2013-09-08 00:02:20 +0200 |
commit | 93013b5c76a0417b5f314f5da1a238b7357bb43f (patch) | |
tree | 12c829991baf0b06d99bb67579cc778bde619af9 | |
parent | e5d014d29d9be2dbe2905b5a11aeffed1516622e (diff) | |
download | scummvm-rg350-93013b5c76a0417b5f314f5da1a238b7357bb43f.tar.gz scummvm-rg350-93013b5c76a0417b5f314f5da1a238b7357bb43f.tar.bz2 scummvm-rg350-93013b5c76a0417b5f314f5da1a238b7357bb43f.zip |
AVALANCHE: Do renaming in Sequence.
-rw-r--r-- | engines/avalanche/acci2.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/animation.cpp | 44 | ||||
-rw-r--r-- | engines/avalanche/avalanche.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.cpp | 60 | ||||
-rw-r--r-- | engines/avalanche/sequence2.cpp | 52 | ||||
-rw-r--r-- | engines/avalanche/sequence2.h | 29 | ||||
-rw-r--r-- | engines/avalanche/timeout2.cpp | 16 |
7 files changed, 99 insertions, 112 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index cf4e20fa55..4938aaa0c2 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1255,10 +1255,10 @@ void Acci::playHarp() { void Acci::winSequence() { _vm->_visa->dixi('q', 78); - _vm->_sequence->first_show(7); - _vm->_sequence->then_show(8); - _vm->_sequence->then_show(9); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(7); + _vm->_sequence->thenShow(8); + _vm->_sequence->thenShow(9); + _vm->_sequence->startToClose(); _vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning); } diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index a4b129b736..c71ecd6b22 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -1012,53 +1012,53 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) { case r__outsideyours: case r__outsidenottspub: case r__outsideducks: - _vm->_sequence->first_show(1); - _vm->_sequence->then_show(2); - _vm->_sequence->then_show(3); + _vm->_sequence->firstShow(1); + _vm->_sequence->thenShow(2); + _vm->_sequence->thenShow(3); break; case r__insidecardiffcastle: - _vm->_sequence->first_show(1); - _vm->_sequence->then_show(5); + _vm->_sequence->firstShow(1); + _vm->_sequence->thenShow(5); break; case r__avvysgarden: case r__entrancehall: case r__insideabbey: case r__yourhall: - _vm->_sequence->first_show(1); - _vm->_sequence->then_show(2); + _vm->_sequence->firstShow(1); + _vm->_sequence->thenShow(2); break; case r__musicroom: case r__outsideargentpub: - _vm->_sequence->first_show(5); - _vm->_sequence->then_show(6); + _vm->_sequence->firstShow(5); + _vm->_sequence->thenShow(6); break; case r__lusties: switch (magicnum) { case 14: if (_vm->_gyro->_dna._avvysInTheCupboard) { hideInCupboard(); - _vm->_sequence->first_show(8); - _vm->_sequence->then_show(7); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(8); + _vm->_sequence->thenShow(7); + _vm->_sequence->startToClose(); return; } else { apped(1, 6); tr[0]._facingDir = kDirRight; // added by TT 12/3/1995 - _vm->_sequence->first_show(8); - _vm->_sequence->then_show(9); + _vm->_sequence->firstShow(8); + _vm->_sequence->thenShow(9); } break; case 12: - _vm->_sequence->first_show(4); - _vm->_sequence->then_show(5); - _vm->_sequence->then_show(6); + _vm->_sequence->firstShow(4); + _vm->_sequence->thenShow(5); + _vm->_sequence->thenShow(6); break; } break; } - _vm->_sequence->then_flip(whither, ped); - _vm->_sequence->start_to_open(); + _vm->_sequence->thenFlip(whither, ped); + _vm->_sequence->startToOpen(); } void Animation::newspeed() { @@ -1463,9 +1463,9 @@ void Animation::hideInCupboard() { apped(1, 3); // Walk out of the cupboard. _vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!"); _vm->_gyro->_dna._avvysInTheCupboard = false; - _vm->_sequence->first_show(8); - _vm->_sequence->then_show(7); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(8); + _vm->_sequence->thenShow(7); + _vm->_sequence->startToClose(); } } else { // Not hiding in the cupboard diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 7462268714..3439165224 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -341,7 +341,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { } //blockwrite(f, seq, sizeof(seq)); // Sequencer information. - sz.syncBytes(_sequence->seq, _sequence->seq_length); + sz.syncBytes(_sequence->_seq, _sequence->kSeqLength); } bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!! diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 3464a7c9f4..30d88e5723 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -676,10 +676,10 @@ void Lucerna::enterRoom(byte room, byte ped) { if (ped != 0) { _vm->_celer->drawBackgroundSprite(-1, -1, 6); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(6); - _vm->_sequence->then_show(5); - _vm->_sequence->then_show(7); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(6); + _vm->_sequence->thenShow(5); + _vm->_sequence->thenShow(7); + _vm->_sequence->startToClose(); } break; @@ -687,11 +687,11 @@ void Lucerna::enterRoom(byte room, byte ped) { if (ped == 2) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(3); - _vm->_sequence->then_show(2); - _vm->_sequence->then_show(1); - _vm->_sequence->then_show(4); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(3); + _vm->_sequence->thenShow(2); + _vm->_sequence->thenShow(1); + _vm->_sequence->thenShow(4); + _vm->_sequence->startToClose(); } break; @@ -699,10 +699,10 @@ void Lucerna::enterRoom(byte room, byte ped) { if (ped == 2) { _vm->_celer->drawBackgroundSprite(-1, -1, 6); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(6); - _vm->_sequence->then_show(5); - _vm->_sequence->then_show(7); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(6); + _vm->_sequence->thenShow(5); + _vm->_sequence->thenShow(7); + _vm->_sequence->startToClose(); } break; @@ -725,16 +725,16 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_animation->tr[1].init(10, false, _vm->_animation); // Define the dart. _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(1); + _vm->_sequence->firstShow(1); if (_vm->_gyro->_dna._arrowInTheDoor) - _vm->_sequence->then_show(3); + _vm->_sequence->thenShow(3); else - _vm->_sequence->then_show(2); + _vm->_sequence->thenShow(2); if (_vm->_gyro->_dna._takenPen) _vm->_celer->drawBackgroundSprite(-1, -1, 4); - _vm->_sequence->start_to_close(); + _vm->_sequence->startToClose(); } else { _vm->_celer->drawBackgroundSprite(-1, -1, 1); if (_vm->_gyro->_dna._arrowInTheDoor) @@ -749,10 +749,10 @@ void Lucerna::enterRoom(byte room, byte ped) { if (ped == 1) { _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(2); - _vm->_sequence->then_show(1); - _vm->_sequence->then_show(3); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(2); + _vm->_sequence->thenShow(1); + _vm->_sequence->thenShow(3); + _vm->_sequence->startToClose(); } break; @@ -770,10 +770,10 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(2); - _vm->_sequence->then_show(1); - _vm->_sequence->then_show(3); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(2); + _vm->_sequence->thenShow(1); + _vm->_sequence->thenShow(3); + _vm->_sequence->startToClose(); } break; @@ -808,11 +808,11 @@ void Lucerna::enterRoom(byte room, byte ped) { // Shut the door _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); - _vm->_sequence->first_show(3); - _vm->_sequence->first_show(2); - _vm->_sequence->then_show(1); - _vm->_sequence->then_show(4); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(3); + _vm->_sequence->firstShow(2); + _vm->_sequence->thenShow(1); + _vm->_sequence->thenShow(4); + _vm->_sequence->startToClose(); } break; diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp index f2d4241e8a..66a95195eb 100644 --- a/engines/avalanche/sequence2.cpp +++ b/engines/avalanche/sequence2.cpp @@ -43,70 +43,66 @@ Sequence::Sequence(AvalancheEngine *vm) { _vm = vm; } -void Sequence::first_show(byte what) { +void Sequence::firstShow(byte what) { // First, we need to blank out the entire array. - for (uint i = 0; i < sizeof(seq); i++) - seq[i] = 0; - - // Then it's just the same as then_show. - then_show(what); + for (uint i = 0; i < sizeof(_seq); i++) + _seq[i] = 0; + // Then it's just the same as thenShow. + thenShow(what); } -void Sequence::then_show(byte what) { - for (int16 fv = 0; fv < seq_length; fv++) { - if (seq[fv] == 0) { - seq[fv] = what; +void Sequence::thenShow(byte what) { + for (int16 i = 0; i < kSeqLength; i++) { + if (_seq[i] == 0) { + _seq[i] = what; return; } } } -void Sequence::then_flip(byte where, byte ped) { - then_show(now_flip); +void Sequence::thenFlip(byte where, byte ped) { + thenShow(kNowFlip); _vm->_gyro->_dna._flipToWhere = where; _vm->_gyro->_dna._flipToPed = ped; } -void Sequence::start_to_close() { +void Sequence::startToClose() { _vm->_timeout->lose_timer(_vm->_timeout->reason_sequencer); _vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->reason_sequencer); } -void Sequence::start_to_open() { +void Sequence::startToOpen() { _vm->_gyro->_dna._userMovesAvvy = false; // They can't move. _vm->_animation->stopWalking(); // And they're not moving now. - start_to_close(); // Apart from that, it's the same thing. + startToClose(); // Apart from that, it's the same thing. } - - -// This PROC is called by Timeout when it's time to do another frame. -void Sequence::shove_left() { - memcpy(seq, seq+1, seq_length - 1); // Shift everything to the left. +void Sequence::shoveLeft() { + memcpy(_seq, _seq+1, kSeqLength - 1); // Shift everything to the left. } -void Sequence::call_sequencer() { - switch (seq[0]) { +void Sequence::callSequencer() { + switch (_seq[0]) { case 0: return; // No more routines. break; case 177: // Flip room. _vm->_gyro->_dna._userMovesAvvy = true; _vm->_animation->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); - if (seq[0] == 177) - shove_left(); + if (_seq[0] == 177) + shoveLeft(); break; } - if ((seq[0] >= 1) && (seq[0] <= 176)) { + if ((_seq[0] >= 1) && (_seq[0] <= 176)) { // Show a frame. - _vm->_celer->drawBackgroundSprite(-1, -1, seq[0]); - shove_left(); + _vm->_celer->drawBackgroundSprite(-1, -1, _seq[0]); + shoveLeft(); } - start_to_close(); // Make sure this PROC gets called again. + startToClose(); // Make sure this PROC gets called again. } } // End of namespace Avalanche. diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h index 7fcb646fa5..07c90b455b 100644 --- a/engines/avalanche/sequence2.h +++ b/engines/avalanche/sequence2.h @@ -37,33 +37,24 @@ class AvalancheEngine; class Sequence { public: - static const int16 now_flip = 177; - - static const int16 seq_length = 10; - - - - byte seq[seq_length]; + static const int16 kNowFlip = 177; + static const int16 kSeqLength = 10; + byte _seq[kSeqLength]; Sequence(AvalancheEngine *vm); - void first_show(byte what); - - void then_show(byte what); - - void then_flip(byte where, byte ped); - - void start_to_close(); - - void start_to_open(); - - void call_sequencer(); + void firstShow(byte what); + void thenShow(byte what); + void thenFlip(byte where, byte ped); + void startToClose(); + void startToOpen(); + void callSequencer(); private: AvalancheEngine *_vm; - void shove_left(); + void shoveLeft(); // This PROC is called by Timeout when it's time to do another frame. }; } // End of namespace Avalanche. diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index 842a7dca6e..bd136d54bf 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -143,7 +143,7 @@ void Timeout::one_tick() { jump(); break; case procsequence: - _vm->_sequence->call_sequencer(); + _vm->_sequence->callSequencer(); break; case proccrapulus_splud_out: crapulus_says_splud_out(); @@ -421,8 +421,8 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your // Let's get the door opening. _vm->_celer->drawBackgroundSprite(-1, -1, 1); - _vm->_sequence->first_show(2); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(2); + _vm->_sequence->startToClose(); set_up_timer(50, procnaughty_duke2, reason_naughty_duke); } @@ -436,8 +436,8 @@ void Timeout::naughty_duke2() { void Timeout::naughty_duke3() { _vm->_celer->drawBackgroundSprite(-1, -1, 1); - _vm->_sequence->first_show(2); - _vm->_sequence->start_to_close(); + _vm->_sequence->firstShow(2); + _vm->_sequence->startToClose(); } void Timeout::jump() { @@ -665,9 +665,9 @@ void Timeout::give_lute_to_geida() { // Moved here from Acci. _vm->_visa->dixi('Q', 86); _vm->_lucerna->incScore(4); _vm->_gyro->_dna._lustieIsAsleep = 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. + _vm->_sequence->firstShow(5); + _vm->_sequence->thenShow(6); // He falls asleep... + _vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure. } } // End of namespace Avalanche. |