emptiness shuffled.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-11 20:50:16 +00:00
parent a2b5fe36bb
commit 86b2363244
2 changed files with 39 additions and 66 deletions

View file

@ -37,8 +37,8 @@
# include <strings.h> # include <strings.h>
#endif #endif
#include <stdio.h>
#include <math.h> #include <math.h>
#include <stdio.h>
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/compat.h" #include "QF/compat.h"
@ -141,6 +141,7 @@ R_ForceLightUpdate ()
int dlightdivtable[8192]; int dlightdivtable[8192];
int dlightdivtableinitialized = 0; int dlightdivtableinitialized = 0;
void void
R_AddDynamicLights (msurface_t *surf) R_AddDynamicLights (msurface_t *surf)
{ {
@ -194,21 +195,15 @@ R_AddDynamicLights (msurface_t *surf)
surf->texturemins[1]; surf->texturemins[1];
i = f; i = f;
maxdist = (int) (cl_dlights[lnum].radius * cl_dlights[lnum].radius); // for maxdist = (int) (cl_dlights[lnum].radius * cl_dlights[lnum].radius);
// // for comparisons to minimum acceptable light
//
// comparisons
// to
// minimum
// acceptable
// light
// clamp radius to avoid exceeding 8192 entry division table // clamp radius to avoid exceeding 8192 entry division table
if (maxdist > 1048576) if (maxdist > 1048576)
maxdist = 1048576; maxdist = 1048576;
maxdist3 = maxdist - (int) (dist * dist); maxdist3 = maxdist - (int) (dist * dist);
// convert to 8.8 blocklights format // convert to 8.8 blocklights format
// if (!cl_dlights[lnum].dark) // if (!cl_dlights[lnum].dark)
// { // {
f = cl_dlights[lnum].color[0] * maxdist; f = cl_dlights[lnum].color[0] * maxdist;
red = f; red = f;
f = cl_dlights[lnum].color[1] * maxdist; f = cl_dlights[lnum].color[1] * maxdist;
@ -411,6 +406,7 @@ extern float speedscale; // for top sky and bottom sky
lpMTexFUNC qglMTexCoord2f = NULL; lpMTexFUNC qglMTexCoord2f = NULL;
lpSelTexFUNC qglSelectTexture = NULL; lpSelTexFUNC qglSelectTexture = NULL;
void void
GL_UploadLightmap (int i, int x, int y, int w, int h) GL_UploadLightmap (int i, int x, int y, int w, int h)
{ {
@ -867,17 +863,17 @@ R_RecursiveWorldNode (mnode_t *node)
switch (plane->type) { switch (plane->type) {
case PLANE_X: case PLANE_X:
dot = modelorg[0] - plane->dist; dot = modelorg[0] - plane->dist;
break; break;
case PLANE_Y: case PLANE_Y:
dot = modelorg[1] - plane->dist; dot = modelorg[1] - plane->dist;
break; break;
case PLANE_Z: case PLANE_Z:
dot = modelorg[2] - plane->dist; dot = modelorg[2] - plane->dist;
break; break;
default: default:
dot = DotProduct (modelorg, plane->normal) - plane->dist; dot = DotProduct (modelorg, plane->normal) - plane->dist;
break; break;
} }
side = dot < 0; side = dot < 0;
@ -1056,9 +1052,9 @@ AllocBlock (int w, int h, int *x, int *y)
mvertex_t *r_pcurrentvertbase; mvertex_t *r_pcurrentvertbase;
model_t *currentmodel; model_t *currentmodel;
int nColinElim; int nColinElim;
void void
BuildSurfaceDisplayList (msurface_t *fa) BuildSurfaceDisplayList (msurface_t *fa)
{ {
@ -1163,7 +1159,6 @@ BuildSurfaceDisplayList (msurface_t *fa)
} }
} }
poly->numverts = lnumverts; poly->numverts = lnumverts;
} }

View file

@ -88,6 +88,7 @@ msurface_t *sky_chain;
extern qboolean lighthalf; extern qboolean lighthalf;
// LordHavoc: place for gl_rsurf setup code // LordHavoc: place for gl_rsurf setup code
void void
glrsurf_init (void) glrsurf_init (void)
@ -95,6 +96,7 @@ glrsurf_init (void)
memset (&lightmaps, 0, sizeof (lightmaps)); memset (&lightmaps, 0, sizeof (lightmaps));
} }
static void static void
R_RecursiveLightUpdate (mnode_t *node) R_RecursiveLightUpdate (mnode_t *node)
{ {
@ -110,6 +112,7 @@ R_RecursiveLightUpdate (mnode_t *node)
c--, surf++) surf->cached_dlight = true; c--, surf++) surf->cached_dlight = true;
} }
// LordHavoc: function to force all lightmaps to be updated // LordHavoc: function to force all lightmaps to be updated
void void
R_ForceLightUpdate (void) R_ForceLightUpdate (void)
@ -119,19 +122,16 @@ R_ForceLightUpdate (void)
R_RecursiveLightUpdate (cl.worldmodel->nodes); R_RecursiveLightUpdate (cl.worldmodel->nodes);
} }
int dlightdivtable[8192];
int dlightdivtableinitialized = 0;
/* /*
R_AddDynamicLights R_AddDynamicLights
LordHavoc: completely rewrote this, relies on 64bit integer math... LordHavoc: completely rewrote this, relies on 64bit integer math...
*/ */
int dlightdivtable[8192];
int dlightdivtableinitialized = 0;
/*
R_AddDynamicLights
NOTE! LordHavoc was here, and it shows... (Mercury)
*/
void void
R_AddDynamicLights (msurface_t *surf) R_AddDynamicLights (msurface_t *surf)
{ {
@ -209,6 +209,7 @@ R_AddDynamicLights (msurface_t *surf)
} }
} }
/* /*
R_BuildLightMap R_BuildLightMap
@ -311,6 +312,7 @@ R_BuildLightMap (msurface_t *surf, byte * dest, int stride)
} }
} }
/* /*
R_TextureAnimation R_TextureAnimation
@ -354,6 +356,7 @@ extern int solidskytexture;
extern int alphaskytexture; extern int alphaskytexture;
extern float speedscale; // for top sky and bottom sky extern float speedscale; // for top sky and bottom sky
void void
GL_UploadLightmap (int i, int x, int y, int w, int h) GL_UploadLightmap (int i, int x, int y, int w, int h)
{ {
@ -367,6 +370,7 @@ GL_UploadLightmap (int i, int x, int y, int w, int h)
GL_UNSIGNED_BYTE, lightmaps[i]); GL_UNSIGNED_BYTE, lightmaps[i]);
} }
/* /*
R_DrawSequentialPoly R_DrawSequentialPoly
@ -436,9 +440,7 @@ R_DrawMultitexturePoly (msurface_t *s)
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
} }
/*
R_BlendLightmaps
*/
void void
R_BlendLightmaps (void) R_BlendLightmaps (void)
{ {
@ -485,9 +487,6 @@ R_BlendLightmaps (void)
glDepthMask (GL_TRUE); // back to normal Z buffering glDepthMask (GL_TRUE); // back to normal Z buffering
} }
/*
R_RenderFullbrights
*/
void void
R_RenderFullbrights (void) R_RenderFullbrights (void)
@ -514,9 +513,7 @@ R_RenderFullbrights (void)
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }
/*
R_RenderBrushPoly
*/
void void
R_RenderBrushPoly (msurface_t *fa) R_RenderBrushPoly (msurface_t *fa)
{ {
@ -586,6 +583,7 @@ R_RenderBrushPoly (msurface_t *fa)
glColor3ubv (lighthalf_v); glColor3ubv (lighthalf_v);
} }
void void
GL_WaterSurface (msurface_t *s) GL_WaterSurface (msurface_t *s)
{ {
@ -607,9 +605,7 @@ GL_WaterSurface (msurface_t *s)
EmitWaterPolys (s); EmitWaterPolys (s);
} }
/*
R_DrawWaterSurfaces
*/
void void
R_DrawWaterSurfaces (void) R_DrawWaterSurfaces (void)
{ {
@ -650,9 +646,6 @@ R_DrawWaterSurfaces (void)
} }
/*
DrawTextureChains
*/
void void
DrawTextureChains (void) DrawTextureChains (void)
{ {
@ -673,9 +666,7 @@ DrawTextureChains (void)
glEnable (GL_BLEND); glEnable (GL_BLEND);
} }
/*
R_DrawBrushModel
*/
void void
R_DrawBrushModel (entity_t *e) R_DrawBrushModel (entity_t *e)
{ {
@ -783,13 +774,12 @@ R_DrawBrushModel (entity_t *e)
glPopMatrix (); glPopMatrix ();
} }
/* /*
WORLD MODEL WORLD MODEL
*/ */
/*
R_RecursiveWorldNode
*/
void void
R_RecursiveWorldNode (mnode_t *node) R_RecursiveWorldNode (mnode_t *node)
{ {
@ -897,10 +887,6 @@ R_RecursiveWorldNode (mnode_t *node)
} }
/*
R_DrawWorld
*/
void void
R_DrawWorld (void) R_DrawWorld (void)
{ {
@ -937,9 +923,6 @@ R_DrawWorld (void)
} }
/*
R_MarkLeaves
*/
void void
R_MarkLeaves (void) R_MarkLeaves (void)
{ {
@ -974,11 +957,11 @@ R_MarkLeaves (void)
} }
/* /*
LIGHTMAP ALLOCATION LIGHTMAP ALLOCATION
*/ */
// returns a texture number and the position inside it // returns a texture number and the position inside it
int int
AllocBlock (int w, int h, int *x, int *y) AllocBlock (int w, int h, int *x, int *y)
@ -1029,9 +1012,7 @@ model_t *currentmodel;
int nColinElim; int nColinElim;
/*
BuildSurfaceDisplayList
*/
void void
BuildSurfaceDisplayList (msurface_t *fa) BuildSurfaceDisplayList (msurface_t *fa)
{ {
@ -1130,9 +1111,7 @@ BuildSurfaceDisplayList (msurface_t *fa)
} }
/*
GL_CreateSurfaceLightmap
*/
void void
GL_CreateSurfaceLightmap (msurface_t *surf) GL_CreateSurfaceLightmap (msurface_t *surf)
{ {
@ -1154,8 +1133,7 @@ GL_CreateSurfaceLightmap (msurface_t *surf)
/* /*
GL_BuildLightmaps GL_BuildLightmaps
Builds the lightmap texture Builds the lightmap texture with all the surfaces from all brush models
with all the surfaces from all brush models
*/ */
void void
GL_BuildLightmaps (void) GL_BuildLightmaps (void)