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

aquadran noreply at scummvm.org
Sat Dec 4 21:15:46 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:
f155d1796c PLAYGROUND3D: Drop BGRA pixel format


Commit: f155d1796c9d0fc92502282510b9aa0c812b888b
    https://github.com/scummvm/scummvm/commit/f155d1796c9d0fc92502282510b9aa0c812b888b
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-04T22:15:39+01:00

Commit Message:
PLAYGROUND3D: Drop BGRA pixel format

Changed paths:
    engines/playground3d/gfx_opengl.cpp
    engines/playground3d/gfx_opengl_shaders.cpp
    engines/playground3d/gfx_tinygl.cpp


diff --git a/engines/playground3d/gfx_opengl.cpp b/engines/playground3d/gfx_opengl.cpp
index b584f8598a..ff8bf8a37e 100644
--- a/engines/playground3d/gfx_opengl.cpp
+++ b/engines/playground3d/gfx_opengl.cpp
@@ -121,10 +121,6 @@ void OpenGLRenderer::loadTextureRGBA(Graphics::Surface *texture) {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->w, texture->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->getPixels());
-	glBindTexture(GL_TEXTURE_2D, _textureRgbaId[1]);
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->w, texture->h, 0, GL_BGRA, GL_UNSIGNED_BYTE, texture->getPixels());
 }
 
 void OpenGLRenderer::loadTextureRGB(Graphics::Surface *texture) {
@@ -323,13 +319,6 @@ void OpenGLRenderer::drawRgbaTexture() {
 
 	glTranslatef(0.5, 0, 0);
 
-	glVertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), bitmapVertices);
-	glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), textCords);
-	glBindTexture(GL_TEXTURE_2D, _textureRgbaId[1]);
-	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
-	glTranslatef(0.5, 0, 0);
-
 	glVertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), bitmapVertices);
 	glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), textCords);
 	glBindTexture(GL_TEXTURE_2D, _textureRgbId[0]);
@@ -342,14 +331,14 @@ void OpenGLRenderer::drawRgbaTexture() {
 	glBindTexture(GL_TEXTURE_2D, _textureRgb565Id[0]);
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
-	glTranslatef(-1.5, -0.5, 0);
+	glTranslatef(0.5, 0, 0);
 
 	glVertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), bitmapVertices);
 	glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), textCords);
 	glBindTexture(GL_TEXTURE_2D, _textureRgba5551Id[0]);
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
-	glTranslatef(0.5, 0, 0);
+	glTranslatef(-1.5, -0.5, 0);
 
 	glVertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), bitmapVertices);
 	glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), textCords);
diff --git a/engines/playground3d/gfx_opengl_shaders.cpp b/engines/playground3d/gfx_opengl_shaders.cpp
index 3405915fde..fb3156b1b7 100644
--- a/engines/playground3d/gfx_opengl_shaders.cpp
+++ b/engines/playground3d/gfx_opengl_shaders.cpp
@@ -222,28 +222,22 @@ void ShaderRenderer::drawRgbaTexture() {
 	offset.setX(-0.3);
 	offset.setY(0.8);
 	_bitmapShader->setUniform("offsetXY", offset);
-	glBindTexture(GL_TEXTURE_2D, _textureRgbaId[1]);
+	glBindTexture(GL_TEXTURE_2D, _textureRgbId[0]);
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
 	offset.setX(0.2);
 	offset.setY(0.8);
 	_bitmapShader->setUniform("offsetXY", offset);
-	glBindTexture(GL_TEXTURE_2D, _textureRgbId[0]);
+	glBindTexture(GL_TEXTURE_2D, _textureRgb565Id[0]);
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
 	offset.setX(0.7);
 	offset.setY(0.8);
 	_bitmapShader->setUniform("offsetXY", offset);
-	glBindTexture(GL_TEXTURE_2D, _textureRgb565Id[0]);
-	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
-	offset.setX(-0.8);
-	offset.setY(0.2);
-	_bitmapShader->setUniform("offsetXY", offset);
 	glBindTexture(GL_TEXTURE_2D, _textureRgba5551Id[0]);
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
-	offset.setX(-0.3);
+	offset.setX(-0.8);
 	offset.setY(0.2);
 	_bitmapShader->setUniform("offsetXY", offset);
 	glBindTexture(GL_TEXTURE_2D, _textureRgba4444Id[0]);
diff --git a/engines/playground3d/gfx_tinygl.cpp b/engines/playground3d/gfx_tinygl.cpp
index bbb6d1a67b..c8a85cc409 100644
--- a/engines/playground3d/gfx_tinygl.cpp
+++ b/engines/playground3d/gfx_tinygl.cpp
@@ -131,10 +131,6 @@ void TinyGLRenderer::loadTextureRGBA(Graphics::Surface *texture) {
 	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MIN_FILTER, TGL_NEAREST);
 	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MAG_FILTER, TGL_NEAREST);
 	tglTexImage2D(TGL_TEXTURE_2D, 0, TGL_RGBA, texture->w, texture->h, 0, TGL_RGBA, TGL_UNSIGNED_BYTE, texture->getPixels());
-	tglBindTexture(TGL_TEXTURE_2D, _textureRgbaId[1]);
-	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MIN_FILTER, TGL_NEAREST);
-	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MAG_FILTER, TGL_NEAREST);
-	tglTexImage2D(TGL_TEXTURE_2D, 0, TGL_RGBA, texture->w, texture->h, 0, TGL_BGRA, TGL_UNSIGNED_BYTE, texture->getPixels());
 	tglUploadBlitImage(_blitImageRgba, *texture, 0, false);
 }
 
@@ -352,32 +348,25 @@ void TinyGLRenderer::drawRgbaTexture() {
 
 	tglVertexPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), bitmapVertices);
 	tglTexCoordPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), textCords);
-	tglBindTexture(TGL_TEXTURE_2D, _textureRgbaId[1]);
+	tglBindTexture(TGL_TEXTURE_2D, _textureRgbId[0]);
 	tglDrawArrays(TGL_TRIANGLE_STRIP, 0, 4);
 
 	tglTranslatef(0.501, 0, 0);
 	//tglTranslatef(0.5, 0, 0); // some gfx issue
 
-	tglVertexPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), bitmapVertices);
-	tglTexCoordPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), textCords);
-	tglBindTexture(TGL_TEXTURE_2D, _textureRgbId[0]);
-	tglDrawArrays(TGL_TRIANGLE_STRIP, 0, 4);
-
-	tglTranslatef(0.5, 0, 0);
-
 	tglVertexPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), bitmapVertices);
 	tglTexCoordPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), textCords);
 	tglBindTexture(TGL_TEXTURE_2D, _textureRgb565Id[0]);
 	tglDrawArrays(TGL_TRIANGLE_STRIP, 0, 4);
 
-	tglTranslatef(-1.5, -0.5, 0);
+	tglTranslatef(0.5, 0, 0);
 
 	tglVertexPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), bitmapVertices);
 	tglTexCoordPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), textCords);
 	tglBindTexture(TGL_TEXTURE_2D, _textureRgba5551Id[0]);
 	tglDrawArrays(TGL_TRIANGLE_STRIP, 0, 4);
 
-	tglTranslatef(0.5, 0, 0);
+	tglTranslatef(-1.5, -0.5, 0);
 
 	tglVertexPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), bitmapVertices);
 	tglTexCoordPointer(2, TGL_FLOAT, 2 * sizeof(TGLfloat), textCords);




More information about the Scummvm-git-logs mailing list