saneified dynamic light colour values.
added preliminary support for some rtlight cubemaps. no longer using tmpfile in win32 - its too unreliable. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3942 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
54358b62b2
commit
f32a88f684
24 changed files with 458 additions and 467 deletions
|
@ -800,7 +800,7 @@ static qintptr_t CG_SystemCalls(void *offset, quintptr_t mask, qintptr_t fn, con
|
|||
case CG_R_ADDLIGHTTOSCENE: //add light to scene.
|
||||
{
|
||||
float *org = VM_POINTER(arg[0]);
|
||||
CL_NewDlightRGB(-1, org, VM_FLOAT(arg[1]), 0, VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]));
|
||||
CL_NewDlight(-1, org, VM_FLOAT(arg[1]), 0, VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]));
|
||||
}
|
||||
break;
|
||||
case CG_R_RENDERSCENE: //render scene
|
||||
|
|
|
@ -189,27 +189,7 @@ dlight_t *CL_AllocDlight (int key)
|
|||
CL_NewDlight
|
||||
===============
|
||||
*/
|
||||
dlight_t *CL_NewDlight (int key, const vec3_t org, float radius, float time, int type)
|
||||
{
|
||||
static const vec3_t lightcolour[] =
|
||||
{
|
||||
{0.2, 0.1, 0.05},
|
||||
{0.05, 0.05, 0.3},
|
||||
{0.5, 0.05, 0.05},
|
||||
{0.5, 0.05, 0.4}
|
||||
};
|
||||
dlight_t *dl;
|
||||
if (type >= sizeof(lightcolour)/sizeof(lightcolour[0]))
|
||||
type = 0;
|
||||
|
||||
dl = CL_AllocDlight (key);
|
||||
VectorCopy(org, dl->origin);
|
||||
dl->radius = radius;
|
||||
dl->die = (float)cl.time + time;
|
||||
VectorCopy(lightcolour[type], dl->color);
|
||||
return dl;
|
||||
}
|
||||
dlight_t *CL_NewDlightRGB (int key, const vec3_t org, float radius, float time,
|
||||
dlight_t *CL_NewDlight (int key, const vec3_t org, float radius, float time,
|
||||
float r, float g, float b)
|
||||
{
|
||||
dlight_t *dl;
|
||||
|
@ -225,6 +205,12 @@ dlight_t *CL_NewDlightRGB (int key, const vec3_t org, float radius, float time,
|
|||
return dl;
|
||||
}
|
||||
|
||||
dlight_t *CL_NewDlightRGB(int key, const vec3_t org, float radius, float time,
|
||||
float r, float g, float b)
|
||||
{
|
||||
return CL_NewDlight(key, org, radius, time, r*5, g*5, b*5);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
|
@ -2050,36 +2036,36 @@ void CL_LinkPacketEntities (void)
|
|||
if (state->effects & EF_BRIGHTLIGHT)
|
||||
{
|
||||
radius = max(radius,400);
|
||||
colour[0] += 0.2;
|
||||
colour[1] += 0.1;
|
||||
colour[2] += 0.05;
|
||||
colour[0] += 2.0;
|
||||
colour[1] += 1.0;
|
||||
colour[2] += 0.5;
|
||||
}
|
||||
if (state->effects & EF_DIMLIGHT)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.2;
|
||||
colour[1] += 0.1;
|
||||
colour[2] += 0.05;
|
||||
colour[0] += 2.0;
|
||||
colour[1] += 1.0;
|
||||
colour[2] += 0.5;
|
||||
}
|
||||
if (state->effects & EF_BLUE)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.05;
|
||||
colour[1] += 0.05;
|
||||
colour[2] += 0.3;
|
||||
colour[0] += 0.5;
|
||||
colour[1] += 0.5;
|
||||
colour[2] += 3.0;
|
||||
}
|
||||
if (state->effects & EF_RED)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.5;
|
||||
colour[1] += 0.05;
|
||||
colour[2] += 0.05;
|
||||
colour[0] += 5.0;
|
||||
colour[1] += 0.5;
|
||||
colour[2] += 0.5;
|
||||
}
|
||||
|
||||
if (radius)
|
||||
{
|
||||
radius += r_lightflicker.value?((flicker + state->number)&31):0;
|
||||
CL_NewDlightRGB(state->number, state->origin, radius, 0.1, colour[0], colour[1], colour[2]);
|
||||
CL_NewDlight(state->number, state->origin, radius, 0.1, colour[0], colour[1], colour[2]);
|
||||
}
|
||||
}
|
||||
if (state->lightpflags & PFLAGS_FULLDYNAMIC)
|
||||
|
@ -2095,7 +2081,8 @@ void CL_LinkPacketEntities (void)
|
|||
colour[1] = state->light[1]/1024.0f;
|
||||
colour[2] = state->light[2]/1024.0f;
|
||||
}
|
||||
CL_NewDlightRGB(state->number, state->origin, state->light[3]?state->light[3]:350, 0.1, colour[0], colour[1], colour[2]);
|
||||
CL_NewDlight(state->number, state->origin, state->light[3]?state->light[3]:350, 0.1, colour[0], colour[1], colour[2]);
|
||||
/*FIXME: .skin is meant to be "cubemaps/%i" */
|
||||
}
|
||||
|
||||
// if set to invisible, skip
|
||||
|
@ -2998,23 +2985,23 @@ void CL_LinkPlayers (void)
|
|||
if (state->effects & EF_DIMLIGHT)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.2;
|
||||
colour[1] += 0.1;
|
||||
colour[2] += 0.05;
|
||||
colour[0] += 2.0;
|
||||
colour[1] += 1.0;
|
||||
colour[2] += 0.5;
|
||||
}
|
||||
if (state->effects & EF_BLUE)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.05;
|
||||
colour[1] += 0.05;
|
||||
colour[2] += 0.3;
|
||||
colour[0] += 0.5;
|
||||
colour[1] += 0.5;
|
||||
colour[2] += 3.0;
|
||||
}
|
||||
if (state->effects & EF_RED)
|
||||
{
|
||||
radius = max(radius,200);
|
||||
colour[0] += 0.5;
|
||||
colour[1] += 0.05;
|
||||
colour[2] += 0.05;
|
||||
colour[0] += 5.0;
|
||||
colour[1] += 0.5;
|
||||
colour[2] += 0.5;
|
||||
}
|
||||
|
||||
if (radius)
|
||||
|
@ -3039,7 +3026,7 @@ void CL_LinkPlayers (void)
|
|||
}
|
||||
radius += (flicker+j)&31;
|
||||
}
|
||||
CL_NewDlightRGB(j+1, org, radius, 0.1, colour[0], colour[1], colour[2])->flags &= ~LFLAG_FLASHBLEND;
|
||||
CL_NewDlight(j+1, org, radius, 0.1, colour[0], colour[1], colour[2])->flags &= ~LFLAG_FLASHBLEND;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3176,7 +3163,7 @@ void CL_LinkPlayers (void)
|
|||
if (r_torch.ival)
|
||||
{
|
||||
dlight_t *dl;
|
||||
dl = CL_NewDlightRGB(j+1, ent->origin, 300, r_torch.ival, 0.05, 0.05, 0.02);
|
||||
dl = CL_NewDlight(j+1, ent->origin, 300, r_torch.ival, 0.5, 0.5, 0.2);
|
||||
dl->flags |= LFLAG_SHADOWMAP|LFLAG_FLASHBLEND;
|
||||
dl->fov = 60;
|
||||
angles[0] *= 3;
|
||||
|
|
|
@ -1077,9 +1077,9 @@ void CL_ParseTEnt (void)
|
|||
dl->die = cl.time + 1;
|
||||
dl->decay = 300;
|
||||
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.155;
|
||||
dl->color[2] = 0.05;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 0.775;
|
||||
dl->color[2] = 0.25;
|
||||
dl->channelfade[0] = 0.196;
|
||||
dl->channelfade[1] = 0.23;
|
||||
dl->channelfade[2] = 0.12;
|
||||
|
@ -1117,9 +1117,9 @@ void CL_ParseTEnt (void)
|
|||
dl->die = cl.time + 1;
|
||||
dl->decay = 300;
|
||||
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.155;
|
||||
dl->color[2] = 0.05;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 0.775;
|
||||
dl->color[2] = 0.25;
|
||||
dl->channelfade[0] = 0.196;
|
||||
dl->channelfade[1] = 0.23;
|
||||
dl->channelfade[2] = 0.12;
|
||||
|
@ -1189,9 +1189,9 @@ void CL_ParseTEnt (void)
|
|||
dl->die = cl.time + 1;
|
||||
dl->decay = 500;
|
||||
|
||||
dl->color[0] = 0.4f;
|
||||
dl->color[1] = 0.3f;
|
||||
dl->color[2] = 0.15f;
|
||||
dl->color[0] = 2.0f;
|
||||
dl->color[1] = 1.5f;
|
||||
dl->color[2] = 0.75f;
|
||||
dl->channelfade[0] = 0;
|
||||
dl->channelfade[1] = 0;
|
||||
dl->channelfade[2] = 0;
|
||||
|
@ -1371,9 +1371,9 @@ void CL_ParseTEnt (void)
|
|||
dl->radius = 200;
|
||||
dl->decay = 1000;
|
||||
dl->die = cl.time + 0.2;
|
||||
dl->color[0] = 0.4;
|
||||
dl->color[1] = 0.4;
|
||||
dl->color[2] = 0.4;
|
||||
dl->color[0] = 2.0;
|
||||
dl->color[1] = 2.0;
|
||||
dl->color[2] = 2.0;
|
||||
break;
|
||||
|
||||
case TEDP_CUSTOMFLASH:
|
||||
|
@ -1389,10 +1389,9 @@ void CL_ParseTEnt (void)
|
|||
dl->die = cl.time + pos2[0];
|
||||
dl->decay = dl->radius / pos2[0];
|
||||
|
||||
// DP's range is 0-2 for lights, FTE is 0-0.4.. 255/637.5 = 0.4
|
||||
dl->color[0] = MSG_ReadByte()*(1.0f/637.5f);
|
||||
dl->color[1] = MSG_ReadByte()*(1.0f/637.5f);
|
||||
dl->color[2] = MSG_ReadByte()*(1.0f/637.5f);
|
||||
dl->color[0] = MSG_ReadByte()*(1.0f/127.0f);
|
||||
dl->color[1] = MSG_ReadByte()*(1.0f/127.5f);
|
||||
dl->color[2] = MSG_ReadByte()*(1.0f/127.0f);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1426,9 +1425,9 @@ void CL_ParseTEnt (void)
|
|||
dl->radius = 200;
|
||||
dl->decay = 1000;
|
||||
dl->die = cl.time + 0.2;
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.2;
|
||||
dl->color[2] = 0.2;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 1.0;
|
||||
dl->color[2] = 1.0;
|
||||
|
||||
// stain (Hopefully this is close to how DP does it)
|
||||
R_AddStain(pos, -10, -10, -10, 30);
|
||||
|
@ -2110,8 +2109,8 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 * r_explosionlight.value;
|
||||
dl->die = cl.time + 0.4;
|
||||
dl->decay = 400;
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.2;
|
||||
dl->color[0] = 1;
|
||||
dl->color[1] = 1;
|
||||
dl->color[2] = 0.0;
|
||||
dl->channelfade[0] = 0.5;
|
||||
dl->channelfade[1] = 0.51;
|
||||
|
@ -2147,9 +2146,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 + r_explosionlight.value*200;
|
||||
dl->die = cl.time + 0.5;
|
||||
dl->decay = 300;
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.1;
|
||||
dl->color[2] = 0.1;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 0.5;
|
||||
dl->color[2] = 0.5;
|
||||
dl->channelfade[0] = 0.36;
|
||||
dl->channelfade[1] = 0.19;
|
||||
dl->channelfade[2] = 0.19;
|
||||
|
@ -2243,9 +2242,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 + r_explosionlight.value*200;
|
||||
dl->die = cl.time + 0.5;
|
||||
dl->decay = 300;
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.1;
|
||||
dl->color[2] = 0.08;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 0.5;
|
||||
dl->color[2] = 0.4;
|
||||
dl->channelfade[0] = 0.36;
|
||||
dl->channelfade[1] = 0.19;
|
||||
dl->channelfade[2] = 0.19;
|
||||
|
@ -2440,9 +2439,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 * r_explosionlight.value;
|
||||
dl->die = cl.time + 0.4;
|
||||
dl->decay = 400;
|
||||
dl->color[0] = 0.01;
|
||||
dl->color[1] = 0.2;
|
||||
dl->color[2] = 0.01;
|
||||
dl->color[0] = 0.05;
|
||||
dl->color[1] = 1.0;
|
||||
dl->color[2] = 0.05;
|
||||
dl->channelfade[0] = 0.1;
|
||||
dl->channelfade[1] = 0.5;
|
||||
dl->channelfade[2] = 0.1;
|
||||
|
@ -2490,9 +2489,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 * r_explosionlight.value;
|
||||
dl->die = cl.time + 0.4;
|
||||
dl->decay = 400;
|
||||
dl->color[0] = 0.038;
|
||||
dl->color[1] = 0.082;
|
||||
dl->color[2] = 0.150;
|
||||
dl->color[0] = 0.19;
|
||||
dl->color[1] = 0.41;
|
||||
dl->color[2] = 0.75;
|
||||
dl->channelfade[0] = 0.085;
|
||||
dl->channelfade[1] = 0.180;
|
||||
dl->channelfade[2] = 0.300;
|
||||
|
@ -2535,9 +2534,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 + r_explosionlight.value*200;
|
||||
dl->die = cl.time + 0.5;
|
||||
dl->decay = 300;
|
||||
dl->color[0] = 0.2;
|
||||
dl->color[1] = 0.1;
|
||||
dl->color[2] = 0.08;
|
||||
dl->color[0] = 1.0;
|
||||
dl->color[1] = 0.5;
|
||||
dl->color[2] = 0.4;
|
||||
dl->channelfade[0] = 0.36;
|
||||
dl->channelfade[1] = 0.19;
|
||||
dl->channelfade[2] = 0.19;
|
||||
|
@ -2650,9 +2649,9 @@ void CLQ2_ParseTEnt (void)
|
|||
dl->radius = 150 * r_explosionlight.value;
|
||||
dl->die = cl.time + 0.1;
|
||||
dl->minlight = 250;
|
||||
dl->color[0] = -0.2;
|
||||
dl->color[1] = -0.2;
|
||||
dl->color[2] = -0.2;
|
||||
dl->color[0] = -1.0;
|
||||
dl->color[1] = -1.0;
|
||||
dl->color[2] = -1.0;
|
||||
}
|
||||
|
||||
// sound
|
||||
|
|
|
@ -579,7 +579,7 @@ void VQ3_RenderView(const q3refdef_t *ref)
|
|||
if (r_torch.ival)
|
||||
{
|
||||
dlight_t *dl;
|
||||
dl = CL_NewDlightRGB(0, ref->vieworg, 300, r_torch.ival, 0.05, 0.05, 0.02);
|
||||
dl = CL_NewDlight(0, ref->vieworg, 300, r_torch.ival, 0.5, 0.5, 0.2);
|
||||
dl->flags |= LFLAG_SHADOWMAP|LFLAG_FLASHBLEND;
|
||||
dl->fov = 60;
|
||||
VectorCopy(ref->viewaxis[0], dl->axis[0]);
|
||||
|
|
|
@ -1288,7 +1288,7 @@ int CLHL_ParseGamePacket(void)
|
|||
if (!(flags & 4))
|
||||
S_StartSound(0, 0, S_PrecacheSound("explosion"), startp, 1, 1);
|
||||
if (!(flags & 2))
|
||||
CL_NewDlightRGB(0, startp, 200, 1, 0.2,0.2,0.2);
|
||||
CL_NewDlight(0, startp, 200, 1, 2.0,2.0,2.0);
|
||||
|
||||
ef = CL_AllocExplosion();
|
||||
VectorCopy(startp, ef->origin);
|
||||
|
|
|
@ -770,7 +770,7 @@ void CL_InitDlights(void);
|
|||
void CL_FreeDlights(void);
|
||||
dlight_t *CL_AllocDlight (int key);
|
||||
dlight_t *CL_AllocSlight (void); //allocates a static light
|
||||
dlight_t *CL_NewDlight (int key, const vec3_t origin, float radius, float time, int type);
|
||||
dlight_t *CL_NewDlight (int key, const vec3_t origin, float radius, float time, float r, float g, float b);
|
||||
dlight_t *CL_NewDlightRGB (int key, const vec3_t origin, float radius, float time, float r, float g, float b);
|
||||
dlight_t *CL_NewDlightCube (int key, const vec3_t origin, vec3_t angles, float radius, float time, vec3_t colours);
|
||||
void CL_DecayLights (void);
|
||||
|
|
|
@ -1588,7 +1588,7 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
|
|||
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_rocket, ent.keynum, ¢->trailstate))
|
||||
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xdc, 4, ¢->trailstate);
|
||||
|
||||
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.2, 0);
|
||||
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.1, 0.05);
|
||||
}
|
||||
// PGM - Do not reorder EF_BLASTER and EF_HYPERBLASTER.
|
||||
// EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
|
||||
|
|
|
@ -2342,7 +2342,6 @@ static struct
|
|||
};
|
||||
|
||||
int image_width, image_height;
|
||||
//fixme: should probably get rid of the 'Mod' prefix, and use something more suitable.
|
||||
texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
||||
{
|
||||
qboolean alphaed;
|
||||
|
@ -2368,19 +2367,71 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
}
|
||||
|
||||
snprintf(fname, sizeof(fname)-1, "%s/%s", subpath, name); /*should be safe if its null*/
|
||||
if (subpath && *subpath)
|
||||
if (subpath && *subpath && !(flags & IF_REPLACE))
|
||||
{
|
||||
tex = R_FindTexture(fname);
|
||||
if (TEXVALID(tex)) //don't bother if it already exists.
|
||||
return tex;
|
||||
}
|
||||
if (!(flags & IF_SUBDIRONLY))
|
||||
if (!(flags & IF_SUBDIRONLY) && !(flags & IF_REPLACE))
|
||||
{
|
||||
tex = R_FindTexture(name);
|
||||
if (TEXVALID(tex)) //don't bother if it already exists.
|
||||
return tex;
|
||||
}
|
||||
|
||||
if ((flags & IF_TEXTYPE) == IF_CUBEMAP)
|
||||
{
|
||||
int j;
|
||||
char *suf[] =
|
||||
{
|
||||
// "rt", "lf", "ft", "bk", "up", "dn",
|
||||
"px", "nx", "py", "ny", "pz", "nz",
|
||||
"posx", "negx", "posy", "negy", "posz", "negz"
|
||||
};
|
||||
flags |= IF_REPLACE;
|
||||
|
||||
tex = r_nulltex;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
tex = r_nulltex;
|
||||
for (e = sizeof(tex_extensions)/sizeof(tex_extensions[0])-1; e >=0 ; e--)
|
||||
{
|
||||
if (!tex_extensions[e].enabled)
|
||||
continue;
|
||||
|
||||
buf = NULL;
|
||||
for (j = 0; j < sizeof(suf)/sizeof(suf[0])/6; j++)
|
||||
{
|
||||
snprintf(fname, sizeof(fname)-1, "%s%s%s", nicename, suf[i + 6*j], tex_extensions[e].name);
|
||||
buf = COM_LoadFile (fname, 5);
|
||||
if (buf)
|
||||
break;
|
||||
}
|
||||
|
||||
if (buf)
|
||||
{
|
||||
if ((data = Read32BitImageFile(buf, com_filesize, &image_width, &image_height, fname)))
|
||||
{
|
||||
extern cvar_t vid_hardwaregamma;
|
||||
if (!(flags&IF_NOGAMMA) && !vid_hardwaregamma.value)
|
||||
BoostGamma(data, image_width, image_height);
|
||||
|
||||
tex = R_LoadTexture32 (name, image_width, image_height, data, (flags | IF_REPLACE) + (i << IF_TEXTYPESHIFT));
|
||||
|
||||
BZ_Free(data);
|
||||
BZ_Free(buf);
|
||||
if (TEXVALID(tex))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!TEXVALID(tex))
|
||||
return r_nulltex;
|
||||
}
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
||||
if (subpath && *subpath)
|
||||
{
|
||||
|
|
|
@ -2416,7 +2416,7 @@ static void PScript_EffectSpawned(part_type_t *ptype, vec3_t org, vec3_t dir, in
|
|||
}
|
||||
if (ptype->dl_radius)
|
||||
{
|
||||
dlight_t *dl = CL_NewDlightRGB(dlkey, org, ptype->dl_radius, ptype->dl_time, ptype->dl_rgb[0], ptype->dl_rgb[1], ptype->dl_rgb[2]);
|
||||
dlight_t *dl = CL_NewDlight(dlkey, org, ptype->dl_radius, ptype->dl_time, ptype->dl_rgb[0], ptype->dl_rgb[1], ptype->dl_rgb[2]);
|
||||
dl->channelfade[0] = ptype->dl_decay[0];
|
||||
dl->channelfade[1] = ptype->dl_decay[1];
|
||||
dl->channelfade[2] = ptype->dl_decay[2];
|
||||
|
|
|
@ -833,7 +833,7 @@ static void QCBUILTIN PF_R_DynamicLight_Add(progfuncs_t *prinst, struct globalva
|
|||
dlight_t *dl;
|
||||
|
||||
//if the org matches self, then attach it.
|
||||
dl = CL_NewDlightRGB (VectorCompare(self->v->origin, org)?-self->entnum:0, org, radius, -0.1, rgb[0], rgb[1], rgb[2]);
|
||||
dl = CL_NewDlight (VectorCompare(self->v->origin, org)?-self->entnum:0, org, radius, -0.1, rgb[0], rgb[1], rgb[2]);
|
||||
|
||||
if (pflags & PFLAGS_NOSHADOW)
|
||||
dl->flags |= LFLAG_NOSHADOWS;
|
||||
|
@ -3266,43 +3266,6 @@ static void QCBUILTIN PF_rotatevectorsbytag (progfuncs_t *prinst, struct globalv
|
|||
VectorCopy(srcorg, retorg);
|
||||
}
|
||||
|
||||
static void QCBUILTIN PF_rotatevectorsbyangles (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
float *ang = G_VECTOR(OFS_PARM0);
|
||||
vec3_t src[3], trans[3], res[3];
|
||||
ang[0]*=-1;
|
||||
AngleVectors(ang, trans[0], trans[1], trans[2]);
|
||||
ang[0]*=-1;
|
||||
VectorInverse(trans[1]);
|
||||
|
||||
VectorCopy(csqcg.forward, src[0]);
|
||||
VectorNegate(csqcg.right, src[1]);
|
||||
VectorCopy(csqcg.up, src[2]);
|
||||
|
||||
R_ConcatRotations(trans, src, res);
|
||||
|
||||
VectorCopy(res[0], csqcg.forward);
|
||||
VectorNegate(res[1], csqcg.right);
|
||||
VectorCopy(res[2], csqcg.up);
|
||||
}
|
||||
static void QCBUILTIN PF_rotatevectorsbymatrix (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
vec3_t src[3], trans[3], res[3];
|
||||
|
||||
VectorCopy(G_VECTOR(OFS_PARM0), src[0]);
|
||||
VectorNegate(G_VECTOR(OFS_PARM1), src[1]);
|
||||
VectorCopy(G_VECTOR(OFS_PARM2), src[2]);
|
||||
|
||||
VectorCopy(csqcg.forward, src[0]);
|
||||
VectorNegate(csqcg.right, src[1]);
|
||||
VectorCopy(csqcg.up, src[2]);
|
||||
|
||||
R_ConcatRotations(trans, src, res);
|
||||
|
||||
VectorCopy(res[0], csqcg.forward);
|
||||
VectorNegate(res[1], csqcg.right);
|
||||
VectorCopy(res[2], csqcg.up);
|
||||
}
|
||||
static void QCBUILTIN PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
int modelindex = G_FLOAT(OFS_PARM0);
|
||||
|
|
|
@ -363,7 +363,7 @@ static void Surf_AddDynamicLights (msurface_t *surf)
|
|||
local[0] -= surf->texturemins[0];
|
||||
local[1] -= surf->texturemins[1];
|
||||
|
||||
a = 256*(cl_dlights[lnum].color[0]*1.5 + cl_dlights[lnum].color[1]*2.95 + cl_dlights[lnum].color[2]*0.55);
|
||||
a = 256*(cl_dlights[lnum].color[0]*NTSC_RED + cl_dlights[lnum].color[1]*NTSC_GREEN + cl_dlights[lnum].color[2]*NTSC_BLUE);
|
||||
|
||||
bl = blocklights;
|
||||
for (t = 0 ; t<tmax ; t++)
|
||||
|
@ -510,9 +510,9 @@ static void Surf_AddDynamicLightsColours (msurface_t *surf)
|
|||
local[0] -= surf->texturemins[0];
|
||||
local[1] -= surf->texturemins[1];
|
||||
|
||||
r = cl_dlights[lnum].color[0]*256;
|
||||
g = cl_dlights[lnum].color[1]*256;
|
||||
b = cl_dlights[lnum].color[2]*256;
|
||||
r = cl_dlights[lnum].color[0]*128;
|
||||
g = cl_dlights[lnum].color[1]*128;
|
||||
b = cl_dlights[lnum].color[2]*128;
|
||||
|
||||
/* if (cl_dlights[lnum].type == 1) //a wierd effect.
|
||||
{
|
||||
|
|
|
@ -270,9 +270,13 @@ enum imageflags
|
|||
IF_NOALPHA = 1<<3,
|
||||
IF_NOGAMMA = 1<<4,
|
||||
IF_NEAREST = 1<<5,
|
||||
IF_CUBEMAP = 1<<6,
|
||||
IF_3DMAP = 1<<7,
|
||||
IF_3DMAP = 1<<6, /*waning - don't test directly*/
|
||||
IF_CUBEMAP = 1<<7, /*waning - don't test directly*/
|
||||
IF_CUBEMAPEXTRA = 1<<8,
|
||||
IF_TEXTYPE = (1<<6) | (1<<7) | (1<<8), /*0=2d, 1=3d, 2-7=cubeface*/
|
||||
IF_TEXTYPESHIFT = 6, /*0=2d, 1=3d, 2-7=cubeface*/
|
||||
|
||||
IF_REPLACE = 1<<30,
|
||||
IF_SUBDIRONLY = 1<<31
|
||||
};
|
||||
|
||||
|
|
|
@ -211,6 +211,7 @@ cvar_t r_polygonoffset_submodel_offset = SCVAR("r_polygonoffset_submodel_offset"
|
|||
rendererstate_t currentrendererstate;
|
||||
|
||||
#if defined(GLQUAKE)
|
||||
cvar_t gl_workaround_ati_shadersource = CVARD ("gl_workaround_ati_shadersource", "1", "Work around ATI driver bugs in the glShaderSource function. Can safely be enabled with other drivers too.");
|
||||
cvar_t vid_gl_context_version = SCVAR ("vid_gl_context_version", "");
|
||||
cvar_t vid_gl_context_forwardcompatible = SCVAR ("vid_gl_context_forwardcompatible", "0");
|
||||
cvar_t vid_gl_context_compatibility = SCVAR ("vid_gl_context_compatibility", "1");
|
||||
|
@ -338,6 +339,7 @@ void GLRenderer_Init(void)
|
|||
extern cvar_t gl_contrast;
|
||||
|
||||
//gl-specific video vars
|
||||
Cvar_Register (&gl_workaround_ati_shadersource, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&vid_gl_context_version, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&vid_gl_context_debug, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&vid_gl_context_forwardcompatible, GLRENDEREROPTIONS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue