[Scummvm-cvs-logs] scummvm master -> c80c74e49926daed108f73e115fda7ba5901eb61

dreammaster dreammaster at scummvm.org
Sat Mar 7 23:02:35 CET 2015


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:
c80c74e499 MADS: Refactoring of text/animation views to show outside game loop


Commit: c80c74e49926daed108f73e115fda7ba5901eb61
    https://github.com/scummvm/scummvm/commit/c80c74e49926daed108f73e115fda7ba5901eb61
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-03-07T17:01:07-05:00

Commit Message:
MADS: Refactoring of text/animation views to show outside game loop

Changed paths:
    engines/mads/game.cpp
    engines/mads/nebular/game_nebular.cpp
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/nebular_scenes8.cpp



diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 3b8b053..74c2a3f 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -105,8 +105,6 @@ Game::~Game() {
 }
 
 void Game::run() {
-	initializeGlobals();
-
 	// If requested, load a savegame instead of showing the intro
 	if (ConfMan.hasKey("save_slot")) {
 		int saveSlot = ConfMan.getInt("save_slot");
@@ -116,15 +114,19 @@ void Game::run() {
 
 	_statusFlag = true;
 
-	if (_loadGameSlot == -1) {
-		startGame();
-	}
+	while (!_vm->shouldQuit()) {
+		initializeGlobals();
 
-	// Get the initial starting time for the first scene
-	_scene._frameStartTime = _vm->_events->getFrameCounter();
+		if (_loadGameSlot == -1) {
+			startGame();
+		}
+
+		// Get the initial starting time for the first scene
+		_scene._frameStartTime = _vm->_events->getFrameCounter();
 
-	if (!_vm->shouldQuit())
-		gameLoop();
+		if (!_vm->shouldQuit())
+			gameLoop();
+	}
 }
 
 void Game::splitQuote(const Common::String &source, Common::String &line1, Common::String &line2) {
@@ -140,7 +142,7 @@ void Game::splitQuote(const Common::String &source, Common::String &line1, Commo
 }
 
 void Game::gameLoop() {
-	while (!_vm->shouldQuit() && _statusFlag) {
+	while (!_vm->shouldQuit() && _statusFlag && !_winStatus) {
 		if (_loadGameSlot != -1) {
 			loadGame(_loadGameSlot);
 			_loadGameSlot = -1;
@@ -168,7 +170,8 @@ void Game::gameLoop() {
 }
 
 void Game::sectionLoop() {
-	while (!_vm->shouldQuit() && _statusFlag && (_sectionNumber == _currentSectionNumber)) {
+	while (!_vm->shouldQuit() && _statusFlag && !_winStatus &&
+			(_sectionNumber == _currentSectionNumber)) {
 		_kernelMode = KERNEL_ROOM_PRELOAD;
 		_player._spritesChanged = true;
 		_quoteEmergency = false;
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 965ef7f..8c8d4ab 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -61,6 +61,35 @@ ProtectionResult GameNebular::checkCopyProtection() {
 }
 
 void GameNebular::startGame() {
+	// First handle any ending credits from a just finished game session.
+	// Note that, with the exception of the decompression ending, which doesn't
+	// use animations, the remaining animations will automatically launch their
+	// own text view credits when the animation is completed
+	switch (_winStatus) {
+	case 1:
+		// No shields failure ending
+		AnimationView::execute(_vm, "rexend1");
+		break;
+	case 2:
+		// Shields, but no targetting failure ending
+		AnimationView::execute(_vm, "rexend2");
+		break;
+	case 3:
+		// Completed game successfully, so activate quotes item on the main menu
+		ConfMan.setBool("ShowQuotes", true);
+		ConfMan.flushToDisk();
+
+		AnimationView::execute(_vm, "rexend3");
+		break;
+	case 4:
+		// Decompression ending
+		TextView::execute(_vm, "ending4");
+		break;
+	}
+
+	checkShowDialog();
+	_winStatus = 0;
+
 	/*
 	// Check copy protection
 	ProtectionResult protectionResult = checkCopyProtection();
@@ -310,32 +339,9 @@ void GameNebular::setSectionHandler() {
 }
 
 void GameNebular::checkShowDialog() {
-	// Handling to start endgame sequences if the win/lose type has been set
-	switch (_winStatus) {
-	case 1:
-		// No shields failure ending
-		AnimationView::execute(_vm, "rexend1");
-		break;
-	case 2:
-		// Shields, but no targetting failure ending
-		AnimationView::execute(_vm, "rexend2");
-		break;
-	case 3:
-		// Completed game successfully, so activate quotes item on the main menu
-		ConfMan.setBool("ShowQuotes", true);
-		ConfMan.flushToDisk();
-
-		AnimationView::execute(_vm, "rexend3");
-		break;
-	case 4:
-		// Decompression ending
-		TextView::execute(_vm, "ending4");
-		break;
-	}
-	_winStatus = 0;
-
 	// Loop for showing dialogs, if any need to be shown
-	if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) {
+	if (_vm->_dialogs->_pendingDialog && (_player._stepEnabled || _winStatus) 
+			&& !_globals[kCopyProtectFailed]) {
 		_player.releasePlayerSprites();
 
 		// Make a thumbnail in case it's needed for making a savegame
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 2fdef34..358a978 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -136,12 +136,14 @@ void MainMenu::doFrame() {
 			addSpriteSlot();
 		}
 
+		_vm->_events->setCursor(CURSOR_ARROW);
 		_vm->_events->showCursor();
 	} else {
 		if ((_menuItemIndex == -1) || (_frameIndex == 0)) {
 			if (++_menuItemIndex == 6) {
 
 				// Reached end of display animation
+				_vm->_events->setCursor(CURSOR_ARROW);
 				_vm->_events->showCursor();
 				return;
 			} else if (_menuItemIndex == 4 && !shouldShowQuotes()) {
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index 4b8d7d5..8a30f88 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -719,7 +719,7 @@ void Scene803::step() {
 			else
 				_game._winStatus = 3;
 
-			_vm->quitGame();
+			return;
 		}
 	}
 
@@ -957,7 +957,7 @@ void Scene804::step() {
 
 				assert(!_globals[kCopyProtectFailed]);
 				_game._winStatus = 4;
-				_vm->quitGame();
+				return;
 			}
 			break;
 
@@ -969,7 +969,7 @@ void Scene804::step() {
 
 				assert(!_globals[kCopyProtectFailed]);
 				_game._winStatus = 4;
-				_vm->quitGame();
+				return;
 			}
 		}
 






More information about the Scummvm-git-logs mailing list