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

sev- noreply at scummvm.org
Mon Feb 10 21:19:17 UTC 2025


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:
8e64933c54 VIDEO: QTVR: Stretch object movies when requested
d315e2bed9 DIRECTOR: XTRAS: Do not stretch image coming from QTVR object


Commit: 8e64933c54ec1734645785a329078835c2cccd47
    https://github.com/scummvm/scummvm/commit/8e64933c54ec1734645785a329078835c2cccd47
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-10T22:17:14+01:00

Commit Message:
VIDEO: QTVR: Stretch object movies when requested

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index ec0eaa4d6b4..27b58ba76e8 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -144,6 +144,15 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 		_height = h;
 
 		setFOV(_fov);
+	} if (_qtvrType == QTVRType::OBJECT) {
+		if (_width != w)
+			_scaleFactorX *= Common::Rational(_width, w);
+
+		if (_height != h)
+			_scaleFactorY *= Common::Rational(_height, h);
+
+		_width = w;
+		_height = h;
 	}
 }
 


Commit: d315e2bed991cd1e4eeaad53cedf0bf5628cd326
    https://github.com/scummvm/scummvm/commit/d315e2bed991cd1e4eeaad53cedf0bf5628cd326
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-10T22:18:30+01:00

Commit Message:
DIRECTOR: XTRAS: Do not stretch image coming from QTVR object

It is being returned at the requested size from the QTVR player now

Changed paths:
    engines/director/lingo/xtras/qtvrxtra.cpp
    engines/director/lingo/xtras/qtvrxtra.h


diff --git a/engines/director/lingo/xtras/qtvrxtra.cpp b/engines/director/lingo/xtras/qtvrxtra.cpp
index 23930134706..0342a77358e 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -241,7 +241,6 @@ QtvrxtraXtraObject::QtvrxtraXtraObject(ObjectType ObjectType) :Object<QtvrxtraXt
 	_objType = ObjectType;
 
 	_video = nullptr;
-	_targetSurface = nullptr;
 
 	_visible = false;
 	_quality = 0.0f;
@@ -385,11 +384,6 @@ void QtvrxtraXtra::m_QTVRClose(int nargs) {
 
 		delete me->_widget;
 	}
-
-	if (me->_targetSurface) {
-		me->_targetSurface->free();
-		delete me->_targetSurface;
-	}
 }
 
 XOBJSTUB(QtvrxtraXtra::m_QTVRUpdate, 0)
@@ -419,18 +413,10 @@ void QtvrxtraXtra::m_QTVRIdle(int nargs) {
 	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
 	Graphics::Surface const *frame = me->_video->decodeNextFrame();
 
-	if (!me->_targetSurface) {
-		me->_targetSurface = new Graphics::Surface();
-		me->_targetSurface->create(me->_rect.width(), me->_rect.height(), g_director->_pixelformat);
-	}
-
-	Common::Rect bbox(0, 0, me->_video->getWidth(), me->_video->getHeight());
-
-	copyStretchImg(frame, me->_targetSurface, bbox, me->_rect);
+	Graphics::Surface *dither = frame->convertTo(g_director->_wm->_pixelformat, me->_video->getPalette(), 256, g_director->getPalette(), 256, Graphics::kDitherNaive);
 
 	g_director->getCurrentWindow()->getSurface()->copyRectToSurface(
-		me->_targetSurface->getPixels(), me->_targetSurface->pitch,
-		me->_rect.left, me->_rect.top, me->_targetSurface->w, me->_targetSurface->h
+		dither->getPixels(), dither->pitch, me->_rect.left, me->_rect.top, dither->w, dither->h
 	);
 }
 
diff --git a/engines/director/lingo/xtras/qtvrxtra.h b/engines/director/lingo/xtras/qtvrxtra.h
index 2954500d2e5..c1cba9d20b6 100644
--- a/engines/director/lingo/xtras/qtvrxtra.h
+++ b/engines/director/lingo/xtras/qtvrxtra.h
@@ -46,7 +46,6 @@ public:
 
 	Video::QuickTimeDecoder *_video;
 	QtvrxtraWidget *_widget;
-	Graphics::Surface *_targetSurface;
 
 	Common::Rect _rect;
 	bool _visible;




More information about the Scummvm-git-logs mailing list