From be9d0703641379df687c0245a2a7f335022f39d1 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 6 Jan 2024 19:21:11 +0300 Subject: [PATCH] ref: gl: support kRenderFxLightMultiplier * add undocumented kRenderFxLightMultiplier to const.h --- common/const.h | 1 + ref/gl/gl_studio.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/common/const.h b/common/const.h index a7e3d08b..fe4469fa 100644 --- a/common/const.h +++ b/common/const.h @@ -717,6 +717,7 @@ enum kRenderFxExplode, // Scale up really big! kRenderFxGlowShell, // Glowing Shell kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) + kRenderFxLightMultiplier, }; typedef int func_t; diff --git a/ref/gl/gl_studio.c b/ref/gl/gl_studio.c index 8932ae51..2b3de57b 100644 --- a/ref/gl/gl_studio.c +++ b/ref/gl/gl_studio.c @@ -1435,6 +1435,13 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight ) } } + if( ent->curstate.renderfx == kRenderFxLightMultiplier && ent->curstate.iuser4 != 10 ) + { + light.r *= ent->curstate.iuser4 / 10.0f; + light.g *= ent->curstate.iuser4 / 10.0f; + light.b *= ent->curstate.iuser4 / 10.0f; + } + VectorSet( finalLight, light.r, light.g, light.b ); ent->cvFloorColor = light;