diff options
author | Andrew Kurushin | 2005-06-04 15:02:17 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-06-04 15:02:17 +0000 |
commit | d3587c3a1ee9f81ef0b23550736bc5cc2b644d66 (patch) | |
tree | abed86d9f4225a7dace8a8197baa1537dce4780b /saga | |
parent | 2a3227911b35733b9ef8574459be5eb6581e1c2e (diff) | |
download | scummvm-rg350-d3587c3a1ee9f81ef0b23550736bc5cc2b644d66.tar.gz scummvm-rg350-d3587c3a1ee9f81ef0b23550736bc5cc2b644d66.tar.bz2 scummvm-rg350-d3587c3a1ee9f81ef0b23550736bc5cc2b644d66.zip |
fixed lense creation bug ( fade in/out now has separate flag)
svn-id: r18340
Diffstat (limited to 'saga')
-rw-r--r-- | saga/events.cpp | 4 | ||||
-rw-r--r-- | saga/events.h | 2 | ||||
-rw-r--r-- | saga/interface.cpp | 18 | ||||
-rw-r--r-- | saga/interface.h | 19 | ||||
-rw-r--r-- | saga/render.cpp | 2 | ||||
-rw-r--r-- | saga/scene.cpp | 38 |
6 files changed, 54 insertions, 29 deletions
diff --git a/saga/events.cpp b/saga/events.cpp index 61f70ef612..89373fc605 100644 --- a/saga/events.cpp +++ b/saga/events.cpp @@ -405,8 +405,8 @@ int Events::handleOneShot(EVENT *event) { _vm->_interface->setStatusText(""); _vm->_interface->drawStatusBar(); break; - case EVENT_RESTORE_MODE: - _vm->_interface->restoreMode(); + case EVENT_SET_FADE_MODE: + _vm->_interface->setFadeMode(event->param); break; default: break; diff --git a/saga/events.h b/saga/events.h index b8b271dc47..64f666c6bc 100644 --- a/saga/events.h +++ b/saga/events.h @@ -86,7 +86,7 @@ enum EVENT_OPS { EVENT_DEACTIVATE = 2, EVENT_SET_STATUS = 3, EVENT_CLEAR_STATUS = 4, - EVENT_RESTORE_MODE = 5, + EVENT_SET_FADE_MODE = 5, // ACTOR events EVENT_MOVE = 1, // SCRIPT events diff --git a/saga/interface.cpp b/saga/interface.cpp index 1aeb5ce1f2..1189c99e58 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -178,9 +178,10 @@ Interface::Interface(SagaEngine *vm) : _vm(vm), _initialized(false) { _saveEdit = _savePanel.getButton(_vm->getDisplayInfo().saveEditIndex); _savePanel.currentButton = NULL; - _active = false; + _active = true; _panelMode = _lockedMode = kPanelNull; _savedMode = -1; + _fadeMode = kNoFade; _inMainMode = false; *_statusText = 0; _statusOnceColor = -1; @@ -258,7 +259,7 @@ void Interface::restoreMode() { draw(); } -void Interface::setMode(int mode, bool force) { +void Interface::setMode(int mode) { // TODO: Is this where we should hide/show the mouse cursor? debug(0, "Interface::setMode %i", mode); if (mode == kPanelMain) { @@ -271,14 +272,7 @@ void Interface::setMode(int mode, bool force) { _saveReminderState = 0; } - // This lets us to prevents actors to pop up during initial - // scene fade in. - if (_savedMode != -1 && !force) { - _savedMode = mode; - debug(0, "Saved mode: %d. my mode is %d", mode, _panelMode); - } - else - _panelMode = mode; + _panelMode = mode; switch(_panelMode) { case(kPanelMain): @@ -527,7 +521,7 @@ void Interface::draw() { backBuffer = _vm->_gfx->getBackBuffer(); - if (_vm->_scene->isInDemo() || _panelMode == kPanelFade) + if (_vm->_scene->isInDemo() || _fadeMode == kFadeOut) return; @@ -1131,7 +1125,7 @@ void Interface::setOption(PanelButton *panelButton) { void Interface::update(const Point& mousePoint, int updateFlag) { - if (_vm->_scene->isInDemo() || _panelMode == kPanelFade || !_active) { + if (_vm->_scene->isInDemo() || _fadeMode == kFadeOut || !_active) { return; } diff --git a/saga/interface.h b/saga/interface.h index b6b559efca..988cb741fe 100644 --- a/saga/interface.h +++ b/saga/interface.h @@ -67,7 +67,12 @@ enum PanelModes { kPanelPlacard, kPanelMap, // kPanelInventory, - kPanelFade +}; + +enum FadeModes { + kNoFade = 0, + kFadeIn, + kFadeOut }; struct InterfacePanel { @@ -142,8 +147,6 @@ struct InterfacePanel { }; - - struct Converse { char *text; int stringNum; @@ -185,8 +188,15 @@ public: draw(); } bool isActive() { return _active; } - void setMode(int mode, bool force = false); + void setMode(int mode); int getMode(void) const { return _panelMode; } + void setFadeMode(int fadeMode) { + _fadeMode = fadeMode; + draw(); + } + int getFadeMode() const { + return _fadeMode; + } void rememberMode(); void restoreMode(); bool isInMainMode() { return _inMainMode; } @@ -364,6 +374,7 @@ private: int _saveReminderState; bool _active; + int _fadeMode; int _panelMode; int _savedMode; int _lockedMode; diff --git a/saga/render.cpp b/saga/render.cpp index a2f48519ff..1648b2c170 100644 --- a/saga/render.cpp +++ b/saga/render.cpp @@ -115,7 +115,7 @@ int Render::drawScene() { // Display scene background _vm->_scene->draw(); - if (_vm->_interface->getMode() != kPanelFade) { + if (_vm->_interface->getFadeMode() != kFadeOut) { if (_vm->_puzzle->isActive()) { _vm->_puzzle->movePiece(mouse_pt); _vm->_actor->drawSpeech(); diff --git a/saga/scene.cpp b/saga/scene.cpp index 20f02a958a..777b399a79 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -466,8 +466,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { if (loadSceneParams->transitionType == kTransitionFade || loadSceneParams->transitionType == kTransitionFadeNoInterface) { - _vm->_interface->rememberMode(); - _vm->_interface->setMode(kPanelFade, true); + _vm->_interface->setFadeMode(kFadeOut); // Fade to black out _vm->_gfx->getCurrentPal(current_pal); @@ -489,22 +488,24 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { q_event = _vm->_events->chain(q_event, &event); } - // Display scene background, but stay with black palette + // set fade mode event.type = IMMEDIATE_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = NO_SET_PALETTE; + event.code = INTERFACE_EVENT; + event.op = EVENT_SET_FADE_MODE; + event.param = kNoFade; event.time = 0; event.duration = 0; q_event = _vm->_events->chain(q_event, &event); - // Restore interface mode + // Display scene background, but stay with black palette event.type = IMMEDIATE_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_RESTORE_MODE; + event.code = BG_EVENT; + event.op = EVENT_DISPLAY; + event.param = NO_SET_PALETTE; event.time = 0; event.duration = 0; q_event = _vm->_events->chain(q_event, &event); + } // Start the scene pre script, but stay with black palette @@ -525,6 +526,16 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { if (loadSceneParams->transitionType == kTransitionFade || loadSceneParams->transitionType == kTransitionFadeNoInterface) { + + // set fade mode + event.type = IMMEDIATE_EVENT; + event.code = INTERFACE_EVENT; + event.op = EVENT_SET_FADE_MODE; + event.param = kFadeIn; + event.time = 0; + event.duration = 0; + q_event = _vm->_events->chain(q_event, &event); + // Fade in from black to the scene background palette event.type = IMMEDIATE_EVENT; event.code = PAL_EVENT; @@ -534,6 +545,15 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.data = _bg.pal; q_event = _vm->_events->chain(q_event, &event); + + // set fade mode + event.type = IMMEDIATE_EVENT; + event.code = INTERFACE_EVENT; + event.op = EVENT_SET_FADE_MODE; + event.param = kNoFade; + event.time = 0; + event.duration = 0; + q_event = _vm->_events->chain(q_event, &event); } |