OpenGL2: Fix rendering when r_hdr = 0 and r_floatLightmap = 1

This commit is contained in:
SmileTheory 2014-02-14 22:41:25 -08:00
parent 3cfc1bb1f9
commit 5fabc28dff
4 changed files with 13 additions and 11 deletions

View file

@ -286,13 +286,10 @@ static void R_LoadLightmaps( lump_t *l, lump_t *surfs ) {
tr.deluxemaps = ri.Hunk_Alloc( tr.numLightmaps * sizeof(image_t *), h_low );
}
if (r_hdr->integer)
{
if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer)
textureInternalFormat = GL_RGBA16F_ARB;
else
textureInternalFormat = GL_RGBA8;
}
if (glRefConfig.floatLightmap)
textureInternalFormat = GL_RGBA16F_ARB;
else
textureInternalFormat = GL_RGBA8;
if (r_mergeLightmaps->integer)
{
@ -405,12 +402,12 @@ static void R_LoadLightmaps( lump_t *l, lump_t *surfs ) {
R_ColorShiftLightingFloats(color, color, 1.0f/255.0f);
if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer)
if (glRefConfig.floatLightmap)
ColorToRGBA16F(color, (unsigned short *)(&image[j*8]));
else
ColorToRGBM(color, &image[j*4]);
}
else if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer)
else if (glRefConfig.floatLightmap)
{
vec4_t color;