aboutsummaryrefslogtreecommitdiffstats
path: root/WinQuake/r_surf.c
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2026-09-16 14:30:42 +0200
committerLeonard Kugis <leonard@kug.is>2026-09-16 14:30:42 +0200
commit860fbcced547ec6795622c142d925a51db470c86 (patch)
tree270fc8a1a351d7c2a6150f51f12733e0d3c788e2 /WinQuake/r_surf.c
parent6b7661a7c295146f3cac60d999752045933a2cf7 (diff)
downloadquake-pum-860fbcced547ec6795622c142d925a51db470c86.tar.gz
hook PuM into the software renderer
Diffstat (limited to 'WinQuake/r_surf.c')
-rw-r--r--WinQuake/r_surf.c27
1 files changed, 25 insertions, 2 deletions
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;
}