[Scummvm-git-logs] scummvm master -> 7f7a03a77764faa33f6fec5b79f199da6b544f07
digitall
noreply at scummvm.org
Sun Jun 25 03:12:25 UTC 2023
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:
7f7a03a777 GRIM: Fix Shadowing GCC Compiler Warnings
Commit: 7f7a03a77764faa33f6fec5b79f199da6b544f07
https://github.com/scummvm/scummvm/commit/7f7a03a77764faa33f6fec5b79f199da6b544f07
Author: D G Turner (digitall at scummvm.org)
Date: 2023-06-25T04:12:08+01:00
Commit Message:
GRIM: Fix Shadowing GCC Compiler Warnings
Changed paths:
engines/grim/gfx_opengl.cpp
engines/grim/gfx_opengl_shaders.cpp
diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp
index 9c4c3acbff4..8180f638670 100644
--- a/engines/grim/gfx_opengl.cpp
+++ b/engines/grim/gfx_opengl.cpp
@@ -1060,11 +1060,11 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
byte *texOut = nullptr;
GLint format = GL_RGBA;
- GLint type = GL_UNSIGNED_BYTE;
+ GLint btype = GL_UNSIGNED_BYTE;
int bytes = 4;
if (bitmap->_format != 1) {
format = GL_DEPTH_COMPONENT;
- type = GL_UNSIGNED_SHORT;
+ btype = GL_UNSIGNED_SHORT;
bytes = 2;
}
@@ -1107,7 +1107,7 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexImage2D(GL_TEXTURE_2D, 0, format, BITMAP_TEXTURE_SIZE, BITMAP_TEXTURE_SIZE, 0, format, type, nullptr);
+ glTexImage2D(GL_TEXTURE_2D, 0, format, BITMAP_TEXTURE_SIZE, BITMAP_TEXTURE_SIZE, 0, format, btype, nullptr);
}
int cur_tex_idx = bitmap->_numTex * pic;
@@ -1117,7 +1117,7 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
int width = (x + BITMAP_TEXTURE_SIZE >= bitmap->_width) ? (bitmap->_width - x) : BITMAP_TEXTURE_SIZE;
int height = (y + BITMAP_TEXTURE_SIZE >= bitmap->_height) ? (bitmap->_height - y) : BITMAP_TEXTURE_SIZE;
glBindTexture(GL_TEXTURE_2D, textures[cur_tex_idx]);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, format, type,
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, format, btype,
texOut + (y * bytes * bitmap->_width) + (bytes * x));
cur_tex_idx++;
}
diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp
index 9feeab40aae..b34cbdd6275 100644
--- a/engines/grim/gfx_opengl_shaders.cpp
+++ b/engines/grim/gfx_opengl_shaders.cpp
@@ -261,7 +261,7 @@ GfxOpenGLS::~GfxOpenGLS() {
void GfxOpenGLS::setupZBuffer() {
GLint format = GL_LUMINANCE_ALPHA;
- GLenum type = GL_UNSIGNED_BYTE;
+ GLenum ztype = GL_UNSIGNED_BYTE;
float width = _gameWidth;
float height = _gameHeight;
@@ -272,7 +272,7 @@ void GfxOpenGLS::setupZBuffer() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexImage2D(GL_TEXTURE_2D, 0, format, nextHigher2((int)width), nextHigher2((int)height), 0, format, type, nullptr);
+ glTexImage2D(GL_TEXTURE_2D, 0, format, nextHigher2((int)width), nextHigher2((int)height), 0, format, ztype, nullptr);
glActiveTexture(GL_TEXTURE0);
_zBufTexCrop = Math::Vector2d(width / nextHigher2((int)width), height / nextHigher2((int)height));
@@ -1339,7 +1339,7 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
const byte *texOut = nullptr;
GLint format = GL_RGBA;
- GLint type = GL_UNSIGNED_BYTE;
+ GLint btype = GL_UNSIGNED_BYTE;
int bytes = 4;
glPixelStorei(GL_UNPACK_ALIGNMENT, bytes);
@@ -1382,9 +1382,9 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, format, actualWidth, actualHeight, 0, format, type, nullptr);
+ glTexImage2D(GL_TEXTURE_2D, 0, format, actualWidth, actualHeight, 0, format, btype, nullptr);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap->_width, bitmap->_height, format, type, texOut);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap->_width, bitmap->_height, format, btype, texOut);
}
if (texData)
More information about the Scummvm-git-logs
mailing list