53 for (
int i = 0;
i <
curTile->numtexinfo;
i++) {
55 for (j = 0; j <
i; j++) {
73 texels = surf->w * surf->h;
74 color[0] = color[1] = color[2] = 0;
76 for(j = 0; j < texels; j++){
77 const byte* pos = (
byte*)surf->pixels + j * 4;
85 SDL_FreeSurface(surf);
87 for(j = 0; j < 3; j++){
88 const float r = color[j] / texels / 255.0;
100 for (
int i = 0;
i <
f->numedges;
i++) {
101 const int se =
curTile->surfedges[
f->firstedge +
i];
121 tex = &
curTile->texinfo[
f->texinfo];
172 if (patch->
area < 1.0)
202 for (
int i = 0;
i <
curTile->nummodels;
i++) {
210 for (
int j = 0; j < mod->
numfaces; j++) {
236#define PATCH_SUBDIVIDE 64
246 if (patch->
area < 1.0)
251 if (newp->
area < 1.0)
280 for (
i = 0;
i < 3;
i++) {
void GetVectorForKey(const entity_t *ent, const char *key, vec3_t vec)
Converts the value of a entity parameter into a vec3_t.
entity_t entities[MAX_MAP_ENTITIES]
const char * ValueForKey(const entity_t *ent, const char *key)
SDL_Surface * Img_LoadImage(char const *name)
Loads the specified image from the game filesystem into an SDL_Surface.
Image loading and saving functions.
vec3_t face_offset[MAX_MAP_FACES]
patch_t * face_patches[MAX_MAP_FACES]
void VectorMA(const vec3_t veca, const float scale, const vec3_t vecb, vec3_t outVector)
Sets vector_out (vc) to vevtor1 (va) + scale * vector2 (vb).
#define Mem_AllocType(type)
void SubdividePatches(void)
Iterate all of the head face patches, subdividing them as necessary.
static entity_t * EntityForModel(int modnum)
void CalcTextureReflectivity(void)
Calculates the texture color that is used for light emitting surfaces.
static vec3_t texture_reflectivity[MAX_MAP_TEXINFO]
void FreePatches(void)
After light sources have been created, patches may be freed.
static void FinishSubdividePatch(patch_t *patch, patch_t *newp)
static void SubdividePatch(patch_t *patch)
Chops the patch by a global grid.
static void BuildPatch(int fn, winding_t *w)
Build a patch for a surface that emits light.
static winding_t * WindingFromFace(const dBspSurface_t *f)
static void EmissiveLight(patch_t *patch)
Check for light emitted by texture.
static bool HasLight(const dBspSurface_t *f)
void BuildPatches(void)
Create surface fragments for light-emitting surfaces so that light sources may be computed along them...
winding_t * AllocWinding(int points)
Allocate a new winding (polygon).
void RemoveColinearPoints(winding_t *w)
void WindingCenter(const winding_t *w, vec3_t center)
void WindingBounds(const winding_t *w, vec3_t mins, vec3_t maxs)
vec_t WindingArea(const winding_t *w)
void ClipWindingEpsilon(const winding_t *in, const vec3_t normal, const vec_t dist, const vec_t epsilon, winding_t **front, winding_t **back)
QGL_EXTERN int GLboolean GLfloat * v
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
for storing the vertices of the side of a brush or other polygon
#define VectorNegate(src, dest)
#define VectorCopy(src, dest)
#define VectorAdd(a, b, dest)
#define VectorSet(v, x, y, z)
#define VectorScale(in, scale, out)