Skip to content

Commit e66b52a

Browse files
committed
tr_shader: do not load heatHaze map when heatHaze is disabled
1 parent 6ec7fb3 commit e66b52a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/engine/renderer/tr_shader.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3277,6 +3277,13 @@ static bool ParseStage( shaderStage_t *stage, const char **text )
32773277
// compute state bits
32783278
stage->stateBits = colorMaskBits | depthMaskBits | blendSrcBits | blendDstBits | atestBits | depthFuncBits | polyModeBits;
32793279

3280+
// Do not load heatHaze maps when r_heatHaze is disabled.
3281+
if ( stage->type == stageType_t::ST_HEATHAZEMAP && !r_heatHaze->integer )
3282+
{
3283+
stage->active = false;
3284+
return true;
3285+
}
3286+
32803287
// load image
32813288
if ( loadMap && !LoadMap( stage, buffer, stage->type ) )
32823289
{
@@ -5181,7 +5188,6 @@ static void FinishStages()
51815188
switch ( stage->type )
51825189
{
51835190
case stageType_t::ST_HEATHAZEMAP:
5184-
stage->active = r_heatHaze->integer;
51855191
stage->stateBits &= ~( GLS_ATEST_BITS | GLS_DEPTHMASK_TRUE );
51865192
break;
51875193

0 commit comments

Comments
 (0)