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++) {
172 if (patch->
area < 1.0)
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]
void SubdividePatches(void)
Iterate all of the head face patches, subdividing them as necessary.
patch_t * face_patches[MAX_MAP_FACES]
void CalcTextureReflectivity(void)
Calculates the texture color that is used for light emitting surfaces.
void FreePatches(void)
After light sources have been created, patches may be freed.
void BuildPatches(void)
Create surface fragments for light-emitting surfaces so that light sources may be computed along them...
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)
static entity_t * EntityForModel(int modnum)
static vec3_t texture_reflectivity[MAX_MAP_TEXINFO]
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)
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
dBspEdge_t edges[MAX_MAP_EDGES]
dBspModel_t models[MAX_MAP_MODELS]
dBspPlane_t planes[MAX_MAP_PLANES]
dBspTexinfo_t texinfo[MAX_MAP_TEXINFO]
int surfedges[MAX_MAP_SURFEDGES]
dBspVertex_t vertexes[MAX_MAP_VERTS]
dBspSurface_t faces[MAX_MAP_FACES]
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)