From f243b50215c157a40d4ec3aada91efdb4762b73a Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Sat, 8 Nov 2003 11:32:32 +0000 Subject: Start/stop scenes - fixes missing panel. svn-id: r11205 --- queen/cutaway.cpp | 6 +++--- queen/display.cpp | 9 +++++---- queen/display.h | 3 +++ queen/logic.cpp | 28 ++++++++++++++++++++++++++-- queen/logic.h | 5 +++++ queen/xref.txt | 8 ++++---- 6 files changed, 46 insertions(+), 13 deletions(-) diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 701f1e7abb..feff561a4b 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1198,8 +1198,8 @@ void Cutaway::run(char *nextFilename) { _initialRoom = _temporaryRoom = _logic->currentRoom(); - // XXX if (_comPanel == 0 || _comPanel == 2) - // XXX SCENE_START(0); + if (_comPanel == 0 || _comPanel == 2) + _logic->sceneStart(false); byte *ptr = _objectData; @@ -1302,7 +1302,7 @@ void Cutaway::run(char *nextFilename) { talk(nextFilename); if (_comPanel == 0 || (_comPanel == 2 && !_anotherCutaway)) { - // XXX SCENE_END(1); + _logic->sceneStop(true); _comPanel = 0; } diff --git a/queen/display.cpp b/queen/display.cpp index a1d05b267d..c41d4c9bcb 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -313,11 +313,12 @@ void Display::palFadeOut(int start, int end, uint16 roomNum) { void Display::palFadePanel() { - int i; + int i, j; uint8 tempPal[256 * 3]; - for (i = 224 * 3; i <= 255 * 3; ++i) { - tempPal[i] = _pals.screen[i] * 2 / 3; - } + for (i = 224; i < 256; ++i) + for (j = 0; j < 3; j++) + tempPal[i * 3 + j] = _pals.screen[i * 3 + 1] * 2 / 3; + palSet(tempPal, 224, 255, true); } diff --git a/queen/display.h b/queen/display.h index 2179d990ef..ab978adc5d 100644 --- a/queen/display.h +++ b/queen/display.h @@ -79,6 +79,7 @@ public: void palCustomColors(uint16 roomNum); // check_colors void palCustomScroll(uint16 roomNum); // check_pal_scroll void palCustomFlash(); // flashspecial() + void palSetAllDirty() { _pals.dirtyMin = 0; _pals.dirtyMax = 255; } void screenMode(int comPanel, bool inCutaway); @@ -102,6 +103,8 @@ public: void fullscreen(bool fs) { _fullscreen = fs; } bool fullscreen() const { return _fullscreen; } + void panel(bool on) { _panel = on; } + void handleTimer(); void waitForTimer(); diff --git a/queen/logic.cpp b/queen/logic.cpp index 0a99dfa5db..2e2fe237c3 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -381,7 +381,7 @@ void Logic::initialise() { _settings.speechToggle = true; _cmd->clear(false); - // XXX SCENE = 0 + _scene = 0; memset(_gameState, 0, sizeof(_gameState)); _graphics->loadPanel(); _graphics->bobSetupControl(); @@ -2302,7 +2302,7 @@ void Logic::handlePinnacleRoom() { _graphics->cameraBob(0); // XXX COMPANEL=1; - // XXX panelflag=1; + _display->panel(true); } @@ -2315,6 +2315,30 @@ void Logic::update() { _input->checkKeys(); } +void Logic::sceneStart(bool showMouseCursor) { + _scene++; + + _display->mouseCursorShow(showMouseCursor); + + if (1 == _scene && _input->cutawayRunning()) { + _display->panel(false); + _display->palFadePanel(); + } + + update(); +} + +void Logic::sceneStop(bool showMouseCursor) { + _scene--; + + if (_scene > 0) + return; + + _display->palSetAllDirty(); + _display->panel(true); + _display->mouseCursorShow(showMouseCursor); + zoneSetupPanel(); +} } // End of namespace Queen diff --git a/queen/logic.h b/queen/logic.h index 8fa5c22cec..f3d479ec49 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -279,6 +279,8 @@ public: void inventoryDeleteItem(uint16 itemNum, bool refresh = true); void inventoryScroll(uint16 count, bool up); + void sceneStart(bool showMouseCursor); + void sceneStop(bool showMouseCursor); //! Copy data from dummy object to object void objectCopy(int dummyObjectIndex, int objectIndex); @@ -422,6 +424,9 @@ protected: //! Inventory items int16 _inventoryItem[4]; + //! scene counter + int _scene; + Resource *_resource; Graphics *_graphics; Display *_display; diff --git a/queen/xref.txt b/queen/xref.txt index 9002a01263..da46b202d0 100644 --- a/queen/xref.txt +++ b/queen/xref.txt @@ -77,11 +77,11 @@ CUTAWAY action_special_move Cutaway::actionSpecialMove CUTAWAY() Cutaway::run MAKE_COMPLEX_ANIM() Cutaway::makeComplexAnimation -SCENE_START() -SCENE_END() +SCENE_START() Logic::sceneStart +SCENE_END() Logic::sceneStop - CUTJOEF -CUTON +CUTON Input::_cutawayRunning CUTQUIT Cutaway::_quit (rename and move to Logic?) FINAL_ROOM Cutaway::_finalRoom IROOM Cutaway::_initialRoom @@ -89,7 +89,7 @@ OBJ_CUT OBJ_ANIM OLDBANK PERSON_DATA -SCENE +SCENE Logic::_scene TROOM Cutaway::_temporaryRoom -- cgit v1.2.3