diff options
author | Gregory Montoir | 2003-12-30 21:06:22 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-12-30 21:06:22 +0000 |
commit | 42c5524a02a61a13fcefdc5a7d3f187c5b048bee (patch) | |
tree | e89893ebe0527df2f258ee4fa0434ab55927bf1a /queen | |
parent | 5593a635db1d82a1c75258809854f966dbb9ad31 (diff) | |
download | scummvm-rg350-42c5524a02a61a13fcefdc5a7d3f187c5b048bee.tar.gz scummvm-rg350-42c5524a02a61a13fcefdc5a7d3f187c5b048bee.tar.bz2 scummvm-rg350-42c5524a02a61a13fcefdc5a7d3f187c5b048bee.zip |
interview mini-game support
svn-id: r12037
Diffstat (limited to 'queen')
-rw-r--r-- | queen/command.cpp | 40 | ||||
-rw-r--r-- | queen/cutaway.cpp | 5 | ||||
-rw-r--r-- | queen/logic.cpp | 106 | ||||
-rw-r--r-- | queen/logic.h | 2 | ||||
-rw-r--r-- | queen/resource.cpp | 4 | ||||
-rw-r--r-- | queen/resource.h | 4 | ||||
-rw-r--r-- | queen/talk.cpp | 14 |
7 files changed, 146 insertions, 29 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index 09b55651ef..494941259f 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -267,30 +267,46 @@ void Command::readCommandsFrom(byte *&ptr) { _numCmdArea = READ_BE_UINT16(ptr); ptr += 2; _cmdArea = new CmdArea[_numCmdArea + 1]; - memset(&_cmdArea[0], 0, sizeof(CmdArea)); - for (i = 1; i <= _numCmdArea; i++) { - _cmdArea[i].readFromBE(ptr); + if (_numCmdArea == 0) { + _cmdArea[0].readFromBE(ptr); + } else { + memset(&_cmdArea[0], 0, sizeof(CmdArea)); + for (i = 1; i <= _numCmdArea; i++) { + _cmdArea[i].readFromBE(ptr); + } } _numCmdObject = READ_BE_UINT16(ptr); ptr += 2; _cmdObject = new CmdObject[_numCmdObject + 1]; - memset(&_cmdObject[0], 0, sizeof(CmdObject)); - for (i = 1; i <= _numCmdObject; i++) { - _cmdObject[i].readFromBE(ptr); + if (_numCmdObject == 0) { + _cmdObject[0].readFromBE(ptr); + } else { + memset(&_cmdObject[0], 0, sizeof(CmdObject)); + for (i = 1; i <= _numCmdObject; i++) { + _cmdObject[i].readFromBE(ptr); + } } _numCmdInventory = READ_BE_UINT16(ptr); ptr += 2; _cmdInventory = new CmdInventory[_numCmdInventory + 1]; - memset(&_cmdInventory[0], 0, sizeof(CmdInventory)); - for (i = 1; i <= _numCmdInventory; i++) { - _cmdInventory[i].readFromBE(ptr); + if (_numCmdInventory == 0) { + _cmdInventory[0].readFromBE(ptr); + } else { + memset(&_cmdInventory[0], 0, sizeof(CmdInventory)); + for (i = 1; i <= _numCmdInventory; i++) { + _cmdInventory[i].readFromBE(ptr); + } } _numCmdGameState = READ_BE_UINT16(ptr); ptr += 2; _cmdGameState = new CmdGameState[_numCmdGameState + 1]; - memset(&_cmdGameState[0], 0, sizeof(CmdGameState)); - for (i = 1; i <= _numCmdGameState; i++) { - _cmdGameState[i].readFromBE(ptr); + if (_numCmdGameState == 0) { + _cmdGameState[0].readFromBE(ptr); + } else { + memset(&_cmdGameState[0], 0, sizeof(CmdGameState)); + for (i = 1; i <= _numCmdGameState; i++) { + _cmdGameState[i].readFromBE(ptr); + } } } diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index b67ebe2de7..e294a71ab4 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1043,6 +1043,11 @@ void Cutaway::run(char *nextFilename) { joeBob->animating = 0; joeBob->moving = 0; + if (_vm->resource()->isInterview()) { + _vm->graphics()->bob(20)->box.y2 = 149; + _vm->graphics()->bob(21)->box.y2 = 149; + _vm->graphics()->bob(22)->box.y2 = 149; + } // Make sure Joe is clipped! joeBob->box.y2 = 149; diff --git a/queen/logic.cpp b/queen/logic.cpp index eac9eef359..bb8aae39bf 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -188,11 +188,15 @@ void Logic::initialise() { } _numGraphicAnim = READ_BE_UINT16(ptr); ptr += 2; - + _graphicAnim = new GraphicAnim[_numGraphicAnim + 1]; - memset(&_graphicAnim[0], 0, sizeof(GraphicAnim)); - for (i = 1; i <= _numGraphicAnim; i++) { - _graphicAnim[i].readFromBE(ptr); + if (_numGraphicAnim == 0) { + _graphicAnim[0].readFromBE(ptr); + } else { + memset(&_graphicAnim[0], 0, sizeof(GraphicAnim)); + for (i = 1; i <= _numGraphicAnim; i++) { + _graphicAnim[i].readFromBE(ptr); + } } _currentRoom = _objectData[_entryObj].room; @@ -1674,10 +1678,17 @@ uint16 Logic::findInventoryItem(int invSlot) const { void Logic::inventorySetup() { _vm->graphics()->bankLoad("objects.BBK", 14); - _inventoryItem[0] = ITEM_BAT; - _inventoryItem[1] = ITEM_JOURNAL; - _inventoryItem[2] = ITEM_NONE; - _inventoryItem[3] = ITEM_NONE; + if (_vm->resource()->isInterview()) { + _inventoryItem[0] = 1; + _inventoryItem[1] = 2; + _inventoryItem[2] = 3; + _inventoryItem[3] = 4; + } else { + _inventoryItem[0] = ITEM_BAT; + _inventoryItem[1] = ITEM_JOURNAL; + _inventoryItem[2] = ITEM_NONE; + _inventoryItem[3] = ITEM_NONE; + } } void Logic::inventoryRefresh() { @@ -2079,7 +2090,9 @@ void Logic::update() { _vm->input()->delay(); - _vm->display()->palCustomScroll(_currentRoom); + if (!_vm->resource()->isInterview()) { + _vm->display()->palCustomScroll(_currentRoom); + } if (_vm->debugger()->_drawAreas) { for(int i = 1; i < MAX_ZONES_NUMBER; ++i) { const ZoneSlot *pzs = &_zones[ZONE_ROOM][i]; @@ -2312,7 +2325,7 @@ void Logic::changeRoom() { void Logic::useJournal() { if (_vm->resource()->isDemo()) { makePersonSpeak("This is a demo, so I can't load or save games*14", NULL, ""); - } else { + } else if (!_vm->resource()->isInterview()) { _vm->command()->clear(false); Journal j(_vm); j.use(); @@ -2398,7 +2411,15 @@ bool Logic::preChangeRoom_Demo() { bool Logic::preChangeRoom_Interview() { - // XXX + if (currentRoom() == 2 && gameState(2) == 0) { + currentRoom(6); + roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true); + playCutaway("start.cut"); + gameState(2, 1); + inventorySetup(); + inventoryRefresh(); + return true; + } return false; } @@ -2456,8 +2477,17 @@ bool Logic::executeSpecialMove_Demo(uint16 sm) { bool Logic::executeSpecialMove_Interview(uint16 sm) { - // XXX - return false; + switch (sm) { + case 1: + asmInterviewIntro(); + break; + case 2: + asmEndInterview(); + break; + default: + return false; + } + return true; } @@ -3092,9 +3122,57 @@ void Logic::asmPanLeftToBomb() { void Logic::asmEndDemo() { debug(0, "Flight of the Amazon Queen, released January 95"); - OSystem::instance()->quit(); + OSystem::instance()->quit(); } +void Logic::asmInterviewIntro() { + // put camera on zeppelin + _vm->graphics()->cameraBob(5); + BobSlot *bzep = _vm->graphics()->bob(5); + + bzep->curPos(-30, 40); + + bzep->move(700, 10, 3); + int scale = 450; + while (bzep->moving && !_vm->input()->cutawayQuit()) { + bzep->scale = 256 * 100 / scale; + --scale; + if (scale < 256) { + scale = 256; + } + update(); + } + + bzep->scale = 90; + bzep->xflip = true; + + bzep->move(560, 25, 4); + while (bzep->moving && !_vm->input()->cutawayQuit()) { + update(); + } + + bzep->move(545, 65, 2); + while (bzep->moving && !_vm->input()->cutawayQuit()) { + update(); + } + + bzep->move(540, 75, 2); + while (bzep->moving && !_vm->input()->cutawayQuit()) { + update(); + } + + // put camera on Joe + _vm->graphics()->cameraBob(0); +} + + +void Logic::asmEndInterview() { + debug(0, "Interactive Interview copyright (c) 1995, IBI."); + OSystem::instance()->quit(); +} + + + } // End of namespace Queen diff --git a/queen/logic.h b/queen/logic.h index 09a8dae9f1..84463b0e36 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -293,6 +293,8 @@ public: void asmPanRightToJoeAndRita(); void asmPanLeftToBomb(); void asmEndDemo(); + void asmInterviewIntro(); + void asmEndInterview(); typedef bool (Logic::*ExecuteSpecialMoveProc)(uint16); typedef bool (Logic::*PreChangeRoomProc)(); diff --git a/queen/resource.cpp b/queen/resource.cpp index 5dbd488ef0..cf027c5e53 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -38,7 +38,8 @@ const GameVersion Resource::_gameVersions[] = { { "CIM10", 0x0008BEE2, 190795582 }, { "CSM10", 0x000B343C, 190730602 }, { "PE100", 0x000DA981, 3724538 }, - { "PE100", 0x000DB63A, 3732177 } + { "PE100", 0x000DB63A, 3732177 }, + { "PEint", 0x000DC2F3, 1915913 } }; @@ -112,6 +113,7 @@ ResourceEntry *Resource::resourceEntry(const char *filename) const { } char *Resource::getJAS2Line() { + assert(_JAS2Pos < resourceEntry("QUEEN2.JAS")->size); char *startOfLine = _JAS2Ptr + _JAS2Pos; char *curPos = startOfLine; while (*curPos++ != 0xd) ; diff --git a/queen/resource.h b/queen/resource.h index c79d6f25cd..c0833a9b00 100644 --- a/queen/resource.h +++ b/queen/resource.h @@ -43,9 +43,9 @@ enum Version { // VER_HEB_TALKIE VER_DEMO_PCGAMES = 9, VER_DEMO = 10, - // VER_INTERVIEW + VER_INTERVIEW = 11, - VER_COUNT = 11 + VER_COUNT = 12 }; struct ResourceEntry { diff --git a/queen/talk.cpp b/queen/talk.cpp index ed5a3a080d..4b401f76a8 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -1872,6 +1872,20 @@ const Talk::SpeechParameters Talk::_speechParameters[] = { //#endif + // Interview + { "JOHN", 0, 0, 1, 2, 2, 3, "", 1 }, + { "JOHN", 1, 0, 1, 15, -1, 0, "", 1 }, + { "JOHN", 2, 0, 1, 16, -1, 0, "", 1 }, + { "JOHN", 3, 0, 1, 17, -1, 0, "", 1 }, + + { "STEVE", 0, 0, 8, 2, 2, 3, "", 2 }, + { "STEVE", 1, 0, 8, 16, -1, 0, "", 2 }, + { "STEVE", 2, 0, 9, 18, -1, 0, "T016,017,017,016,008,000", 2 }, + { "STEVE", 3, 0, 8, 18, -1, 0, "", 2 }, + + { "TONY", 0, 0, 1, 2, 2, 3, "", 1 }, + { "TONY", 1, 0, 1, 12, -1, 0, "", 1 }, + { "*",0,0,0,0,0,0,"",0} }; |