aboutsummaryrefslogtreecommitdiffstats
path: root/WinQuake/r_surf.c
diff options
context:
space:
mode:
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;
}