Change meaning of gl_lightmap_components a bit. Setting 4 changed to reduce texture memory waste by a bit. Really only an optimization for nvidia drivers anyways. This also should fix a quality issue in 16bpp with it set to 4.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-20 04:36:20 +00:00
parent cf2e098434
commit f7330f078e
2 changed files with 10 additions and 2 deletions

View file

@ -55,6 +55,7 @@ int skytexturenum;
extern vec3_t shadecolor; // Ender (Extend) Colormod
int gl_internalformat;
int lightmap_bytes; // 1, 3, or 4
int lightmap_textures;
@ -366,7 +367,7 @@ GL_UploadLightmap (int i, int x, int y, int w, int h)
GL_UNSIGNED_BYTE,
lightmaps[i] + (y * BLOCK_WIDTH) * lightmap_bytes);
*/
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes, BLOCK_WIDTH,
glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, BLOCK_WIDTH,
BLOCK_HEIGHT, 0, gl_lightmap_format,
GL_UNSIGNED_BYTE, lightmaps[i]);
}
@ -1154,15 +1155,18 @@ GL_BuildLightmaps (void)
switch (gl_lightmap_components->int_val) {
case 1:
gl_internalformat = 1;
gl_lightmap_format = GL_LUMINANCE;
lightmap_bytes = 1;
break;
case 3:
gl_internalformat = 3;
gl_lightmap_format = GL_RGB;
lightmap_bytes = 3;
break;
case 4:
default:
gl_internalformat = 3;
gl_lightmap_format = GL_RGBA;
lightmap_bytes = 4;
break;

View file

@ -55,6 +55,7 @@ int skytexturenum;
extern vec3_t shadecolor; // Ender (Extend) Colormod
int gl_internalformat;
int lightmap_bytes; // 1, 3, or 4
int lightmap_textures;
@ -366,7 +367,7 @@ GL_UploadLightmap (int i, int x, int y, int w, int h)
GL_UNSIGNED_BYTE,
lightmaps[i] + (y * BLOCK_WIDTH) * lightmap_bytes);
*/
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes, BLOCK_WIDTH,
glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, BLOCK_WIDTH,
BLOCK_HEIGHT, 0, gl_lightmap_format,
GL_UNSIGNED_BYTE, lightmaps[i]);
}
@ -1154,15 +1155,18 @@ GL_BuildLightmaps (void)
switch (gl_lightmap_components->int_val) {
case 1:
gl_internalformat = 1;
gl_lightmap_format = GL_LUMINANCE;
lightmap_bytes = 1;
break;
case 3:
gl_internalformat = 3;
gl_lightmap_format = GL_RGB;
lightmap_bytes = 3;
break;
case 4:
default:
gl_internalformat = 3;
gl_lightmap_format = GL_RGBA;
lightmap_bytes = 4;
break;