[Scummvm-git-logs] scummvm master -> 7309118b2d29a16dc9afb52451832a541e2efe3c

mgerhardy noreply at scummvm.org
Wed Jan 3 12:37:36 UTC 2024


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

Summary:
0059a00afb TWINE: enforce redraw after switching disabling the scene zoom
7309118b2d TWINE: fixed scenery zoom issue #14795


Commit: 0059a00afbf398a5b2e6b8f4a51b72823d668256
    https://github.com/scummvm/scummvm/commit/0059a00afbf398a5b2e6b8f4a51b72823d668256
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-01-03T13:36:37+01:00

Commit Message:
TWINE: enforce redraw after switching disabling the scene zoom

Changed paths:
    engines/twine/twine.cpp


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 5184cb98cf8..df9c421e1fb 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -973,6 +973,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 				extInitMcga();
 			} else {
 				extInitSvga();
+				_redraw->_firstTime = true;
 			}
 		}
 	}


Commit: 7309118b2d29a16dc9afb52451832a541e2efe3c
    https://github.com/scummvm/scummvm/commit/7309118b2d29a16dc9afb52451832a541e2efe3c
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-01-03T13:36:58+01:00

Commit Message:
TWINE: fixed scenery zoom issue #14795

see https://bugs.scummvm.org/ticket/14795

NOTE: this might not be the most optimized solution...

Changed paths:
    engines/twine/renderer/redraw.cpp
    engines/twine/renderer/redraw.h
    engines/twine/twine.cpp


diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index b5cfb049c5a..ccbf5400e28 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -871,10 +871,6 @@ void Redraw::redrawEngineActions(bool bgRedraw) { // AffScene
 		}
 		_engine->_screens->_fadePalette = false;
 	}
-
-	if (_flagMCGA) {
-		zoomScreenScale();
-	}
 }
 
 void Redraw::drawBubble(int32 actorIdx) {
@@ -909,17 +905,4 @@ void Redraw::drawBubble(int32 actorIdx) {
 	}
 }
 
-void Redraw::zoomScreenScale() {
-	Graphics::ManagedSurface zoomWorkVideoBuffer(_engine->_workVideoBuffer);
-	const int maxW = zoomWorkVideoBuffer.w;
-	const int maxH = zoomWorkVideoBuffer.h;
-	const int left = CLIP<int>(_sceneryViewX - maxW / 4, 0, maxW / 2);
-	const int top = CLIP<int>(_sceneryViewY - maxH / 4, 0, maxH / 2);
-	const Common::Rect srcRect(left, top, left + maxW / 2, top + maxH / 2);
-	const Common::Rect& destRect = zoomWorkVideoBuffer.getBounds();
-	zoomWorkVideoBuffer.transBlitFrom(_engine->_frontVideoBuffer, srcRect, destRect);
-	g_system->copyRectToScreen(zoomWorkVideoBuffer.getPixels(), zoomWorkVideoBuffer.pitch, 0, 0, zoomWorkVideoBuffer.w, zoomWorkVideoBuffer.h);
-	g_system->updateScreen();
-}
-
 } // namespace TwinE
diff --git a/engines/twine/renderer/redraw.h b/engines/twine/renderer/redraw.h
index 5e6caf011c5..c8d49f9b56f 100644
--- a/engines/twine/renderer/redraw.h
+++ b/engines/twine/renderer/redraw.h
@@ -190,11 +190,6 @@ public:
 	 * @param listSize number of drawing objects in the list
 	 */
 	void sortDrawingList(DrawListStruct *list, int32 listSize) const;
-
-	/**
-	 * Zooms the area around the scenery view focus positions
-	 */
-	void zoomScreenScale();
 };
 
 } // namespace TwinE
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index df9c421e1fb..9b07266e74d 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -23,8 +23,6 @@
 #include "common/config-manager.h"
 #include "common/debug.h"
 #include "common/error.h"
-#include "common/events.h"
-#include "common/keyboard.h"
 #include "common/savefile.h"
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -38,10 +36,8 @@
 #include "graphics/font.h"
 #include "graphics/fontman.h"
 #include "graphics/managed_surface.h"
-#include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "graphics/surface.h"
-#include "gui/debugger.h"
 #include "twine/audio/music.h"
 #include "twine/audio/sound.h"
 #include "twine/debugger/console.h"
@@ -123,6 +119,21 @@ void TwineScreen::update() {
 		return;
 	}
 	_lastFrame = _engine->_frameCounter;
+
+	if (_engine->_redraw->_flagMCGA) {
+		markAllDirty();
+		Graphics::ManagedSurface zoomWorkVideoBuffer(_engine->_workVideoBuffer);
+		const int maxW = zoomWorkVideoBuffer.w;
+		const int maxH = zoomWorkVideoBuffer.h;
+		const int left = CLIP<int>(_engine->_redraw->_sceneryViewX - maxW / 4, 0, maxW / 2);
+		const int top = CLIP<int>(_engine->_redraw->_sceneryViewY - maxH / 4, 0, maxH / 2);
+		const Common::Rect srcRect(left, top, left + maxW / 2, top + maxH / 2);
+		const Common::Rect& destRect = zoomWorkVideoBuffer.getBounds();
+		zoomWorkVideoBuffer.blitFrom(*this, srcRect, destRect);
+		blitFrom(zoomWorkVideoBuffer);
+		// TODO: we need to redraw everything
+		_engine->_redraw->_firstTime = true;
+	}
 	Super::update();
 }
 
@@ -950,7 +961,6 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 			_text->setFontColor(COLOR_WHITE);
 			if (_redraw->_flagMCGA) {
 				_text->drawText(_redraw->_sceneryViewX + 5, _redraw->_sceneryViewY, PauseString);
-				_redraw->zoomScreenScale();
 			} else {
 				const int width = _text->getTextSize(PauseString);
 				const int bottom = height() - _text->lineHeight;




More information about the Scummvm-git-logs mailing list