mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-06 15:51:25 +00:00
Compile fixes, plus a couple of minor optimizations.
This commit is contained in:
parent
5ee1b1d9ca
commit
09bdd3487b
1 changed files with 22 additions and 24 deletions
|
@ -90,11 +90,11 @@ towards the center until it is valid.
|
||||||
static void
|
static void
|
||||||
CalcFaceVectors (lightinfo_t *l, vec3_t faceorg)
|
CalcFaceVectors (lightinfo_t *l, vec3_t faceorg)
|
||||||
{
|
{
|
||||||
texinfo_t *tex;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
vec3_t texnormal;
|
|
||||||
float distscale;
|
float distscale;
|
||||||
|
vec3_t texnormal;
|
||||||
vec_t dist, len;
|
vec_t dist, len;
|
||||||
|
texinfo_t *tex;
|
||||||
|
|
||||||
tex = &bsp->texinfo[l->face->texinfo];
|
tex = &bsp->texinfo[l->face->texinfo];
|
||||||
|
|
||||||
|
@ -157,11 +157,11 @@ CalcFaceVectors (lightinfo_t *l, vec3_t faceorg)
|
||||||
static void
|
static void
|
||||||
CalcFaceExtents (lightinfo_t *l)
|
CalcFaceExtents (lightinfo_t *l)
|
||||||
{
|
{
|
||||||
|
int i, j, e;
|
||||||
|
vec_t mins[2], maxs[2], val;
|
||||||
dface_t *s;
|
dface_t *s;
|
||||||
dvertex_t *v;
|
dvertex_t *v;
|
||||||
int i, j, e;
|
|
||||||
texinfo_t *tex;
|
texinfo_t *tex;
|
||||||
vec_t mins[2], maxs[2], val;
|
|
||||||
|
|
||||||
s = l->face;
|
s = l->face;
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ CalcFaceExtents (lightinfo_t *l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static inline void
|
||||||
CalcSamples (lightinfo_t *l)
|
CalcSamples (lightinfo_t *l)
|
||||||
{
|
{
|
||||||
l->numsamples = l->texsize[0] * l->texsize[1];
|
l->numsamples = l->texsize[0] * l->texsize[1];
|
||||||
|
@ -215,7 +215,7 @@ CalcSamples (lightinfo_t *l)
|
||||||
static void
|
static void
|
||||||
CalcPoints (lightinfo_t *l)
|
CalcPoints (lightinfo_t *l)
|
||||||
{
|
{
|
||||||
int j , s, t, w, h, realw, realh, stepbit;
|
int realw, realh, stepbit, j, s, t, w, h;
|
||||||
vec_t mids, midt, starts, startt, us, ut;
|
vec_t mids, midt, starts, startt, us, ut;
|
||||||
vec3_t facemid, v;
|
vec3_t facemid, v;
|
||||||
lightpoint_t *point;
|
lightpoint_t *point;
|
||||||
|
@ -276,8 +276,8 @@ SingleLightFace (entity_t *light, lightinfo_t *l)
|
||||||
int mapnum, i;
|
int mapnum, i;
|
||||||
qboolean hit;
|
qboolean hit;
|
||||||
vec3_t incoming, spotvec;
|
vec3_t incoming, spotvec;
|
||||||
vec_t add, angle, dist, idist, lightfalloff, lightsubtract, spotcone;
|
vec_t angle, dist, idist, lightfalloff, lightsubtract, spotcone;
|
||||||
vec_t intensity;
|
vec_t add = 0.0;
|
||||||
lightpoint_t *point;
|
lightpoint_t *point;
|
||||||
lightsample_t *sample;
|
lightsample_t *sample;
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ SingleLightFace (entity_t *light, lightinfo_t *l)
|
||||||
// LordHavoc: changed to be more realistic (entirely different
|
// LordHavoc: changed to be more realistic (entirely different
|
||||||
// lighting model)
|
// lighting model)
|
||||||
// LordHavoc: use subbrightness on all lights, simply to have
|
// LordHavoc: use subbrightness on all lights, simply to have
|
||||||
//some distance culling
|
// some distance culling
|
||||||
add -= lightsubtract;
|
add -= lightsubtract;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,9 @@ SingleLightFace (entity_t *light, lightinfo_t *l)
|
||||||
if (light->noise) {
|
if (light->noise) {
|
||||||
int seed = light - entities;
|
int seed = light - entities;
|
||||||
vec3_t snap;
|
vec3_t snap;
|
||||||
|
vec_t intensity = 0.0;
|
||||||
lightpoint_t *noise_point = point;
|
lightpoint_t *noise_point = point;
|
||||||
|
|
||||||
if (options.extrascale) {
|
if (options.extrascale) {
|
||||||
// FIXME not correct for extrascale > 2
|
// FIXME not correct for extrascale > 2
|
||||||
// We don't want to oversample noise because that just
|
// We don't want to oversample noise because that just
|
||||||
|
@ -382,16 +384,15 @@ SingleLightFace (entity_t *light, lightinfo_t *l)
|
||||||
else if (x % 2)
|
else if (x % 2)
|
||||||
noise_point -= 3;
|
noise_point -= 3;
|
||||||
}
|
}
|
||||||
if (light->noisetype == NOISE_SMOOTH)
|
|
||||||
snap_vector (noise_point->v, snap, 0);
|
|
||||||
else
|
|
||||||
snap_vector (noise_point->v, snap, light->resolution);
|
|
||||||
|
|
||||||
|
if (light->noisetype == NOISE_SMOOTH) {
|
||||||
|
snap_vector (noise_point->v, snap, 0);
|
||||||
|
intensity = noise_scaled (snap, light->resolution, seed);
|
||||||
|
} else
|
||||||
|
snap_vector (noise_point->v, snap, light->resolution);
|
||||||
|
|
||||||
if (light->noisetype == NOISE_RANDOM)
|
if (light->noisetype == NOISE_RANDOM)
|
||||||
intensity = noise3d (snap, seed);
|
intensity = noise3d (snap, seed);
|
||||||
if (light->noisetype == NOISE_SMOOTH)
|
|
||||||
intensity = noise_scaled (snap, light->resolution, seed);
|
|
||||||
if (light->noisetype == NOISE_PERLIN)
|
if (light->noisetype == NOISE_PERLIN)
|
||||||
intensity = noise_perlin (snap, light->persistence, seed);
|
intensity = noise_perlin (snap, light->persistence, seed);
|
||||||
|
|
||||||
|
@ -461,12 +462,10 @@ FixMinlight (lightinfo_t *l)
|
||||||
void
|
void
|
||||||
LightFace (lightinfo_t *l, int surfnum)
|
LightFace (lightinfo_t *l, int surfnum)
|
||||||
{
|
{
|
||||||
byte *out, *lit;
|
byte *lit, *out, *outdata, *rgbdata;
|
||||||
byte *outdata, *rgbdata;
|
int ofs, size, red, green, blue, white, i, j;
|
||||||
dface_t *f;
|
dface_t *f;
|
||||||
int i, j, ofs, size;
|
lightchain_t *lightchain;
|
||||||
int red, green, blue, white;
|
|
||||||
lightchain_t *lightchain;
|
|
||||||
lightsample_t *sample;
|
lightsample_t *sample;
|
||||||
|
|
||||||
f = bsp->faces + surfnum;
|
f = bsp->faces + surfnum;
|
||||||
|
@ -478,9 +477,8 @@ LightFace (lightinfo_t *l, int surfnum)
|
||||||
for (i = 0; i < MAXLIGHTMAPS; i++)
|
for (i = 0; i < MAXLIGHTMAPS; i++)
|
||||||
f->styles[i] = l->lightstyles[i] = 255;
|
f->styles[i] = l->lightstyles[i] = 255;
|
||||||
|
|
||||||
if (bsp->texinfo[f->texinfo].flags & TEX_SPECIAL)
|
if (bsp->texinfo[f->texinfo].flags & TEX_SPECIAL)
|
||||||
// non-lit texture
|
return; // non-lit texture
|
||||||
return;
|
|
||||||
|
|
||||||
// rotate plane
|
// rotate plane
|
||||||
VectorCopy (bsp->planes[f->planenum].normal, l->facenormal);
|
VectorCopy (bsp->planes[f->planenum].normal, l->facenormal);
|
||||||
|
@ -507,7 +505,7 @@ LightFace (lightinfo_t *l, int surfnum)
|
||||||
SingleLightFace (novislights[i], l);
|
SingleLightFace (novislights[i], l);
|
||||||
}
|
}
|
||||||
|
|
||||||
//FixMinlight (&l);
|
// FixMinlight (&l);
|
||||||
|
|
||||||
for (i = 0; i < MAXLIGHTMAPS; i++)
|
for (i = 0; i < MAXLIGHTMAPS; i++)
|
||||||
if (l->lightstyles[i] == 255)
|
if (l->lightstyles[i] == 255)
|
||||||
|
|
Loading…
Reference in a new issue