patches.c File Reference

#include "lighting.h"
#include "bsp.h"
#include "../../shared/images.h"
Include dependency graph for patches.c:

Go to the source code of this file.

Defines

#define PATCH_SUBDIVIDE   64

Functions

void CalcTextureReflectivity (void)
static winding_tWindingFromFace (const dBspSurface_t *f)
static qboolean HasLight (const dBspSurface_t *f)
static void EmissiveLight (patch_t *patch)
 Check for light emited by texture.
static void BuildPatch (int fn, winding_t *w)
static entity_tEntityForModel (int modnum)
void BuildPatches (void)
 Create surface fragments for light-emitting surfaces so that light sources may be computed along them. This function is responsible for one.
static void FinishSubdividePatch (patch_t *patch, patch_t *newp)
static void SubdividePatch (patch_t *patch)
 Chops the patch by a global grid.
void SubdividePatches (void)
 Iterate all of the head face patches, subdividing them as necessary.
void FreePatches (void)
 After light sources have been created, patches may be freed.

Variables

static vec3_t texture_reflectivity [MAX_MAP_TEXINFO]
patch_tface_patches [MAX_MAP_FACES]

Detailed Description

Definition in file patches.c.


Define Documentation

#define PATCH_SUBDIVIDE   64

Definition at line 235 of file patches.c.

Referenced by SubdividePatch().


Function Documentation

static void BuildPatch ( int  fn,
winding_t w 
) [static]
void BuildPatches ( void   ) 

Create surface fragments for light-emitting surfaces so that light sources may be computed along them. This function is responsible for one.

Definition at line 194 of file patches.c.

References BuildPatch(), curTile, EntityForModel(), f, face_offset, dMapTile_t::faces, dBspModel_t::firstface, GetVectorForKey(), HasLight(), i, dMapTile_t::models, dBspModel_t::numfaces, dMapTile_t::nummodels, winding_s::numpoints, winding_s::p, VectorAdd, VectorCopy, and WindingFromFace().

Referenced by LightWorld().

void CalcTextureReflectivity ( void   ) 
static void EmissiveLight ( patch_t patch  )  [inline, static]

Check for light emited by texture.

Note:
Surface lights
See also:
TexinfoForBrushTexture

Definition at line 130 of file patches.c.

References curTile, patch_s::face, HasLight(), patch_s::light, dBspSurface_t::texinfo, dMapTile_t::texinfo, texture_reflectivity, texinfo_s::value, and VectorScale.

Referenced by BuildPatch().

static entity_t* EntityForModel ( int  modnum  )  [static]

Definition at line 173 of file patches.c.

References Com_sprintf(), entities, i, name, num_entities, and ValueForKey().

Referenced by BuildPatches().

static void FinishSubdividePatch ( patch_t patch,
patch_t newp 
) [static]
void FreePatches ( void   ) 

After light sources have been created, patches may be freed.

Definition at line 326 of file patches.c.

References i, MAX_MAP_FACES, Mem_Free, and patch_s::next.

Referenced by LightWorld().

static qboolean HasLight ( const dBspSurface_t f  )  [inline, static]
static void SubdividePatch ( patch_t patch  )  [static]

Chops the patch by a global grid.

Definition at line 265 of file patches.c.

References ClipWindingEpsilon(), FinishSubdividePatch(), i, Mem_Alloc, patch_s::next, ON_EPSILON, PATCH_SUBDIVIDE, VectorClear, patch_s::winding, and WindingBounds().

Referenced by SubdividePatches().

void SubdividePatches ( void   ) 

Iterate all of the head face patches, subdividing them as necessary.

Definition at line 311 of file patches.c.

References i, MAX_MAP_FACES, and SubdividePatch().

Referenced by LightWorld().

static winding_t* WindingFromFace ( const dBspSurface_t f  )  [static]

Variable Documentation

patch_t* face_patches[MAX_MAP_FACES]

Definition at line 30 of file patches.c.

Referenced by BuildLights().

vec3_t texture_reflectivity[MAX_MAP_TEXINFO] [static]

Definition at line 29 of file patches.c.

Referenced by CalcTextureReflectivity(), and EmissiveLight().


Generated by  doxygen 1.6.2