diff options
author | Gregory Montoir | 2003-12-10 15:36:44 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-12-10 15:36:44 +0000 |
commit | ed2baf283e7181799f6e27176c0cb02851e4897c (patch) | |
tree | 6db8bc617d1beda2138e9faf1dd8e2407473e1ba | |
parent | d947a6ea778e6d1544ba905d89c84fb2d4b8dc9d (diff) | |
download | scummvm-rg350-ed2baf283e7181799f6e27176c0cb02851e4897c.tar.gz scummvm-rg350-ed2baf283e7181799f6e27176c0cb02851e4897c.tar.bz2 scummvm-rg350-ed2baf283e7181799f6e27176c0cb02851e4897c.zip |
- moved QueenEngine::roomChanged to Logic and enabled call from Cutaway code (this fixes the 2 irons bars being displayed at the end of c39a.cut)
- moved my 'panel being hidden after the head room display' fix
- fix problem in joeCutFacing / joeFacing in cutaway code
svn-id: r11553
-rw-r--r-- | queen/cutaway.cpp | 36 | ||||
-rw-r--r-- | queen/cutaway.h | 1 | ||||
-rw-r--r-- | queen/logic.cpp | 61 | ||||
-rw-r--r-- | queen/logic.h | 2 | ||||
-rw-r--r-- | queen/queen.cpp | 69 | ||||
-rw-r--r-- | queen/queen.h | 4 | ||||
-rw-r--r-- | queen/xref.txt | 2 |
7 files changed, 88 insertions, 87 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 2ac51f5132..02d181574f 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -150,6 +150,9 @@ void Cutaway::load(const char *filename) { _nextSentence = Talk::getString(_nextSentence, entryString, MAX_STRING_LENGTH); debug(0, "Entry string = '%s'", entryString); + _logic->joeCutFacing(_logic->joeFacing()); + _logic->joeFace(); + if (entryString[0] == '*' && entryString[1] == 'F' && entryString[3] == '\0') { @@ -403,6 +406,12 @@ void Cutaway::changeRooms(CutawayObject &object) { comPanel = 1; } + // FIXME: in the original engine, panel is hidden after displaying head. We do + // it before. + if(object.room == FAYE_HEAD || object.room == AZURA_HEAD || object.room == FRANK_HEAD) { + comPanel = 2; + } + RoomDisplayMode mode; if (!_logic->joeX() && !_logic->joeY()) { @@ -865,18 +874,8 @@ void Cutaway::run(char *nextFilename) { _input->cutawayRunning(true); - _logic->joeCutFacing(_logic->joeFacing()); - _logic->joeFace(); - _initialRoom = _temporaryRoom = _logic->currentRoom(); - // FIXME: hack to hide the panel *before* displaying a talking head. - // This was not handled in the original game, but I think it is - // better like that. - if (_talkTo != 0) { - _comPanel = 2; - } - _logic->display()->screenMode(_comPanel, true); if (_comPanel == 0 || _comPanel == 2) { @@ -1012,17 +1011,14 @@ void Cutaway::run(char *nextFilename) { } if (_logic->currentRoom() != _initialRoom) { - // XXX should call SETUP_ROOM here but that would introduce a - // circual dependency, so we try to set newRoom to the room - // instead - debug(0, "[Cutaway::run] Not calling SETUP_ROOM here, just setting newRoom to %i", _initialRoom); - _logic->newRoom(_initialRoom); - _logic->display()->fullscreen(true); - } - else { - _logic->joeX(0); - _logic->joeY(0); + _logic->currentRoom(_initialRoom); + _logic->changeRoom(); + if (_logic->currentRoom() == _logic->newRoom()) { + _logic->newRoom(0); + } } + _logic->joeX(0); + _logic->joeY(0); } _logic->joeCutFacing(0); diff --git a/queen/cutaway.h b/queen/cutaway.h index 8ddaa5ff89..c876b627c0 100644 --- a/queen/cutaway.h +++ b/queen/cutaway.h @@ -290,7 +290,6 @@ class Cutaway { //! Dump CutawayAnum data with debug() static void dumpCutawayAnim(CutawayAnim &anim); - }; } // End of namespace Queen diff --git a/queen/logic.cpp b/queen/logic.cpp index 9a1a33da7b..c8218ccc16 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -400,6 +400,10 @@ void Logic::initialise() { ObjectData* Logic::objectData(int index) const { + + if (index < 0) { + warning("Logic::objectData() called with negative object index: %i", index); + } index = ABS(index); // cyx: is that really necessary ? if (index <= _numObjects) return &_objectData[index]; @@ -2571,6 +2575,63 @@ void Logic::sceneStop() { } +void Logic::changeRoom() { + + if (currentRoom() == ROOM_JUNGLE_PINNACLE) { + handlePinnacleRoom(); + } + else if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) { + // FIXME: this should be rewritten in a more elegant way + bool pcGamesDemo = _resource->isDemo() && !_resource->exists("pclogo.cut"); + + if (pcGamesDemo) { + currentRoom(79); + } + roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true); + + if (_resource->isDemo()) { + if (pcGamesDemo) { + playCutaway("clogo.cut"); + } + else { + playCutaway("pclogo.cut"); + } + } + else { + playCutaway("copy.cut"); + playCutaway("clogo.cut"); + + // TODO enable talking for talkie version + + playCutaway("cdint.cut"); + + // restore palette colors ranging from 144 to 256 + _graphics->loadPanel(); + + playCutaway("cred.cut"); + } + + // Ugly fix from original code + sceneReset(); + + currentRoom(ROOM_HOTEL_LOBBY); + entryObj(584); + + roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 2, true); + playCutaway("c70d.cut"); + + gameState(VAR_INTRO_PLAYED, 1); + + inventorySetup(); + inventoryRefresh(); + } + else { + roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 1, false); + } + _display->showMouseCursor(true); // _drawMouseFlag = 1; +} + + void Logic::useJournal() { if (_resource->isDemo()) { diff --git a/queen/logic.h b/queen/logic.h index 14575c0250..52b8e39679 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -296,6 +296,8 @@ public: //! Stop making a scene void sceneStop(); + void changeRoom(); + void useJournal(); void executeSpecialMove(uint16 sm); diff --git a/queen/queen.cpp b/queen/queen.cpp index bdf434a888..d4097c961b 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -122,71 +122,18 @@ void QueenEngine::errorString(const char *buf1, char *buf2) { strcpy(buf2, buf1); } -void QueenEngine::roomChanged() { - // queen.c function SETUP_ROOM, lines 398-428 - - // This function uses lots of variables in logic, but we can't move it to - // logic because that would cause a circular dependency between Cutaway and - // Logic... :-( - - if (_logic->currentRoom() == ROOM_JUNGLE_PINNACLE) { - _logic->handlePinnacleRoom(); - } - else if (_logic->currentRoom() == FOTAQ_LOGO && _logic->gameState(VAR_INTRO_PLAYED) == 0) { - bool pcGamesDemo = _resource->isDemo() && !_resource->exists("pclogo.cut"); - - if (pcGamesDemo) { - _logic->currentRoom(79); - } - _logic->roomDisplay(_logic->currentRoom(), RDM_FADE_NOJOE, 100, 2, true); - - if (_resource->isDemo()) { - if (pcGamesDemo) { - _logic->playCutaway("clogo.cut"); - } - else { - _logic->playCutaway("pclogo.cut"); - } - } - else { - _logic->playCutaway("copy.cut"); - _logic->playCutaway("clogo.cut"); - - // TODO enable talking for talkie version - - _logic->playCutaway("cdint.cut"); - - // restore palette colors ranging from 144 to 256 - _graphics->loadPanel(); - - _logic->playCutaway("cred.cut"); - } - - // Ugly fix from original code - _logic->sceneReset(); - - _logic->currentRoom(ROOM_HOTEL_LOBBY); - _logic->entryObj(584); - - _logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 2, true); - _logic->playCutaway("c70d.cut"); - - _logic->gameState(VAR_INTRO_PLAYED, 1); - - _logic->inventorySetup(); - _logic->inventoryRefresh(); - } - else { - _logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 1, false); - } - _display->showMouseCursor(true); // _drawMouseFlag = 1; -} - void QueenEngine::go() { initialise(); +_input->fastMode(true); + +//_logic->currentRoom(69); +//_logic->roomDisplay(_logic->currentRoom(), RDM_FADE_JOE, 100, 2, true); +//_graphics->initFightBamScene(); +//_logic->playCutaway("c69g.CUT"); + _logic->oldRoom(0); _logic->newRoom(_logic->currentRoom()); @@ -197,7 +144,7 @@ void QueenEngine::go() { _logic->update(); _logic->oldRoom(_logic->currentRoom()); _logic->currentRoom(_logic->newRoom()); - roomChanged(); + _logic->changeRoom(); _display->fullscreen(false); if (_logic->currentRoom() == _logic->newRoom()) { _logic->newRoom(0); diff --git a/queen/queen.h b/queen/queen.h index 213879bbf0..ddd8def66f 100644 --- a/queen/queen.h +++ b/queen/queen.h @@ -45,9 +45,6 @@ protected: void errorString(const char *buf_input, char *buf_output); - //! Called when we go from one room to another - void roomChanged(); // SETUP_ROOM - void go(); void initialise(); @@ -55,7 +52,6 @@ protected: static void timerHandler(void *ptr); void gotTimerTick(); - Graphics *_graphics; Input *_input; Resource *_resource; diff --git a/queen/xref.txt b/queen/xref.txt index 61f522ccb3..ec314c9761 100644 --- a/queen/xref.txt +++ b/queen/xref.txt @@ -220,7 +220,7 @@ REDISP_OBJECT() Logic::roomRefreshObject restart_game() SETUP_BOBS() Graphics::bobSetupControl SETUP_FURNITURE() Logic::roomSetupFurniture -SETUP_ROOM() QueenEngine::roomChanged +SETUP_ROOM() Logic::changeRoom SETUP_SCREENS() *not needed* (only calls Graphics::loadPanel) SETUP_VARS() *not needed* (equivalent to Command::clear(), SCENE=0, clear(gamestate)) update() Logic::update |