gl1, gl3: use GL_LIGHTMAP_FORMAT intead internal_format

value is never changed, so replace should be safe.
This commit is contained in:
Denis Pauk 2024-08-27 23:47:15 +03:00
parent 758961a848
commit 04aec20891
4 changed files with 4 additions and 10 deletions

View file

@ -109,8 +109,7 @@ LM_UploadBlock(qboolean dynamic)
}
else
{
gl_lms.internal_format = GL_LIGHTMAP_FORMAT;
glTexImage2D(GL_TEXTURE_2D, 0, gl_lms.internal_format,
glTexImage2D(GL_TEXTURE_2D, 0, GL_LIGHTMAP_FORMAT,
gl_state.block_width, gl_state.block_height,
0, GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE,
gl_lms.lightmap_buffer[buffer]);
@ -123,7 +122,7 @@ LM_UploadBlock(qboolean dynamic)
R_Bind(gl_state.lightmap_textures + (gl_state.max_lightmaps * i) + texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, gl_lms.internal_format,
glTexImage2D(GL_TEXTURE_2D, 0, GL_LIGHTMAP_FORMAT,
gl_state.block_width, gl_state.block_height,
0, GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE,
gl_lms.lightmap_buffer[buffer]);
@ -326,7 +325,6 @@ LM_BeginBuildingLightmaps(model_t *m)
}
gl_lms.current_lightmap_texture = 1;
gl_lms.internal_format = GL_LIGHTMAP_FORMAT;
if (gl_config.multitexture)
{
@ -341,7 +339,7 @@ LM_BeginBuildingLightmaps(model_t *m)
R_Bind(gl_state.lightmap_textures + 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, gl_lms.internal_format,
glTexImage2D(GL_TEXTURE_2D, 0, GL_LIGHTMAP_FORMAT,
gl_state.block_width, gl_state.block_height,
0, GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE,
gl_lms.lightmap_buffer[0]);

View file

@ -463,7 +463,6 @@ typedef struct
typedef struct
{
int internal_format;
int current_lightmap_texture;
msurface_t *lightmap_surfaces[MAX_LIGHTMAPS];

View file

@ -56,8 +56,7 @@ GL3_LM_UploadBlock(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl3_lms.internal_format = GL_LIGHTMAP_FORMAT;
glTexImage2D(GL_TEXTURE_2D, 0, gl3_lms.internal_format,
glTexImage2D(GL_TEXTURE_2D, 0, GL_LIGHTMAP_FORMAT,
BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_LIGHTMAP_FORMAT,
GL_UNSIGNED_BYTE, gl3_lms.lightmap_buffers[map]);
}
@ -255,7 +254,6 @@ GL3_LM_BeginBuildingLightmaps(gl3model_t *m)
gl3_newrefdef.lightstyles = lightstyles;
gl3_lms.current_lightmap_texture = 0;
gl3_lms.internal_format = GL_LIGHTMAP_FORMAT;
// Note: the dynamic lightmap used to be initialized here, we don't use that anymore.
}

View file

@ -317,7 +317,6 @@ enum {MAX_GL3TEXTURES = 1024};
typedef struct
{
int internal_format;
int current_lightmap_texture; // index into gl3state.lightmap_textureIDs[]
//msurface_t *lightmap_surfaces[MAX_LIGHTMAPS]; - no more lightmap chains, lightmaps are rendered multitextured