aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp6
-rw-r--r--engines/mads/nebular/menu_nebular.cpp22
-rw-r--r--engines/mads/nebular/menu_nebular.h5
-rw-r--r--engines/mads/nebular/sound_nebular.cpp1
4 files changed, 31 insertions, 3 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 57edbf9c19..f5702ccb31 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -571,8 +571,10 @@ void FullScreenDialog::display() {
int currentSceneId = scene._currentSceneId;
int priorSceneId = scene._priorSceneId;
- SceneInfo *sceneInfo = SceneInfo::init(_vm);
- sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface);
+ if (_screenId > 0) {
+ SceneInfo *sceneInfo = SceneInfo::init(_vm);
+ sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface);
+ }
scene._priorSceneId = priorSceneId;
scene._currentSceneId = currentSceneId;
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 88453ecdba..05d1954515 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -65,6 +65,7 @@ void MenuView::show() {
}
events.setEventTarget(nullptr);
+ _vm->_sound->stop();
}
void MenuView::display() {
@@ -73,6 +74,16 @@ void MenuView::display() {
FullScreenDialog::display();
}
+bool MenuView::onEvent(Common::Event &event) {
+ if (event.type == Common::EVENT_KEYDOWN || event.type == Common::EVENT_LBUTTONDOWN) {
+ _breakFlag = true;
+ _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU;
+ return true;
+ }
+
+ return false;
+}
+
/*------------------------------------------------------------------------*/
MainMenu::MainMenu(MADSEngine *vm): MenuView(vm) {
@@ -429,6 +440,7 @@ TextView::TextView(MADSEngine *vm) : MenuView(vm) {
_scrollTimeout = 0;
_panCountdown = 0;
_translationX = 0;
+ _screenId = -1;
_font = _vm->_font->getFont(FONT_CONVERSATION);
_vm->_palette->resetGamePalette(4, 0);
@@ -495,6 +507,7 @@ void TextView::processLines() {
}
void TextView::processCommand() {
+ Scene &scene = _vm->_game->_scene;
Common::String scriptLine(_currentLine + 1);
scriptLine.toUppercase();
const char *paramP;
@@ -503,8 +516,14 @@ void TextView::processCommand() {
if (!strncmp(commandStr, "BACKGROUND", 10)) {
// Set the background
paramP = commandStr + 10;
- _screenId = getParameter(&paramP);
+ resetPalette();
+ int screenId = getParameter(&paramP);
+ SceneInfo *sceneInfo = SceneInfo::init(_vm);
+ sceneInfo->load(screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface);
+ scene._spriteSlots.fullRefresh();
+ _redrawFlag = true;
+
} else if (!strncmp(commandStr, "GO", 2)) {
_animating = true;
@@ -748,6 +767,7 @@ void TextView::doFrame() {
void TextView::scriptDone() {
_breakFlag = true;
+ _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU;
}
/*------------------------------------------------------------------------*/
diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h
index 767183c4b9..ede4a23970 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -44,6 +44,11 @@ protected:
virtual void doFrame() = 0;
virtual void display();
+
+ /**
+ * Event handler
+ */
+ virtual bool onEvent(Common::Event &event);
public:
MenuView(MADSEngine *vm);
diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp
index 4c6070b528..b46863cea3 100644
--- a/engines/mads/nebular/sound_nebular.cpp
+++ b/engines/mads/nebular/sound_nebular.cpp
@@ -217,6 +217,7 @@ ASound::~ASound() {
delete[] (*i)._data;
_mixer->stopHandle(_soundHandle);
+ _opl->reset();
delete _opl;
}