From 860fbcced547ec6795622c142d925a51db470c86 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Wed, 16 Sep 2026 14:30:42 +0200 Subject: hook PuM into the software renderer --- WinQuake/r_surf.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'WinQuake/r_surf.c') diff --git a/WinQuake/r_surf.c b/WinQuake/r_surf.c index 00a1391..497a432 100644 --- a/WinQuake/r_surf.c +++ b/WinQuake/r_surf.c @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "r_local.h" +#include "pum_bridge.h" drawsurf_t r_drawsurf; @@ -198,6 +199,16 @@ void R_BuildLightMap (void) if (t < (1 << 6)) t = (1 << 6); +#ifdef RENDER_PUM + if (PUM_Active ()) + { + byte v = (byte)t; + byte lo = (byte)(1 << 6); + PUM_LightMaskAndTexel (&v, &lo, &v, 1); + t = v; + } +#endif + blocklights[i] = t; } } @@ -368,8 +379,20 @@ void R_DrawSurfaceBlock8_mip0 (void) for (b=15; b>=0; b--) { pix = psource[b]; - prowdest[b] = ((unsigned char *)vid.colormap) - [(light & 0xFF00) + pix]; +#ifdef RENDER_PUM + if (PUM_Active ()) + { + byte pumtex; + pumtex = pix; + PUM_LightMaskAndTexel (&pumtex, &pix, (const byte *)&light, + sizeof (pix)); + prowdest[b] = ((unsigned char *)vid.colormap) + [(light & 0xFF00) + pumtex]; + } + else +#endif + prowdest[b] = ((unsigned char *)vid.colormap) + [(light & 0xFF00) + pix]; light += lightstep; } -- cgit v1.2.3