diff options
author | Filippos Karapetis | 2007-08-17 06:08:18 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-08-17 06:08:18 +0000 |
commit | 769dd1d7a290f2b2f11c80f406cb87efbc1a024d (patch) | |
tree | 6a996d4623fa5c4ac47414eb6a3d283ab65613cf | |
parent | 4722075da3b16d17aef5e110376142a67cd79402 (diff) | |
download | scummvm-rg350-769dd1d7a290f2b2f11c80f406cb87efbc1a024d.tar.gz scummvm-rg350-769dd1d7a290f2b2f11c80f406cb87efbc1a024d.tar.bz2 scummvm-rg350-769dd1d7a290f2b2f11c80f406cb87efbc1a024d.zip |
Several bugfixes:
- The spiritual barometer display in IHNM is now updated only when necessary, to speed drawing up. This also corrects an issue where the spiritual barometer display was updated only after changing a scene
- sf92 is sfDemoSetInteractive
- It's now possible to use dashes and underscores in savegames
- Screen fading when changing scenes is now done correctly: the interface will no longer be incorrectly briefly shown while the screen is fading to black
- The interface mode is now correctly set in the non-interactive part of the IHNM demo
- sfScriptGotoScene does not have a transition parameter, therefore that parameter has been removed
svn-id: r28643
-rw-r--r-- | engines/saga/events.cpp | 11 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 16 | ||||
-rw-r--r-- | engines/saga/interface.h | 2 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 12 | ||||
-rw-r--r-- | engines/saga/script.h | 2 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 30 |
6 files changed, 49 insertions, 24 deletions
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 80e6b58595..187ffedcad 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -338,6 +338,17 @@ int Events::handleOneShot(Event *event) { if (event->param == kEvPSetPalette) { PalEntry *palPointer; + + if (_vm->getGameType() == GType_IHNM) { + if (_vm->_spiritualBarometer > 255) + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); + else + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256); + } + _vm->_scene->getBGPal(palPointer); _vm->_gfx->setPalette(palPointer); } diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 8cfd993391..7189dd8050 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -801,16 +801,6 @@ void Interface::draw() { converseDisplayTextLines(backBuffer); } - if (_vm->getGameType() == GType_IHNM) { - if (_vm->_spiritualBarometer > 255) - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); - else - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, - _vm->_spiritualBarometer * _portraitBgColor.red / 256, - _vm->_spiritualBarometer * _portraitBgColor.green / 256, - _vm->_spiritualBarometer * _portraitBgColor.blue / 256); - } - if (_panelMode == kPanelMain || _panelMode == kPanelConverse || _lockedMode == kPanelMain || _lockedMode == kPanelConverse || (_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO)) { @@ -1196,7 +1186,7 @@ bool Interface::processTextInput(uint16 ascii) { if (((ascii >= 'a') && (ascii <='z')) || ((ascii >= '0') && (ascii <='9')) || ((ascii >= 'A') && (ascii <='Z')) || - (ascii == ' ')) { + (ascii == ' ') || (ascii == '-') || (ascii == '_')) { if (_textInputStringLength < SAVE_TITLE_SIZE - 1) { ch[0] = ascii; tempWidth = _vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal); @@ -1808,6 +1798,10 @@ void Interface::drawStatusBar() { if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8) return; + // Don't draw the status bar while fading out + if (_fadeMode == kFadeOut) + return; + backBuffer = _vm->_gfx->getBackBuffer(); // Erase background of status bar diff --git a/engines/saga/interface.h b/engines/saga/interface.h index 7ae225219a..e0e5261d82 100644 --- a/engines/saga/interface.h +++ b/engines/saga/interface.h @@ -379,6 +379,7 @@ private: public: SpriteList _defPortraits; + PalEntry _portraitBgColor; private: SagaEngine *_vm; @@ -416,7 +417,6 @@ private: int _statusOnceColor; int _leftPortrait; int _rightPortrait; - PalEntry _portraitBgColor; Point _lastMousePoint; diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index c49fe546ee..adb3f9feaa 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -561,6 +561,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { Event *q_event; static PalEntry current_pal[PAL_ENTRIES]; + if (loadSceneParams->transitionType == kTransitionFade) + _vm->_interface->setFadeMode(kFadeOut); + // Change the cursor to an hourglass in IHNM event.type = kEvTOneshot; event.code = kCursorEvent; @@ -612,6 +615,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { _vm->_script->setVerb(_vm->_script->getVerbType(kVerbWalkTo)); if (loadSceneParams->sceneDescriptor == -2) { + _vm->_interface->setFadeMode(kNoFade); return; } } @@ -651,11 +655,11 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { debug(3, "Loading scene number %d:", _sceneNumber); - if (_vm->getGameId() == GID_IHNM_DEMO && _sceneNumber == 144) { + if (_vm->getGameId() == GID_IHNM_DEMO && (_sceneNumber >= 144 && _sceneNumber <= 149)) { // WORKAROUND for the non-interactive part of the IHNM demo: When restarting the - // non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if the - // starting scene of the non-interactive demo is loaded (scene 144), set panel to null - // and lock the user interface + // non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if any + // of the scenes of the non-interactive demo are loaded (scenes 144-149), set panel + // to null and lock the user interface _vm->_interface->deactivate(); _vm->_interface->setMode(kPanelNull); } diff --git a/engines/saga/script.h b/engines/saga/script.h index 5e5e702132..002c91cda6 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -597,7 +597,7 @@ private: void sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS); void sfGetPoints(SCRIPTFUNC_PARAMS); void sfSetGlobalFlag(SCRIPTFUNC_PARAMS); - void sf92(SCRIPTFUNC_PARAMS); + void sfDemoSetInteractive(SCRIPTFUNC_PARAMS); void sfClearGlobalFlag(SCRIPTFUNC_PARAMS); void sfTestGlobalFlag(SCRIPTFUNC_PARAMS); void sfSetPoints(SCRIPTFUNC_PARAMS); diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index b0904e6479..0794e236e1 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -230,7 +230,7 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT OPCODE(sfShowIHNMDemoHelpPage), OPCODE(sfVstopFX), OPCODE(sfVstopLoopedFX), - OPCODE(sf92), // only used in the demo version of IHNM + OPCODE(sfDemoSetInteractive), // only used in the demo version of IHNM OPCODE(sfDemoIsInteractive), OPCODE(sfVsetTrack), OPCODE(sfGetPoints), @@ -554,13 +554,10 @@ void Script::sfSetFollower(SCRIPTFUNC_PARAMS) { void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) { int16 sceneNumber; int16 entrance; - int16 transition = 0; // IHNM sceneNumber = thread->pop(); entrance = thread->pop(); if (_vm->getGameType() == GType_IHNM) { - transition = thread->pop(); - _vm->_gfx->setCursor(kCursorBusy); } @@ -1889,6 +1886,18 @@ void Script::sfSetChapterPoints(SCRIPTFUNC_PARAMS) { _vm->_ethicsPoints[chapter] = ethics; _vm->_spiritualBarometer = ethics * 256 / barometer; _vm->_scene->setChapterPointsChanged(true); // don't save this music when saving in IHNM + + if (_vm->_spiritualBarometer > 255) + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); + else + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256); + + PalEntry *palPointer; + _vm->_scene->getBGPal(palPointer); + _vm->_gfx->setPalette(palPointer); } void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) { @@ -2052,9 +2061,16 @@ void Script::sfVstopLoopedFX(SCRIPTFUNC_PARAMS) { _vm->_sound->stopSound(); } -void Script::sf92(SCRIPTFUNC_PARAMS) { - SF_stub("sf92", thread, nArgs); - // This opcode is empty in the full version of IHNM, but it's not empty in the demo +void Script::sfDemoSetInteractive(SCRIPTFUNC_PARAMS) { + int16 interactiveFlag = thread->pop(); + + if (interactiveFlag == 0) { + _vm->_interface->deactivate(); + _vm->_interface->setMode(kPanelNull); + } + + // Note: the original also sets an appropriate flag here, but we don't, + // as we don't use it } void Script::sfDemoIsInteractive(SCRIPTFUNC_PARAMS) { |