GRIM: Fix Shadowing GCC Compiler Warnings

This commit is contained in:
D G Turner 2023-06-25 04:12:08 +01:00
parent 0e472905ad
commit 7f7a03a777
2 changed files with 9 additions and 9 deletions

View file

@ -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++;
}

View file

@ -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)