Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

soundv.c File Reference

#include "cmdlib.h"
#include "mathlib.h"
#include "bspfile.h"
#include "imagelib.h"
#include "threads.h"
#include "mutex.h"
#include "scriplib.h"
#include "shaders.h"
#include "mesh.h"

Include dependency graph for soundv.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  lFacet_s
struct  lightvolume_s
struct  lleaf_s
struct  lportal_t
struct  lsurfaceTest_s
struct  plane_t
struct  vsound_s
struct  winding_t

Defines

#define DIST_EPSILON   0.02
#define LAAT_DOUBLEQUADRATIC   2
#define LAAT_NORMAL   0
#define LAAT_QUADRATIC   1
#define LDAT_LINEAR   1
#define LDAT_NOSCALE   2
#define LDAT_QUADRATIC   0
#define LIGHT_POINTFAKESURFACE   3
#define LIGHT_POINTRADIAL   1
#define LIGHT_POINTSPOT   2
#define LIGHT_SURFACEDIRECTED   4
#define LIGHT_SURFACERADIAL   5
#define LIGHT_SURFACESPOT   6
#define LIGHTMAP_PIXELSHIFT   0.5
#define LIGHTMAP_SIZE   128
#define MAX_CLUSTERS   16384
#define MAX_FACETS   65536
#define MAX_LIGHTS   16384
#define MAX_POINTS_ON_FIXED_WINDING   48
#define MAX_POINTS_ON_WINDING   64
#define MAX_PORTALS   32768
#define MAX_PORTALS_ON_LEAF   128
#define MAX_TRANSLUCENTFACETS   32
#define NORMAL_EPSILON   0.0001
#define ON_EPSILON   0.1
#define PLANAR_EPSILON   0.1
#define PORTALFILE   "PRT1"
#define VectorSet(v, x, y, z)   v[0] = x;v[1] = y;v[2] = z;
#define VOLUME_DIRECTED   1
#define VOLUME_NORMAL   0

Typedefs

typedef lFacet_s lFacet_t
typedef lightvolume_s lightvolume_t
typedef lleaf_s lleaf_t
typedef lsurfaceTest_s lsurfaceTest_t
typedef vsound_s vsound_t

Functions

winding_tAllocWinding (int points)
winding_tBaseWindingForPlane (vec3_t normal, vec_t dist)
void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist, vec_t epsilon, winding_t **front, winding_t **back)
void ColorToBytes (const float *color, byte *colorBytes)
void CountLightmaps (void)
entity_tFindTargetEntity (const char *target)
void FreeWinding (winding_t *w)
void GridAndVertexLighting (void)
int Plane_Equal (plane_t *a, plane_t *b, int flip)
int PointInLeafnum (vec3_t point)
float PointToPolygonFormFactor (const vec3_t point, const vec3_t normal, const winding_t *w)
winding_tReverseWinding (winding_t *w)
void SetEntityOrigins (void)
void TraceLtm (int num)
winding_tVS_AllocWinding (int points)
void VS_CalcVisibleLightmapPixelArea (void)
int VS_ChopWinding (winding_t *in, plane_t *split, float epsilon)
int VS_ChopWindingWithBrush (winding_t *w, dbrush_t *brush, winding_t *outwindings, int maxout)
float VS_ChopWindingWithFacet (winding_t *w, lFacet_t *facet)
void VS_CreateEntitySpeakers (void)
void VS_CreateFakeSurfaceLights (void)
void VS_CreateSkyLights (void)
void VS_DoForcedTraceLight (int num)
void VS_DoForcedTraceLightSurfaces (void)
void VS_FacetsForPatch (dsurface_t *dsurf, int surfaceNum, shaderInfo_t *si, lsurfaceTest_t *test)
void VS_FacetsForTriangleSurface (dsurface_t *dsurf, shaderInfo_t *si, lsurfaceTest_t *test)
int VS_FindAdjacentSurface (int surfaceNum, int facetNum, vec3_t p1, vec3_t p2, int *sNum, int *fNum, int *point)
void VS_FixLightmapEdges (void)
void VS_FloodAreaSpotLight (vsound_t *light, winding_t *w, int leafnum)
void VS_FloodDirectedLight (vsound_t *light, winding_t *w, int leafnum)
void VS_FloodLight (vsound_t *light)
void VS_FloodLightThread (int num)
void VS_FloodRadialAreaLight (vsound_t *light, winding_t *w, int leafnum)
void VS_GenerateBoundaryForPoints (plane_t *boundary, plane_t *plane, vec3_t a, vec3_t b)
qboolean VS_GenerateFacetFor3Points (dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c)
qboolean VS_GenerateFacetFor4Points (dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c, drawVert_t *d)
void VS_GetFilter (vsound_t *light, lightvolume_t *volume, vec3_t lmp, vec3_t filter)
void VS_InitSurfacesForTesting (void)
int VS_LightLeafnum (vec3_t point)
void VS_LightmapMatrixFromPoints (dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c)
void VS_LightSurfaceWithVolume (int surfaceNum, int facetNum, vsound_t *light, lightvolume_t *volume)
void VS_LightWorld (void)
void VS_LinkSurfaceIntoCluster (int cluster, int surfaceNum)
void VS_LinkSurfaces (void)
void VS_LoadPortals (char *name)
void VS_PlaneForEdgeToWinding (vec3_t p1, vec3_t p2, winding_t *w, int windingonfront, plane_t *plane)
qboolean VS_PlaneFromPoints (plane_t *plane, const vec3_t a, const vec3_t b, const vec3_t c)
void VS_PlaneFromWinding (winding_t *w, plane_t *plane)
int VS_PointInLeafnum (vec3_t point)
int VS_PointInLeafnum_r (vec3_t point, int nodenum)
void VS_R_CastLightAtSurface (vsound_t *light, lightvolume_t *volume)
void VS_R_FloodLight (vsound_t *light, lightvolume_t *volume, int cluster, int firstportal)
void VS_R_LinkSurface (int nodenum, int surfaceNum, winding_t *w)
int VS_R_SplitLightVolume (vsound_t *light, lightvolume_t *volume, plane_t *split, int cluster, int firstportal)
void VS_R_SubdivideAreaSpotLight (vsound_t *light, int nodenum, winding_t *w)
void VS_R_SubdivideDirectedAreaLight (vsound_t *light, int nodenum, winding_t *w)
void VS_R_SubdivideRadialAreaLight (vsound_t *light, int nodenum, winding_t *w)
float VS_R_WindingAreaOutsideSolid (winding_t *w, vec3_t normal, int nodenum)
void VS_Radiosity (void)
void VS_SetPortalSphere (lportal_t *p)
void VS_ShiftPatchLightmaps (void)
void VS_SmoothenLightmapEdges (void)
void VS_SphereFromBounds (vec3_t mins, vec3_t maxs, vec3_t origin, float *radius)
int VS_SplitLightVolume (lightvolume_t *volume, lightvolume_t *back, plane_t *split, float epsilon)
int VS_SplitWinding (winding_t *in, winding_t *back, plane_t *split, float epsilon)
void VS_StoreLightmap (void)
void VS_SubdivideAreaLight (shaderInfo_t *ls, winding_t *w, vec3_t normal, float areaSubdivide, qboolean backsplash)
void VS_SurfaceRadiosity (int num)
void VS_TestLightLeafs (void)
void VS_TextureMatrixFromPoints (lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c)
float VS_WindingAreaOutsideBrushes (winding_t *w, int *brushnums, int numbrushes)
float VS_WindingAreaOutsideSolid (winding_t *w, vec3_t normal)
winding_tVS_WindingForBrushSide (dbrush_t *brush, int side, winding_t *w)
int VSoundMain (int argc, char **argv)
vec_t WindingArea (winding_t *w)
void WindingBounds (winding_t *w, vec3_t mins, vec3_t maxs)
void WindingCenter (winding_t *w, vec3_t center)

Variables

int clustersurfaces [MAX_MAP_LEAFFACES]
int defaulttracelight = 0
int entitySurface [MAX_MAP_DRAW_SURFS]
vec3_t gridSize
lleaf_tleafs
vec3_t lightAmbientColor
float lightAreaScale = 0.25
int lightDefaultSubdivide = 999
float * lightFloats
float lightFormFactorValueScale = 3
float lightLinearScale = 1.0 / 8000
float lightmappixelarea [MAX_MAP_LIGHTING/3]
float lightPointScale = 7500
lsurfaceTest_tlsurfaceTest [MAX_MAP_DRAW_SURFS]
int noalphashading = 0
int nobackfaceculling = 0
int nocolorshading = 0
int nostitching = 0
int numclustersurfaces = 0
int numfaces
int numfacets
int numportals
int numvolumes = 0
int numvsounds = 0
float * oldLightFloats
qboolean patchshadows
int portalclusters
lportal_tportals
int radiosity = 0
int radiosity_scale
int samplesize
char source [1024]
vec3_t surfaceOrigin [MAX_MAP_DRAW_SURFS]
vsound_tvsounds [MAX_LIGHTS]


Define Documentation

#define DIST_EPSILON   0.02
 

Definition at line 1137 of file soundv.c.

#define LAAT_DOUBLEQUADRATIC   2
 

Definition at line 174 of file soundv.c.

#define LAAT_NORMAL   0
 

Definition at line 172 of file soundv.c.

#define LAAT_QUADRATIC   1
 

Definition at line 173 of file soundv.c.

#define LDAT_LINEAR   1
 

Definition at line 168 of file soundv.c.

#define LDAT_NOSCALE   2
 

Definition at line 169 of file soundv.c.

#define LDAT_QUADRATIC   0
 

Definition at line 167 of file soundv.c.

#define LIGHT_POINTFAKESURFACE   3
 

Definition at line 161 of file soundv.c.

#define LIGHT_POINTRADIAL   1
 

Definition at line 159 of file soundv.c.

#define LIGHT_POINTSPOT   2
 

Definition at line 160 of file soundv.c.

#define LIGHT_SURFACEDIRECTED   4
 

Definition at line 162 of file soundv.c.

#define LIGHT_SURFACERADIAL   5
 

Definition at line 163 of file soundv.c.

#define LIGHT_SURFACESPOT   6
 

Definition at line 164 of file soundv.c.

#define LIGHTMAP_PIXELSHIFT   0.5
 

Definition at line 53 of file soundv.c.

#define LIGHTMAP_SIZE   128
 

Definition at line 51 of file soundv.c.

#define MAX_CLUSTERS   16384
 

Definition at line 46 of file soundv.c.

#define MAX_FACETS   65536
 

Definition at line 48 of file soundv.c.

#define MAX_LIGHTS   16384
 

Definition at line 49 of file soundv.c.

#define MAX_POINTS_ON_FIXED_WINDING   48
 

Definition at line 71 of file soundv.c.

#define MAX_POINTS_ON_WINDING   64
 

Definition at line 69 of file soundv.c.

#define MAX_PORTALS   32768
 

Definition at line 47 of file soundv.c.

#define MAX_PORTALS_ON_LEAF   128
 

Definition at line 88 of file soundv.c.

#define MAX_TRANSLUCENTFACETS   32
 

Definition at line 134 of file soundv.c.

#define NORMAL_EPSILON   0.0001
 

Definition at line 1136 of file soundv.c.

#define ON_EPSILON   0.1
 

Definition at line 59 of file soundv.c.

#define PLANAR_EPSILON   0.1
 

Definition at line 1254 of file soundv.c.

#define PORTALFILE   "PRT1"
 

Definition at line 57 of file soundv.c.

#define VectorSet v,
x,
y,
z   )     v[0] = x;v[1] = y;v[2] = z;
 

Definition at line 61 of file soundv.c.

#define VOLUME_DIRECTED   1
 

Definition at line 132 of file soundv.c.

#define VOLUME_NORMAL   0
 

Definition at line 131 of file soundv.c.


Typedef Documentation

typedef struct lFacet_s lFacet_t
 

typedef struct lightvolume_s lightvolume_t
 

typedef struct lleaf_s lleaf_t
 

typedef struct lsurfaceTest_s lsurfaceTest_t
 

typedef struct vsound_s vsound_t
 

Referenced by VS_CreateEntitySpeakers(), VS_CreateFakeSurfaceLights(), VS_CreateSkyLights(), VS_FloodAreaSpotLight(), VS_FloodDirectedLight(), VS_FloodLight(), VS_FloodRadialAreaLight(), VS_GetFilter(), VS_LightSurfaceWithVolume(), VS_R_CastLightAtSurface(), VS_R_FloodLight(), VS_R_SplitLightVolume(), VS_R_SubdivideAreaSpotLight(), VS_R_SubdivideDirectedAreaLight(), VS_R_SubdivideRadialAreaLight(), VS_SubdivideAreaLight(), VS_SurfaceRadiosity(), and VS_TestLightLeafs().


Function Documentation

winding_t* AllocWinding int  points  ) 
 

Definition at line 69 of file l_poly.c.

References c_active_windings, c_peak_windingmemory, c_peak_windings, c_winding_allocs, c_winding_points, c_windingmemory, GetMemory(), malloc(), MemorySize(), memset(), numthreads, points, s, and w.

Referenced by AddWindingPoint(), AddWindingToConvexHull(), BaseWindingForPlane(), ChopWindingInPlace(), ClipWindingEpsilon(), CopyWinding(), CreateSurfaceLights(), FilterMiscModelSurfIntoTree(), FilterPatchSurfIntoTree(), MergeWindings(), ReverseWinding(), TryMergeWinding(), VL_CreateFakeSurfaceLights(), VS_CreateFakeSurfaceLights(), and WindingFromDrawSurf().

00070 {
00071     winding_t   *w;
00072     int         s;
00073 
00074     s = sizeof(vec_t)*3*points + sizeof(int);
00075     w = GetMemory(s);
00076     memset(w, 0, s);
00077 
00078     if (numthreads == 1)
00079     {
00080         c_winding_allocs++;
00081         c_winding_points += points;
00082         c_active_windings++;
00083         if (c_active_windings > c_peak_windings)
00084             c_peak_windings = c_active_windings;
00085         c_windingmemory += MemorySize(w);
00086         if (c_windingmemory > c_peak_windingmemory)
00087             c_peak_windingmemory = c_windingmemory;
00088     } //end if
00089     return w;
00090 } //end of the function AllocWinding

Here is the call graph for this function:

winding_t* BaseWindingForPlane vec3_t  normal,
vec_t  dist
 

Definition at line 251 of file l_poly.c.

References AllocWinding(), BOGUS_RANGE, CrossProduct(), DotProduct, Error(), fabs(), i, max, MAX_WORLD_COORD, winding_t::numpoints, winding_t::p, v, vec3_origin, vec3_t, vec_t, VectorAdd, VectorCopy, VectorMA, VectorNormalize(), VectorScale, VectorSubtract, vright, vup, w, and x.

Referenced by AAS_CreateCurveBrushes(), AAS_FixMapBrush(), AAS_MakeBrushWindings(), AAS_SplitWinding(), BaseWindingForNode(), BSPBrushWindings(), CM_AddFacetBevels(), CM_DrawDebugSurface(), CM_ValidateFacet(), CreateBrushWindings(), HL_SplitBrush(), MakeBrushWindings(), MakeHeadnodePortals(), Q1_SplitBrush(), Q2_BrushSideWinding(), Q3_BrushSideWinding(), Sin_BrushSideWinding(), SplitBrush(), TestExpandBrushes(), VL_WindingForBrushSide(), VS_WindingForBrushSide(), WriteBspBrushMap(), WriteMapBrush(), and WriteOriginBrush().

00252 {
00253     int     i, x;
00254     vec_t   max, v;
00255     vec3_t  org, vright, vup;
00256     winding_t   *w;
00257     
00258 // find the major axis
00259 
00260     max = -BOGUS_RANGE;
00261     x = -1;
00262     for (i=0 ; i<3; i++)
00263     {
00264         v = fabs(normal[i]);
00265         if (v > max)
00266         {
00267             x = i;
00268             max = v;
00269         }
00270     }
00271     if (x==-1)
00272         Error ("BaseWindingForPlane: no axis found");
00273         
00274     VectorCopy (vec3_origin, vup);  
00275     switch (x)
00276     {
00277     case 0:
00278     case 1:
00279         vup[2] = 1;
00280         break;      
00281     case 2:
00282         vup[0] = 1;
00283         break;      
00284     }
00285 
00286     v = DotProduct (vup, normal);
00287     VectorMA (vup, -v, normal, vup);
00288     VectorNormalize (vup);
00289         
00290     VectorScale (normal, dist, org);
00291     
00292     CrossProduct (vup, normal, vright);
00293     
00294     VectorScale (vup, BOGUS_RANGE, vup);
00295     VectorScale (vright, BOGUS_RANGE, vright);
00296 
00297 // project a really big axis aligned box onto the plane
00298     w = AllocWinding (4);
00299     
00300     VectorSubtract (org, vright, w->p[0]);
00301     VectorAdd (w->p[0], vup, w->p[0]);
00302     
00303     VectorAdd (org, vright, w->p[1]);
00304     VectorAdd (w->p[1], vup, w->p[1]);
00305     
00306     VectorAdd (org, vright, w->p[2]);
00307     VectorSubtract (w->p[2], vup, w->p[2]);
00308     
00309     VectorSubtract (org, vright, w->p[3]);
00310     VectorSubtract (w->p[3], vup, w->p[3]);
00311     
00312     w->numpoints = 4;
00313     
00314     return w;   
00315 }

Here is the call graph for this function:

void ClipWindingEpsilon winding_t in,
vec3_t  normal,
vec_t  dist,
vec_t  epsilon,
winding_t **  front,
winding_t **  back
 

Definition at line 358 of file l_poly.c.

References AllocWinding(), b, CopyWinding(), DotProduct, Error(), f, i, in, j, MAX_POINTS_ON_WINDING, winding_t::numpoints, winding_t::p, p2, SIDE_ON, vec3_t, vec_t, and VectorCopy.

Referenced by AAS_SplitFace(), BuildFaceTree_r(), ChopFaceByBrush(), ChopWinding(), ClipSideIntoTree_r(), FilterMapDrawSurfIntoTree_r(), FilterSideIntoTree_r(), HL_SplitBrush(), Q1_SplitBrush(), SplitBrush(), SplitNodePortals(), SubdivideAreaLight(), SubdivideDrawSurf(), SubdivideFace(), VL_SubdivideAreaLight(), and VS_SubdivideAreaLight().

00360 {
00361     vec_t   dists[MAX_POINTS_ON_WINDING+4];
00362     int     sides[MAX_POINTS_ON_WINDING+4];
00363     int     counts[3];
00364     //MrElusive: DOH can't use statics when unsing multithreading!!!
00365     vec_t dot;      // VC 4.2 optimizer bug if not static
00366     int     i, j;
00367     vec_t   *p1, *p2;
00368     vec3_t  mid;
00369     winding_t   *f, *b;
00370     int     maxpts;
00371     
00372     counts[0] = counts[1] = counts[2] = 0;
00373 
00374 // determine sides for each point
00375     for (i=0 ; i<in->numpoints ; i++)
00376     {
00377         dot = DotProduct (in->p[i], normal);
00378         dot -= dist;
00379         dists[i] = dot;
00380         if (dot > epsilon)
00381             sides[i] = SIDE_FRONT;
00382         else if (dot < -epsilon)
00383             sides[i] = SIDE_BACK;
00384         else
00385         {
00386             sides[i] = SIDE_ON;
00387         }
00388         counts[sides[i]]++;
00389     }
00390     sides[i] = sides[0];
00391     dists[i] = dists[0];
00392     
00393     *front = *back = NULL;
00394 
00395     if (!counts[0])
00396     {
00397         *back = CopyWinding (in);
00398         return;
00399     }
00400     if (!counts[1])
00401     {
00402         *front = CopyWinding (in);
00403         return;
00404     }
00405 
00406     maxpts = in->numpoints+4;   // cant use counts[0]+2 because
00407                                 // of fp grouping errors
00408 
00409     *front = f = AllocWinding (maxpts);
00410     *back = b = AllocWinding (maxpts);
00411         
00412     for (i=0 ; i<in->numpoints ; i++)
00413     {
00414         p1 = in->p[i];
00415         
00416         if (sides[i] == SIDE_ON)
00417         {
00418             VectorCopy (p1, f->p[f->numpoints]);
00419             f->numpoints++;
00420             VectorCopy (p1, b->p[b->numpoints]);
00421             b->numpoints++;
00422             continue;
00423         }
00424     
00425         if (sides[i] == SIDE_FRONT)
00426         {
00427             VectorCopy (p1, f->p[f->numpoints]);
00428             f->numpoints++;
00429         }
00430         if (sides[i] == SIDE_BACK)
00431         {
00432             VectorCopy (p1, b->p[b->numpoints]);
00433             b->numpoints++;
00434         }
00435 
00436         if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
00437             continue;
00438             
00439     // generate a split point
00440         p2 = in->p[(i+1)%in->numpoints];
00441         
00442         dot = dists[i] / (dists[i]-dists[i+1]);
00443         for (j=0 ; j<3 ; j++)
00444         {   // avoid round off error when possible
00445             if (normal[j] == 1)
00446                 mid[j] = dist;
00447             else if (normal[j] == -1)
00448                 mid[j] = -dist;
00449             else
00450                 mid[j] = p1[j] + dot*(p2[j]-p1[j]);
00451         }
00452             
00453         VectorCopy (mid, f->p[f->numpoints]);
00454         f->numpoints++;
00455         VectorCopy (mid, b->p[b->numpoints]);
00456         b->numpoints++;
00457     }
00458     
00459     if (f->numpoints > maxpts || b->numpoints > maxpts)
00460         Error ("ClipWinding: points exceeded estimate");
00461     if (f->numpoints > MAX_POINTS_ON_WINDING || b->numpoints > MAX_POINTS_ON_WINDING)
00462         Error ("ClipWinding: MAX_POINTS_ON_WINDING");
00463 }

Here is the call graph for this function:

void ColorToBytes const float *  color,
byte colorBytes
 

Definition at line 1167 of file light.c.

References byte, max, vec3_t, VectorCopy, and VectorScale.

Referenced by TraceGrid(), TraceLtm(), VL_StoreLightmap(), and VS_StoreLightmap().

01167                                                           {
01168     float   max;
01169     vec3_t  sample;
01170 
01171     VectorCopy( color, sample );
01172 
01173     // clamp with color normalization
01174     max = sample[0];
01175     if ( sample[1] > max ) {
01176         max = sample[1];
01177     }
01178     if ( sample[2] > max ) {
01179         max = sample[2];
01180     }
01181     if ( max > 255 ) {
01182         VectorScale( sample, 255/max, sample );
01183     }
01184     colorBytes[ 0 ] = sample[0];
01185     colorBytes[ 1 ] = sample[1];
01186     colorBytes[ 2 ] = sample[2];
01187 }

void CountLightmaps void   ) 
 

Definition at line 225 of file light.c.

References count, drawSurfaces, Error(), i, LIGHTMAP_HEIGHT, LIGHTMAP_WIDTH, dsurface_t::lightmapNum, numDrawSurfaces, numLightBytes, and qprintf().

Referenced by LightMain(), VLightMain(), and VSoundMain().

00225                             {
00226     int         count;
00227     int         i;
00228     dsurface_t  *ds;
00229 
00230     qprintf ("--- CountLightmaps ---\n");
00231     count = 0;
00232     for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
00233         // see if this surface is light emiting
00234         ds = &drawSurfaces[i];
00235         if ( ds->lightmapNum > count ) {
00236             count = ds->lightmapNum;
00237         }
00238     }
00239 
00240     count++;
00241     numLightBytes = count * LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3;
00242     if ( numLightBytes > MAX_MAP_LIGHTING ) {
00243         Error("MAX_MAP_LIGHTING exceeded");
00244     }
00245 
00246     qprintf( "%5i drawSurfaces\n", numDrawSurfaces );
00247     qprintf( "%5i lightmaps\n", count );
00248 }

Here is the call graph for this function:

entity_t* FindTargetEntity const char *  target  ) 
 

Definition at line 443 of file light.c.

References entities, i, n, strcmp(), and ValueForKey().

Referenced by CreateEntityLights(), VL_CreateEntityLights(), and VS_CreateEntitySpeakers().

00443                                                  {
00444     int         i;
00445     const char  *n;
00446 
00447     for ( i = 0 ; i < num_entities ; i++ ) {
00448         n = ValueForKey (&entities[i], "targetname");
00449         if ( !strcmp (n, target) ) {
00450             return &entities[i];
00451         }
00452     }
00453 
00454     return NULL;
00455 }

Here is the call graph for this function:

void FreeWinding winding_t w  ) 
 

Definition at line 92 of file l_poly.c.

00093 {
00094     if (*(unsigned *)w == 0xdeaddead)
00095         Error ("FreeWinding: freed a freed winding");
00096 
00097     if (numthreads == 1)
00098     {
00099         c_active_windings--;
00100         c_windingmemory -= MemorySize(w);
00101     } //end if
00102 
00103     *(unsigned *)w = 0xdeaddead;
00104 
00105     FreeMemory(w);
00106 } //end of the function FreeWinding

void GridAndVertexLighting void   ) 
 

Definition at line 1989 of file light.c.

References _printf(), CreateEntityLights(), CreateFilters(), CreateSurfaceLights(), FindSkyBrushes(), InitTrace(), numDrawSurfaces, numGridPoints, qtrue, RunThreadsOnIndividual(), SetupGrid(), TraceGrid(), TriSoupLightingThread(), and VertexLightingThread().

Referenced by VLightMain(), and VSoundMain().

01989                                  {
01990     SetupGrid();
01991 
01992     FindSkyBrushes();
01993     CreateFilters();
01994     InitTrace();
01995     CreateEntityLights ();
01996     CreateSurfaceLights();
01997 
01998     if (!nogridlighting) {
01999         _printf ("--- TraceGrid ---\n");
02000         RunThreadsOnIndividual( numGridPoints, qtrue, TraceGrid );
02001     }
02002 
02003     if (!novertexlighting) {
02004         _printf ("--- Vertex Lighting ---\n");
02005         RunThreadsOnIndividual( numDrawSurfaces, qtrue, VertexLightingThread );
02006     }
02007 
02008     _printf("--- Model Lighting ---\n");
02009     RunThreadsOnIndividual( numDrawSurfaces, qtrue, TriSoupLightingThread );
02010 }

Here is the call graph for this function:

int Plane_Equal plane_t a,
plane_t b,
int  flip
[static]
 

Definition at line 1139 of file soundv.c.

References a, b, plane_t::dist, fabs(), plane_t::normal, NORMAL_EPSILON, and vec3_t.

01140 {
01141     vec3_t normal;
01142     float dist;
01143 
01144     if (flip) {
01145         normal[0] = - b->normal[0];
01146         normal[1] = - b->normal[1];
01147         normal[2] = - b->normal[2];
01148         dist = - b->dist;
01149     }
01150     else {
01151         normal[0] = b->normal[0];
01152         normal[1] = b->normal[1];
01153         normal[2] = b->normal[2];
01154         dist = b->dist;
01155     }
01156     if (
01157        fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON
01158     && fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON
01159     && fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON
01160     && fabs(a->dist - dist) < DIST_EPSILON )
01161         return qtrue;
01162     return qfalse;
01163 }

Here is the call graph for this function:

int P