aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/saga/events.cpp11
-rw-r--r--engines/saga/interface.cpp16
-rw-r--r--engines/saga/interface.h2
-rw-r--r--engines/saga/scene.cpp12
-rw-r--r--engines/saga/script.h2
-rw-r--r--engines/saga/sfuncs.cpp30
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) {