diff options
Diffstat (limited to 'WinQuake/r_surf.c')
| -rw-r--r-- | WinQuake/r_surf.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/WinQuake/r_surf.c b/WinQuake/r_surf.c index 00a1391..b63693e 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;
@@ -133,6 +134,9 @@ void R_AddDynamicLights (void) }
#else
blocklights[t*smax + s] += (rad - dist)*256;
+#ifdef RENDER_PUM
+ // TODO: Contribution accumulation +#endif
#endif
}
}
@@ -198,6 +202,17 @@ void R_BuildLightMap (void) if (t < (1 << 6))
t = (1 << 6);
+#ifdef RENDER_PUM
+ // mux bitwise wia 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 +383,22 @@ 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
+ // light lookup plus texel masking + // Later gather on main program + 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;
}
|
