[Scummvm-git-logs] scummvm master -> 2e9c21cd84f47c51ebe8a847f2e4c359a106c751

dreammaster dreammaster at scummvm.org
Thu Sep 1 05:13:06 CEST 2016


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:
2e9c21cd84 TITANIC: Improvements to view change animations


Commit: 2e9c21cd84f47c51ebe8a847f2e4c359a106c751
    https://github.com/scummvm/scummvm/commit/2e9c21cd84f47c51ebe8a847f2e4c359a106c751
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-31T23:12:53-04:00

Commit Message:
TITANIC: Improvements to view change animations

Changed paths:
    engines/titanic/game_state.h
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/movie.cpp



diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 70d47b5..9ccf7b2 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -35,7 +35,8 @@ class CGameManager;
 
 enum GameStateMode { 
 	GSMODE_NONE = 0, GSMODE_INTERACTIVE = 1, GSMODE_CUTSCENE = 2,
-	GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_INSERT_CD = 5, GSMODE_PENDING_LOAD = 6
+	GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_INSERT_CD = 5, GSMODE_CLIP = 6,
+	GSMODE_PENDING_LOAD = 7
 };
 
 enum Season {
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index e43127c..79c1bad 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -364,7 +364,7 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
 		_movieFrameSurface[0]->h != r.height();
 
 	startAtFrame(startFrame);
-	while (getFrame() <= (int)endFrame) {
+	while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) {
 		if (isNextFrame()) {
 			renderFrame();
 			_currentFrame = _decoders[0]->getCurFrame();
@@ -378,12 +378,17 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
 			} else {
 				g_vm->_screen->blitFrom(*_movieFrameSurface[0], Common::Point(r.left, r.top));
 			}
+
+			g_vm->_screen->update();
+			g_vm->_events->pollEvents();
 		}
 
 		// Brief wait, and check at the same time for clicks to abort the clip
 		if (g_vm->_events->waitForPress(10))
 			break;
 	}
+
+	stop();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index cfdcecb..647b24d 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -133,8 +133,13 @@ void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame)
 		drawRect.top + (heightLess ? CLIP_HEIGHT_REDUCED : CLIP_HEIGHT)
 	);
 
+	CGameState &gameState = g_vm->_window->_gameManager->_gameState;
+	gameState.setMode(GSMODE_CLIP);
+
 	_aviSurface.setFrame(startFrame);
 	_aviSurface.playCutscene(r, startFrame, endFrame);
+
+	gameState.setMode(GSMODE_INTERACTIVE);
 }
 
 void OSMovie::stop() {





More information about the Scummvm-git-logs mailing list