[Scummvm-git-logs] scummvm master -> a0acbc8548f018890fec9e87b538bdc54c910aec

Die4Ever noreply at scummvm.org
Thu Dec 9 13:24:19 UTC 2021


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:
a0acbc8548 GROOVIE: switchToFullScreen retain image, fixes Samantha's moves


Commit: a0acbc8548f018890fec9e87b538bdc54c910aec
    https://github.com/scummvm/scummvm/commit/a0acbc8548f018890fec9e87b538bdc54c910aec
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2021-12-09T07:23:54-06:00

Commit Message:
GROOVIE: switchToFullScreen retain image, fixes Samantha's moves

This fixes the graphical bug where when Samantha made a mode, especially in the cake puzzle, the background layer was empty. This is because switchToFullScreen was being called AFTER restoreScreen

Changed paths:
    engines/groovie/graphics.cpp
    engines/groovie/video/roq.cpp
    engines/groovie/video/roq.h


diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index a570dde85b..73a0f6b89a 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -77,15 +77,19 @@ void GraphicsMan::update() {
 }
 
 void GraphicsMan::switchToFullScreen(bool fullScreen) {
+	// retain the image we currently have, Samantha's moves depend on this
+	_background.copyFrom(_foreground);
 	_foreground.free();
-	_background.free();
 
 	if (fullScreen) {
 		_foreground.create(640, 480, _vm->_pixelFormat);
+		_foreground.copyRectToSurface(_background, 0, 80, Common::Rect(0, 0, 640, 320));
+		_background.free();
 		_background.create(640, 480, _vm->_pixelFormat);
 	} else {
-		// _vm->_system->fillScreen(0);
 		_foreground.create(640, 320, _vm->_pixelFormat);
+		_foreground.copyRectToSurface(_background, 0, 0, Common::Rect(0, 80, 640, 400));
+		_background.free();
 		_background.create(640, 320, _vm->_pixelFormat);
 	}
 
diff --git a/engines/groovie/video/roq.cpp b/engines/groovie/video/roq.cpp
index 373ae60186..1fe7b314f8 100644
--- a/engines/groovie/video/roq.cpp
+++ b/engines/groovie/video/roq.cpp
@@ -146,8 +146,8 @@ uint16 ROQPlayer::loadInternal() {
 	// Flags:
 	// - 2 For overlay videos, show the whole video
 	// - 14 Manual flag indication alternate motion copy decoder
-	_flagOne = ((_flags & (1 << 1)) != 0);
-	_flagTwo = ((_flags & (1 << 2)) != 0);
+	_flagNoPlay = ((_flags & (1 << 1)) != 0);
+	_flagOverlay = ((_flags & (1 << 2)) != 0);
 	_altMotionDecoder = ((_flags & (1 << 14)) != 0);
 	_flagMasked = ((_flags & (1 << 10)) != 0);
 
@@ -168,8 +168,8 @@ uint16 ROQPlayer::loadInternal() {
 
 	// Clear the dirty flag and restore area
 	_dirty = false;
-	_restoreArea->top = 480;
-	_restoreArea->left = 640;
+	_restoreArea->top = 0;
+	_restoreArea->left = 0;
 	_restoreArea->bottom = 0;
 	_restoreArea->right = 0;
 
@@ -248,8 +248,8 @@ void ROQPlayer::buildShowBuf() {
 		}
 
 		// Reset _restoreArea for the next frame
-		_restoreArea->top = 480;
-		_restoreArea->left = 640;
+		_restoreArea->top = 0;
+		_restoreArea->left = 0;
 		_restoreArea->bottom = 0;
 		_restoreArea->right = 0;
 	}
@@ -264,8 +264,8 @@ void ROQPlayer::buildShowBuf() {
 		srcBuf = _bg;
 		maskBuf = _currBuf;
 	}
-	if (_flagOne) {
-		if (_flagTwo) {
+	if (_flagNoPlay) {
+		if (_flagOverlay) {
 			destBuf = _overBuf;
 		} else {
 			destBuf = _bg;
@@ -322,7 +322,7 @@ void ROQPlayer::buildShowBuf() {
 		}
 	}
 
-	if (!_flagOne) {
+	if (!_flagNoPlay) {
 		_vm->_system->unlockScreen();
 		_vm->_system->updateScreen();
 	}
@@ -364,7 +364,7 @@ bool ROQPlayer::playFrameInternal() {
 		_syst->updateScreen();
 
 		// TODO: For overlay videos, set the background buffer when the video ends
-		if (_alpha && (!_flagTwo || _file->eos())) {
+		if (_alpha && (!_flagOverlay || _file->eos())) {
 			//_bg->copyFrom(*_fg);
 		}
 
diff --git a/engines/groovie/video/roq.h b/engines/groovie/video/roq.h
index 86d37f54c6..11bc050987 100644
--- a/engines/groovie/video/roq.h
+++ b/engines/groovie/video/roq.h
@@ -69,7 +69,7 @@ private:
 	bool processBlockSoundMono(ROQBlockHeader &blockHeader);
 	bool processBlockSoundStereo(ROQBlockHeader &blockHeader);
 	bool processBlockAudioContainer(ROQBlockHeader &blockHeader);
-	bool playFirstFrame() { return _flagOne; }; // _alpha && !_flagTwo; }
+	bool playFirstFrame() { return _flagNoPlay; }; // _alpha && !_flagOverlay; }
 
 	void paint2(byte i, int destx, int desty);
 	void paint4(byte i, int destx, int desty);
@@ -93,8 +93,8 @@ private:
 	byte _codebook4[256 * 4];
 
 	// Flags
-	bool _flagOne;	 //!< Play only first frame and do not print the image to the screen
-	bool _flagTwo;	 //!< If _flagOne is set. Copy frame to the foreground otherwise to the background
+	bool _flagNoPlay;	 //!< Play only first frame and do not print the image to the screen
+	bool _flagOverlay;	 //!< If _flagNoPlay is set. Copy frame to the foreground otherwise to the background
 	bool _altMotionDecoder; // Some ROQ vids use a variation on the copy codeblock
 	bool _flagMasked; //!< Clear the video instead of play it, used in pente
 




More information about the Scummvm-git-logs mailing list