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

dreammaster dreammaster at scummvm.org
Wed Nov 23 01:25:34 CET 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:
2a20ce75c3 TITANIC: Defer creating movie frame surfaces until renderFrame


Commit: 2a20ce75c3ca2f8e6f4a02e571e373f19a8ec115
    https://github.com/scummvm/scummvm/commit/2a20ce75c3ca2f8e6f4a02e571e373f19a8ec115
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-22T19:25:23-05:00

Commit Message:
TITANIC: Defer creating movie frame surfaces until renderFrame

Changed paths:
    engines/titanic/support/avi_surface.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 79614d2c..17a6fcf 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -227,13 +227,11 @@ void AVISurface::setupDecompressor() {
 		return;
 
 	for (int idx = 0; idx < _streamCount; ++idx) {
-		// Setup frame surface
-		_movieFrameSurface[idx] = new Graphics::ManagedSurface(_decoder->getWidth(), _decoder->getHeight(),
-			_decoder->getVideoTrack(idx).getPixelFormat());
-
+		Graphics::PixelFormat format = _decoder->getVideoTrack(idx).getPixelFormat();
+		int decoderPitch = _decoder->getWidth() * format.bytesPerPixel;
 		bool flag = false;
-		if (idx == 0 && _videoSurface &&
-				_videoSurface->getPitch() == _movieFrameSurface[idx]->pitch) {
+
+		if (idx == 0 && _videoSurface && _videoSurface->getPitch() == decoderPitch) {
 			const uint bitCount = _decoder->getVideoTrack(0).getBitCount();
 			const int vDepth = _videoSurface->getPixelDepth();
 
@@ -314,6 +312,12 @@ bool AVISurface::renderFrame() {
 		const Graphics::Surface *frame = (idx == 0) ?
 			_decoder->decodeNextFrame() : _decoder->decodeNextTransparency();
 
+		if (!_movieFrameSurface[idx]) {
+			// Setup frame surface
+			_movieFrameSurface[idx] = new Graphics::ManagedSurface(_decoder->getWidth(), _decoder->getHeight(),
+				_decoder->getVideoTrack(idx).getPixelFormat());
+		}
+
 		if (_movieFrameSurface[idx]->format == frame->format) {
 			_movieFrameSurface[idx]->blitFrom(*frame);
 		} else {





More information about the Scummvm-git-logs mailing list