Skip to content

Commit

Permalink
tr_shader: test against cvar value instead of pointer, fix #376, ref #…
Browse files Browse the repository at this point in the history
…358, #377

- fixes #376 issue introduced in 76cf787
- makes #358 working as expected
- see also #377 for hardening the fix for #376
  • Loading branch information
illwieckz committed Oct 12, 2020
1 parent f1b25a8 commit 5bd030d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/engine/renderer/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,12 +1415,12 @@ static bool LoadMap( shaderStage_t *stage, const char *buffer, const int bundleI
token = COM_ParseExt2( &buffer_p, false );

// NOTE: Normal map can ship height map in alpha channel.
if ( ( stage->type == stageType_t::ST_NORMALMAP && !r_normalMapping && !r_reliefMapping )
|| ( stage->type == stageType_t::ST_HEIGHTMAP && !r_reliefMapping )
|| ( stage->type == stageType_t::ST_SPECULARMAP && !r_specularMapping )
|| ( stage->type == stageType_t::ST_PHYSICALMAP && !r_physicalMapping )
|| ( stage->type == stageType_t::ST_GLOWMAP && !r_glowMapping )
|| ( stage->type == stageType_t::ST_REFLECTIONMAP && !r_reflectionMapping ) )
if ( ( stage->type == stageType_t::ST_NORMALMAP && !r_normalMapping->integer && !r_reliefMapping->integer )
|| ( stage->type == stageType_t::ST_HEIGHTMAP && !r_reliefMapping->integer )
|| ( stage->type == stageType_t::ST_SPECULARMAP && !r_specularMapping->integer )
|| ( stage->type == stageType_t::ST_PHYSICALMAP && !r_physicalMapping->integer )
|| ( stage->type == stageType_t::ST_GLOWMAP && !r_glowMapping->integer )
|| ( stage->type == stageType_t::ST_REFLECTIONMAP && !r_reflectionMapping->integer ) )
{
return true;
}
Expand Down

0 comments on commit 5bd030d

Please sign in to comment.