[Scummvm-cvs-logs] scummvm master -> 350cd83050c5022296b31f2228d0d56e36b413bd

dreammaster dreammaster at scummvm.org
Sat Sep 6 03:34:35 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
350cd83050 MADS: Fix starting TextView palette setup and scroll ending


Commit: 350cd83050c5022296b31f2228d0d56e36b413bd
    https://github.com/scummvm/scummvm/commit/350cd83050c5022296b31f2228d0d56e36b413bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-09-05T21:33:38-04:00

Commit Message:
MADS: Fix starting TextView palette setup and scroll ending

Changed paths:
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/menu_nebular.h
    engines/mads/nebular/sound_nebular.cpp



diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 57edbf9..f5702cc 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 88453ec..05d1954 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 767183c..ede4a23 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 4c6070b..b46863c 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;
 }
 






More information about the Scummvm-git-logs mailing list