Skip to content

Commit 75e7169

Browse files
committed
renderer: introduce and use IF_NOALPHA
1 parent c4af82b commit 75e7169

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

src/engine/renderer/tr_bsp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ static void R_LoadLightmaps( lump_t *l, const char *bspName )
483483
return;
484484
}
485485

486-
int lightMapBits = IF_LIGHTMAP | IF_NOPICMIP;
487-
int deluxeMapBits = IF_NORMALMAP | IF_NOPICMIP;
486+
int lightMapBits = IF_LIGHTMAP | IF_NOALPHA | IF_NOPICMIP;
487+
int deluxeMapBits = IF_NORMALMAP | IF_NOALPHA | IF_NOPICMIP;
488488

489489
if ( tr.worldLinearizeLightMap )
490490
{

src/engine/renderer/tr_image.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,15 +1054,12 @@ void R_UploadImage( const char *name, const byte **dataArray, int numLayers, int
10541054
}
10551055
else
10561056
{
1057-
// lightmap does not have alpha channel
1058-
if ( image->bits & IF_LIGHTMAP )
1059-
{
1060-
internalFormat = GL_RGB8;
1061-
}
1062-
else
1063-
{
1064-
internalFormat = GL_RGBA8;
1065-
}
1057+
internalFormat = GL_RGBA8;
1058+
}
1059+
1060+
if ( internalFormat == GL_RGBA8 && image->bits & IF_NOALPHA )
1061+
{
1062+
internalFormat = GL_RGB8;
10661063
}
10671064

10681065
// Detect formats.

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ enum class ssaoMode {
484484
IF_BC4 = BIT( 22 ),
485485
IF_BC5 = BIT( 23 ),
486486
IF_RGBA32UI = BIT( 24 ),
487-
IF_HOMEPATH = BIT( 25 )
487+
IF_HOMEPATH = BIT( 25 ),
488+
IF_NOALPHA = BIT( 26 )
488489
};
489490

490491
enum class filterType_t

0 commit comments

Comments
 (0)