[Scummvm-git-logs] scummvm master -> dd36213ebeae9723735b0aeaa3c278b215c96e21
lephilousophe
noreply at scummvm.org
Sat May 3 10:19:34 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:
b9ee89daee OPENGL: Apply UNPACK_ALIGNMENT at the proper time
dd36213ebe BACKENDS: OPENGL: Add support for RGB888/BGR888
Commit: b9ee89daee8c1ef7cf746e27573b5718d96ed530
https://github.com/scummvm/scummvm/commit/b9ee89daee8c1ef7cf746e27573b5718d96ed530
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-05-03T12:18:06+02:00
Commit Message:
OPENGL: Apply UNPACK_ALIGNMENT at the proper time
UNPACK_ALIGNMENT is tied to the context and not the texture.
It is used when transferring data to GL: when calling glTex(Sub)Image.
Set it up at this time to make sure the value is correct and not mangled
by other parts of the code.
Changed paths:
backends/graphics3d/android/texture.cpp
graphics/opengl/texture.cpp
diff --git a/backends/graphics3d/android/texture.cpp b/backends/graphics3d/android/texture.cpp
index 43602362a87..9572af9f89a 100644
--- a/backends/graphics3d/android/texture.cpp
+++ b/backends/graphics3d/android/texture.cpp
@@ -216,7 +216,6 @@ void GLESBaseTexture::initSize() {
// Allocate room for the texture now, but pixel data gets uploaded
// later (perhaps with multiple TexSubImage2D operations).
GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name));
- GLCALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1));
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _glFilter));
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _glFilter));
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
diff --git a/graphics/opengl/texture.cpp b/graphics/opengl/texture.cpp
index d2443f49bb3..720fb6bb40a 100644
--- a/graphics/opengl/texture.cpp
+++ b/graphics/opengl/texture.cpp
@@ -117,7 +117,6 @@ void Texture::create() {
// Set up all texture parameters.
bind();
- GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _glFilter));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _glFilter));
if (OpenGLContext.textureEdgeClampSupported) {
@@ -210,6 +209,7 @@ void Texture::updateArea(const Common::Rect &area, const Graphics::Surface &src)
//
// 3) Use glTexSubImage2D per line changed. This is what the old OpenGL
// graphics manager did but it is much slower! Thus, we do not use it.
+ GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1));
GL_CALL(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, area.top, src.w, area.height(),
_glFormat, _glType, src.getBasePtr(0, area.top)));
}
Commit: dd36213ebeae9723735b0aeaa3c278b215c96e21
https://github.com/scummvm/scummvm/commit/dd36213ebeae9723735b0aeaa3c278b215c96e21
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-05-03T12:18:07+02:00
Commit Message:
BACKENDS: OPENGL: Add support for RGB888/BGR888
This format is supported by OpenGL, GLES and GLES2 and is used by
Android.
Changed paths:
backends/graphics/opengl/opengl-graphics.cpp
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 9e5a792e820..958c815480f 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -1550,6 +1550,15 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF
glFormat = GL_RGBA;
glType = GL_UNSIGNED_BYTE;
return true;
+#ifdef SCUMM_LITTLE_ENDIAN
+ } else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0)) { // BGR888
+#else
+ } else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) { // RGB888
+#endif
+ glIntFormat = GL_RGB;
+ glFormat = GL_RGB;
+ glType = GL_UNSIGNED_BYTE;
+ return true;
} else if (!OpenGLContext.packedPixelsSupported) {
return false;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
More information about the Scummvm-git-logs
mailing list