diff options
author | Gregory Montoir | 2003-12-10 14:19:04 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-12-10 14:19:04 +0000 |
commit | d947a6ea778e6d1544ba905d89c84fb2d4b8dc9d (patch) | |
tree | e6e0d3635402ccd3783e7052bd32d43ce4e863c1 /queen/cutaway.cpp | |
parent | 7153d77024e7b0091046aa27f02864824c694e60 (diff) | |
download | scummvm-rg350-d947a6ea778e6d1544ba905d89c84fb2d4b8dc9d.tar.gz scummvm-rg350-d947a6ea778e6d1544ba905d89c84fb2d4b8dc9d.tar.bz2 scummvm-rg350-d947a6ea778e6d1544ba905d89c84fb2d4b8dc9d.zip |
cleanup, split Cutaway::specialMove() into several methods ; this should allow us minor changes in order to support different/other special moves (demo, interview)
svn-id: r11552
Diffstat (limited to 'queen/cutaway.cpp')
-rw-r--r-- | queen/cutaway.cpp | 593 |
1 files changed, 2 insertions, 591 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index dcc0881c49..2ac51f5132 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -33,13 +33,6 @@ namespace Queen { /* - TODO soon - - - Implement SCENE_START and SCENE_END - - - Finish Cutaway::actionSpecialMove - - TODO later - Finish Cutaway::stop @@ -285,588 +278,6 @@ void Cutaway::dumpCutawayObject(int index, CutawayObject &object) } -void Cutaway::actionSpecialMove(int index) { - - if (index <= 0) - return; - - debug(0, "Special move: %i", index); - - switch (index) { - - case 2: - _logic->joeUseDress(false); - break; - - // c74a.cut - use clothes - case 3: - _logic->joeUseClothes(false); - break; - - case 4: - _logic->joeUseUnderwear(); - break; - - // cdres.cut - case 5: - _logic->display()->palSetJoe(JP_DRESS); - break; - - // cdclo.cut - Set Joe's palette - case 6: - _logic->display()->palSetJoe(JP_CLOTHES); - break; - - // c73e.cut - carbam background animation - case 7: - _graphics->initCarBamScene(); - break; - - // c74a.cut - Turn off big oil splat and gun shots! - case 8: - _graphics->cleanupCarBamScene(_logic->findBob(594)); // Oil object - break; - - // c69e.cut - Fight1 background animation - case 9: - _graphics->initFightBamScene(); - _logic->gameState(148, 1); - break; - - // c69e.cut - case 10: - _graphics->bamData()->flag = 2; - while (_graphics->bamData()->flag) { - _logic->update(); - } - break; - - // c69z.cut - Frank growing - case 11: { - _graphics->bankUnpack(1, 38, 15); - BobSlot *bobFrank = _graphics->bob(5); - bobFrank->frameNum = 38; - bobFrank->curPos(160, 200); - bobFrank->box.y2 = GAME_SCREEN_HEIGHT - 1; - - int i; - for (i = 10; i <= 100; i += 4) { - bobFrank->scale = i; - _logic->update(); - } - for (i = 0; i <= 20; ++i) { - _logic->update(); - } - - _logic->objectData(521)->name = ABS(_logic->objectData(521)->name); // Dinoray - _logic->objectData(526)->name = ABS(_logic->objectData(526)->name); // Frank obj - _logic->objectData(522)->name = -ABS(_logic->objectData(522)->name); // TMPD object off - _logic->objectData(525)->name = -ABS(_logic->objectData(525)->name); // Floda guards off - _logic->objectData(523)->name = -ABS(_logic->objectData(523)->name); // Sparky object off - _logic->gameState(157, 1); // No more Ironstein - } - break; - - // c69z.cut - Robot growing - case 12: { - _graphics->bankUnpack(1, 38, 15); - BobSlot *bobRobot = _graphics->bob(5); - bobRobot->frameNum = 38; - bobRobot->curPos(160, 200); - bobRobot->box.y2 = GAME_SCREEN_HEIGHT - 1; - - int i; - for (i = 10; i <= 100; i += 4) { - bobRobot->scale = i; - _logic->update(); - } - for (i = 0; i <= 20; ++i) { - _logic->update(); - } - - _logic->objectData(524)->name = -ABS(_logic->objectData(524)->name); // Azura object off - _logic->objectData(526)->name = -ABS(_logic->objectData(526)->name); // Frank object off - } - break; - - // Robot shrinking - case 13: { - int i; - for (i = 100; i >= 35; i -= 5) { - _graphics->bob(6)->scale = i; - _logic->update(); - } - } - break; - - // End game - case 14: { - int i; - for (i = 0; i < 40; ++i) { - _logic->update(); - } - OSystem::instance()->quit(); - } - break; - - // Dinocam - case 15: - _graphics->cameraBob(-1); - while (_logic->display()->horizontalScroll() < 320) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() + 16); - if (_logic->display()->horizontalScroll() > 320) { - _logic->display()->horizontalScroll(320); - } - _logic->update(); - } - _graphics->cameraBob(1); - break; - - // cdint.cut / room 67 - put camera on Joe - case 16: - _graphics->cameraBob(0); - break; - - // XXX sm17&18 : alternative intro - - case 19: - _logic->gameState(VAR_AZURA_IN_LOVE, 1); - break; - - // Pan right from Joe - case 20: - _graphics->cameraBob(-1); - while (_logic->display()->horizontalScroll() < 320) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() + 16); - if (_logic->display()->horizontalScroll() > 320) { - _logic->display()->horizontalScroll(320); - } - _logic->update(); - } - break; - - case 21: - _logic->display()->palCustomLightsOff(_logic->currentRoom()); - break; - - case 22: - _logic->display()->palCustomLightsOn(_logic->currentRoom()); - break; - - // manequin area on - case 23: - _logic->area(ROOM_FLODA_FRONTDESK, 7)->mapNeighbours = ABS(_logic->area(ROOM_FLODA_FRONTDESK, 7)->mapNeighbours); - break; - - case 24: { - int i = _graphics->bob(0)->x - 160; - if (i < 0) { - i = 0; - } - else if (i > 320) { - i = 320; - } - _graphics->cameraBob(-1); - if (i < _logic->display()->horizontalScroll()) { - while (_logic->display()->horizontalScroll() > i) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() - 16); - if (_logic->display()->horizontalScroll() < i) { - _logic->display()->horizontalScroll(i); - } - _logic->update(); - } - } - else { - while (_logic->display()->horizontalScroll() < i) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() + 16); - if (_logic->display()->horizontalScroll() > i ) { - _logic->display()->horizontalScroll(i); - } - } - _logic->update(); - } - _graphics->cameraBob(0); - } - break; - - // Turn guard on - case 25: - _logic->gameState(85, 1); - break; - - // c69g.CUT - Pan left 320 to 144 - case 26: - _graphics->cameraBob(-1); - while (_logic->display()->horizontalScroll() > 144) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() - 8); - if (_logic->display()->horizontalScroll() < 144) { - _logic->display()->horizontalScroll(144); - } - _logic->update(); - } - break; - - // smooch - case 27: { - _graphics->cameraBob(-1); - BobSlot *bobAzura = _graphics->bob(5); - BobSlot *bobJoe = _graphics->bob(6); - while (_logic->display()->horizontalScroll() < 320) { - _logic->display()->horizontalScroll(_logic->display()->horizontalScroll() + 8); - if (bobJoe->x - bobAzura->x > 128) { - bobAzura->x += 10; - bobJoe->x += 6; - } - else { - bobAzura->x += 8; - bobJoe->x += 8; - } - _logic->update(); - } - } - break; - - // c75b.cut - Lightning hits plane - case 28: - { - _graphics->cameraBob(-1); - - short iy = 0, x, ydir = -1, j, k; - - BobSlot *planeBob = _graphics->bob(5); - BobSlot *lightningBob = _graphics->bob(20); - - planeBob->box.y2 = lightningBob->box.y2 = 199; - planeBob->y = 135; - - planeBob->scale = 20; - - for (x = 660; x > 163; x -= 6) { - planeBob->x = x; - planeBob->y = 135 + iy; - - iy -= ydir; - if (iy < -9 || iy > 9) - ydir = -ydir; - - planeBob->scale++; - if (planeBob->scale > 100) - planeBob->scale = 100; - - int scrollX = x - 163; - if (scrollX > 320) - scrollX = 320; - _logic->display()->horizontalScroll(scrollX); - - _logic->update(); - } - - planeBob->scale = 100; - _logic->display()->horizontalScroll(0); - - planeBob->x -= -8; - planeBob->y += 6; - - lightningBob->x = 160; - lightningBob->y = 0; - - // 23/2/95 - Play lightning SFX - // XXX sfxplay(NULLstr); - - _graphics->bankUnpack(18, lightningBob->frameNum, 15); - _graphics->bankUnpack(4, planeBob ->frameNum, 15); - - // Plane plunges into the jungle! - - BobSlot *fireBob = _graphics->bob(6); - - fireBob->animating = true; - fireBob->x = planeBob->x; - fireBob->y = planeBob->y + 10; - - _graphics->bankUnpack(19, fireBob->frameNum, 15); - _logic->update(); - - k = 20; - j = 1; - - for (x = 163; x > -30; x -= 10) { - planeBob->y += 4; - fireBob->y += 4; - planeBob->x = fireBob->x = x; - - if (k < 40) { - _graphics->bankUnpack(j, planeBob->frameNum, 15); - _graphics->bankUnpack(k, fireBob ->frameNum, 15); - k++; - j++; - - if (j == 4) - j = 1; - } - - _logic->update(); - } - - _graphics->cameraBob(0); - } - break; - - // Scale blimp - end game! - case 29: { - int16 z = 256; - BobSlot *bob = _graphics->bob(7); - int16 x = bob->x; - int16 y = bob->y; - while (bob->x > 150) { - bob->x = x * 256 / z + 150; - bob->x = y * 256 / z + 112; - bob->scale = 100 * 256 / z; - - ++z; - if (z % 6 == 0) { - --x; - } - - _logic->update(); - } - } - break; - - // scale ending - case 30: { - _graphics->bob(7)->active = false; // Turn off blimp - BobSlot *b = _graphics->bob(20); - b->x = 160; - b->y = 100; - int i; - for (i = 5; i <= 100; i += 5) { - b->scale = i; - _logic->update(); - } - for (i = 0; i < 50; ++i) { - _logic->update(); - } - _logic->display()->palFadeOut(0, 255, _logic->currentRoom()); - } - break; - - // c74a.cut - Wait for car to reach correct position before pouring oil - case 31: - while (_graphics->bamData()->index != 60) { - _logic->update(); - } - break; - - // c75b.cut - Screen shake - case 32: - OSystem::instance()->set_shake_pos(3); - _logic->update(); - OSystem::instance()->set_shake_pos(0); - _logic->update(); - break; - - // Attempt puzzle - case 33: { - static short n = 0; - ++n; - if (n & 4) { - _logic->joeSpeak(226, true); - } - } - break; - - // cred.cut - scale title - case 34: - { - BobSlot *bob = _graphics->bob(5); - bob->animating = false; - bob->x = 161; - bob->y = 200; - bob->scale = 100; - - int i; - for (i = 5; i <= 100; i +=5) { - bob->scale = i; - bob->y -= 4; - _logic->update(); - } - } - break; - - // XXX sm35: demo - - // cdint.cut - pan right fast - case 36: - { - Display *display = _logic->display(); - - BobSlot *bob_thugA1 = _graphics->bob(20); - BobSlot *bob_thugA2 = _graphics->bob(21); - BobSlot *bob_thugA3 = _graphics->bob(22); - BobSlot *bob_hugh1 = _graphics->bob(1); - BobSlot *bob_hugh2 = _graphics->bob(23); - BobSlot *bob_hugh3 = _graphics->bob(24); - BobSlot *bob_thugB1 = _graphics->bob(25); - BobSlot *bob_thugB2 = _graphics->bob(26); - - _graphics->cameraBob(-1); - _input->fastMode(true); - _logic->update(); - - int i = 4, k = 160; - - // Adjust thug1 gun so it matches rest of body - bob_thugA1->x += (k / 2) * 2 - 45; - bob_thugA2->x += (k / 2) * 2; - bob_thugA3->x += (k / 2) * 2; - - bob_hugh1->x += (k / 2) * 3 + (k / 2); - bob_hugh2->x += (k / 2) * 3 + (k / 2); - bob_hugh3->x += (k / 2) * 3 + (k / 2); - - bob_thugB1->x += (k / 2) * 4 + k; - bob_thugB2->x += (k / 2) * 4 + k; - - if (i == 3) { - bob_thugB1->x += 10; - bob_thugB2->x += 10; - } - - i *= 2; - - int horizontalScroll = 0; - - while (horizontalScroll < k) { - - horizontalScroll = horizontalScroll + i; - if (horizontalScroll > k) - horizontalScroll = k; - - //debug(0, "horizontalScroll = %i", horizontalScroll); - - display->horizontalScroll(horizontalScroll); - - bob_thugA1->x -= i * 2; - bob_thugA2->x -= i * 2; - bob_thugA3->x -= i * 2; - - bob_hugh1->x -= i * 3; - bob_hugh2->x -= i * 3; - bob_hugh3->x -= i * 3; - - bob_thugB1->x -= i * 4; - bob_thugB2->x -= i * 4; - - _logic->update(); - - if (_input->cutawayQuit()) - return; - } - - _input->fastMode(false); - } - break; - - // cdint.cut - flash white - case 37: - _logic->display()->palCustomFlash(); - break; - - // cdint.cut - pan right - case 38: - { - Display *display = _logic->display(); - - BobSlot *bob_box = _graphics->bob(20); - BobSlot *bob_beam = _graphics->bob(21); - BobSlot *bob_crate = _graphics->bob(22); - BobSlot *bob_clock = _graphics->bob(23); - BobSlot *bob_hands = _graphics->bob(24); - - _graphics->cameraBob(-1); - _input->fastMode(true); - - _logic->update(); - - bob_box ->x += 280 * 2; - bob_beam ->x += 30; - bob_crate->x += 180 * 3; - - int horizontalScroll = display->horizontalScroll(); - - int i = 1; - while (horizontalScroll < 290) { - - horizontalScroll = horizontalScroll + i; - if (horizontalScroll > 290) - horizontalScroll = 290; - - //debug(0, "horizontalScroll = %i", horizontalScroll); - - display->horizontalScroll(horizontalScroll); - - bob_box ->x -= i * 2; - bob_beam ->x -= i; - bob_crate->x -= i * 3; - bob_clock->x -= i * 2; - bob_hands->x -= i * 2; - - _logic->update(); - - if (_input->cutawayQuit()) - return; - - } - - _input->fastMode(false); - } - break; - - // cdint.cut - pan left to bomb - case 39: - { - Display *display = _logic->display(); - - BobSlot *bob21 = _graphics->bob(21); - BobSlot *bob22 = _graphics->bob(22); - - _graphics->cameraBob(-1); - _input->fastMode(true); - - int horizontalScroll = display->horizontalScroll(); - - int i = 5; - while (horizontalScroll > 0 || bob21->x < 136) { - - horizontalScroll -= i; - if (horizontalScroll < 0) - horizontalScroll = 0; - - //debug(0, "horizontalScroll = %i", horizontalScroll); - display->horizontalScroll(horizontalScroll); - - if (horizontalScroll < 272 && bob21->x < 136) - bob21->x += (i/2); - - bob22->x += i; - - _logic->update(); - - if (_input->cutawayQuit()) - return; - - } - - _input->fastMode(false); - } - break; - - default: - warning("Unhandled special move: %i", index); - break; - } -} byte *Cutaway::turnOnPeople(byte *ptr, CutawayObject &object) { // Lines 1248-1259 in cutaway.c @@ -1483,7 +894,7 @@ void Cutaway::run(char *nextFilename) { !object.moveToY && object.specialMove && object.objectNumber >= 0) { - actionSpecialMove(object.specialMove); + _logic->executeSpecialMove(object.specialMove); object.specialMove = 0; } @@ -1778,7 +1189,7 @@ void Cutaway::stop() { } // for() int16 specialMove = (int16)READ_BE_UINT16(ptr); ptr += 2; - actionSpecialMove(specialMove); + _logic->executeSpecialMove(specialMove); _lastSong = (int16)READ_BE_UINT16(ptr); ptr += 2; } |