[Scummvm-git-logs] scummvm master -> 4598da7ec15f714eb9534a9b9162c9cee0547cfd

lephilousophe noreply at scummvm.org
Sun Nov 16 17:01:09 UTC 2025


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

Summary:
166d284ecf MYST3: Don't use presentBuffer with TinyGL
4598da7ec1 TINYGL: Add opaque support to RLE blitting routine


Commit: 166d284ecf55579c340855c9c6bb5405f0bbda97
    https://github.com/scummvm/scummvm/commit/166d284ecf55579c340855c9c6bb5405f0bbda97
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-16T18:00:43+01:00

Commit Message:
MYST3: Don't use presentBuffer with TinyGL

This is not supported.
Also add missing presentBuffer calls in the OpenGL renderers.

Fixes Trac#16255.

Changed paths:
    engines/myst3/gfx_opengl.cpp
    engines/myst3/gfx_opengl_shaders.cpp
    engines/myst3/gfx_opengl_texture.cpp
    engines/myst3/transition.cpp


diff --git a/engines/myst3/gfx_opengl.cpp b/engines/myst3/gfx_opengl.cpp
index 87be6db3ee9..28686f6a34d 100644
--- a/engines/myst3/gfx_opengl.cpp
+++ b/engines/myst3/gfx_opengl.cpp
@@ -308,6 +308,7 @@ Graphics::Surface *OpenGLRenderer::getScreenshot() {
 	Graphics::Surface *s = new Graphics::Surface();
 	s->create(screen.width(), screen.height(), Texture::getRGBAPixelFormat());
 
+	g_system->presentBuffer();
 	glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_BYTE, s->getPixels());
 
 	flipVertical(s);
diff --git a/engines/myst3/gfx_opengl_shaders.cpp b/engines/myst3/gfx_opengl_shaders.cpp
index 5c9ca164329..925afcd9e62 100644
--- a/engines/myst3/gfx_opengl_shaders.cpp
+++ b/engines/myst3/gfx_opengl_shaders.cpp
@@ -375,6 +375,7 @@ Graphics::Surface *ShaderRenderer::getScreenshot() {
 	Graphics::Surface *s = new Graphics::Surface();
 	s->create(screen.width(), screen.height(), Texture::getRGBAPixelFormat());
 
+	g_system->presentBuffer();
 	glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_BYTE, s->getPixels());
 
 	flipVertical(s);
diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp
index 3484535ee01..3319fa59599 100644
--- a/engines/myst3/gfx_opengl_texture.cpp
+++ b/engines/myst3/gfx_opengl_texture.cpp
@@ -140,6 +140,7 @@ void OpenGLTexture::copyFromFramebuffer(const Common::Rect &screen) {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
+	g_system->presentBuffer();
 	glCopyTexImage2D(GL_TEXTURE_2D, 0, internalFormat, screen.left, screen.top, internalWidth, internalHeight, 0);
 }
 
diff --git a/engines/myst3/transition.cpp b/engines/myst3/transition.cpp
index ecadd66175a..b1509ce878f 100644
--- a/engines/myst3/transition.cpp
+++ b/engines/myst3/transition.cpp
@@ -80,7 +80,6 @@ void Transition::draw(TransitionType type) {
 
 	// Capture a screenshot of the destination node
 	_vm->drawFrame(true);
-	g_system->presentBuffer();
 	Texture *targetScreenshot = _vm->_gfx->copyScreenshotToTexture();
 
 	// Compute the start and end frames for the animation


Commit: 4598da7ec15f714eb9534a9b9162c9cee0547cfd
    https://github.com/scummvm/scummvm/commit/4598da7ec15f714eb9534a9b9162c9cee0547cfd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-16T18:00:43+01:00

Commit Message:
TINYGL: Add opaque support to RLE blitting routine

This fixes Myst3 transitions.
Before commit 5cc4607ff4d6, opaque images had a list of lines generated
covering the whole image.

Changed paths:
    graphics/tinygl/zblit.cpp


diff --git a/graphics/tinygl/zblit.cpp b/graphics/tinygl/zblit.cpp
index 3a508083d6c..b55eeeadb7c 100644
--- a/graphics/tinygl/zblit.cpp
+++ b/graphics/tinygl/zblit.cpp
@@ -397,7 +397,20 @@ void BlitImage::tglBlitRLE(int dstX, int dstY, int srcX, int srcY, int srcWidth,
 		lineIndex++;
 	}
 
-	if (_binaryTransparent || (kDisableBlending || !kEnableAlphaBlending)) { // If bitmap is binary transparent or if  we need complex forms of blending (not just alpha) we need to use writePixel, which is slower
+	if (_opaque) { // This is the degenerate case of RLE where the whole image is affected
+		for (int y = 0; y < clampHeight; y++) {
+			if (kDisableColoring) {
+				memcpy(dstBuf.getRawBuffer(y * fbWidth),
+					srcBuf.getRawBuffer(y * _surface.w), clampWidth * kBytesPerPixel);
+			} else {
+				for(int x = 0; x < clampWidth; x++) {
+					byte aDst, rDst, gDst, bDst;
+					srcBuf.getARGBAt(y * _surface.w + x, aDst, rDst, gDst, bDst);
+					c->fb->writePixel((dstX + x) + (dstY + y) * fbWidth, aDst * aTint, rDst * rTint, gDst * gTint, bDst * bTint);
+				}
+			}
+		}
+	} else if (_binaryTransparent || (kDisableBlending || !kEnableAlphaBlending)) { // If bitmap is binary transparent or if  we need complex forms of blending (not just alpha) we need to use writePixel, which is slower
 		while (lineIndex < _lines.size() && _lines[lineIndex]._y < maxY) {
 			const BlitImage::Line &l = _lines[lineIndex];
 			if (l._x < maxX && l._x + l._length > srcX) {




More information about the Scummvm-git-logs mailing list