From 5bd030d7591d8a5feb9d451d8158e8b23391cebd Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 12 Oct 2020 02:54:32 +0200 Subject: [PATCH] tr_shader: test against cvar value instead of pointer, fix #376, ref #358, #377 - fixes #376 issue introduced in 76cf787f21bb483ede76c4f614fb89aa71581f96 - makes #358 working as expected - see also #377 for hardening the fix for #376 --- src/engine/renderer/tr_shader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/renderer/tr_shader.cpp b/src/engine/renderer/tr_shader.cpp index 7e5208a902..67517ccbcf 100644 --- a/src/engine/renderer/tr_shader.cpp +++ b/src/engine/renderer/tr_shader.cpp @@ -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; }