mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-10 06:31:35 +00:00
Clamp lighting on amods
This commit is contained in:
parent
dbd7d0a193
commit
e1ef072c26
5 changed files with 20 additions and 64 deletions
|
@ -753,24 +753,6 @@ void CL_RelinkEntities (void)
|
|||
dl->type = SetDlightColor (2, lt_rocket, true);
|
||||
}
|
||||
|
||||
if (!strcmp(ent->model->name, "progs/flame2.mdl"))
|
||||
{
|
||||
if (qmb_initialized && r_part_flames.value)
|
||||
{
|
||||
//QMB_BigTorchFlame (ent->origin);
|
||||
if (qmb_initialized && r_part_trails.value)
|
||||
R_RocketTrail (oldorg, ent->origin, LAVA_TRAIL);
|
||||
}
|
||||
}
|
||||
|
||||
if ((!strcmp(ent->model->name, "progs/s_spike.mdl"))||(!strcmp(ent->model->name, "progs/spike.mdl")))
|
||||
{
|
||||
if (qmb_initialized && r_part_trails.value)
|
||||
{
|
||||
R_RocketTrail (oldorg, ent->origin, NAIL_TRAIL);
|
||||
}
|
||||
}
|
||||
|
||||
if (ent->model->flags)
|
||||
{
|
||||
if (ent->model->flags & EF_GIB)
|
||||
|
|
|
@ -371,6 +371,7 @@ void Draw_TextureMode_f (void)
|
|||
Draw_Init
|
||||
===============
|
||||
*/
|
||||
extern bool new3ds_flag;
|
||||
void Draw_Init (void)
|
||||
{
|
||||
int start;
|
||||
|
|
|
@ -903,7 +903,7 @@ void Mod_LoadFaces (lump_t *l)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (strstr(fa->texinfo->texture->name,"light")) {
|
||||
if (strstr(out->texinfo->texture->name,"light")) {
|
||||
out->flags |= TEXFLAG_LIGHT;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -741,7 +741,6 @@ void R_DrawAliasModel (entity_t *e)
|
|||
float s, t, an;
|
||||
int anim;
|
||||
lerpdata_t lerpdata;
|
||||
qboolean force_fullbright = qfalse;
|
||||
|
||||
clmodel = currententity->model;
|
||||
|
||||
|
@ -752,44 +751,8 @@ void R_DrawAliasModel (entity_t *e)
|
|||
if (R_CullBox (mins, maxs))
|
||||
return;
|
||||
|
||||
// naievil -- fixme: need to translate
|
||||
/*
|
||||
if(ISADDITIVE(e))
|
||||
{
|
||||
float deg = e->renderamt;
|
||||
float alpha_val = deg;
|
||||
float alpha_val2 = 1 - deg;
|
||||
|
||||
if(deg <= 0.7)
|
||||
sceGuDepthMask(GU_TRUE);
|
||||
|
||||
sceGuEnable (GU_BLEND);
|
||||
sceGuBlendFunc(GU_ADD, GU_FIX, GU_FIX,
|
||||
GU_COLOR(alpha_val,alpha_val,alpha_val,alpha_val),
|
||||
GU_COLOR(alpha_val2,alpha_val2,alpha_val2,alpha_val2));
|
||||
}
|
||||
else if(ISGLOW(e))
|
||||
{
|
||||
sceGuDepthMask(GU_TRUE);
|
||||
sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0xFFFFFFFF);
|
||||
sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
|
||||
}
|
||||
else if (ISSOLID(e))
|
||||
{
|
||||
sceGuEnable(GU_ALPHA_TEST);
|
||||
float c = (e->renderamt) * 255.0f;
|
||||
sceGuAlphaFunc(GU_GREATER, 0x88, c);
|
||||
}
|
||||
*/
|
||||
|
||||
specChar = clmodel->name[strlen(clmodel->name) - 5];
|
||||
|
||||
if(specChar == '!' || currententity->effects & EF_FULLBRIGHT)
|
||||
{
|
||||
lightcolor[0] = lightcolor[1] = lightcolor[2] = 256;
|
||||
force_fullbright = qtrue;
|
||||
}
|
||||
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
|
||||
|
@ -878,9 +841,22 @@ void R_DrawAliasModel (entity_t *e)
|
|||
//Shpuld
|
||||
if(r_model_brightness.value)
|
||||
{
|
||||
lightcolor[0] += 48;
|
||||
lightcolor[1] += 48;
|
||||
lightcolor[2] += 48;
|
||||
lightcolor[0] += 60;
|
||||
lightcolor[1] += 60;
|
||||
lightcolor[2] += 60;
|
||||
}
|
||||
|
||||
if(specChar == '!' || (e->effects & EF_FULLBRIGHT))
|
||||
{
|
||||
lightcolor[0] = lightcolor[1] = lightcolor[2] = 256;
|
||||
}
|
||||
|
||||
add = 72.0f - (lightcolor[0] + lightcolor[1] + lightcolor[2]);
|
||||
if (add > 0.0f)
|
||||
{
|
||||
lightcolor[0] += add / 3.0f;
|
||||
lightcolor[1] += add / 3.0f;
|
||||
lightcolor[2] += add / 3.0f;
|
||||
}
|
||||
|
||||
glPushMatrix ();
|
||||
|
@ -944,10 +920,7 @@ void R_DrawAliasModel (entity_t *e)
|
|||
if (gl_smoothmodels.value)
|
||||
glShadeModel (GL_SMOOTH);
|
||||
|
||||
if (force_fullbright == qtrue)
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
else
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if (gl_affinemodels.value)
|
||||
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
|
||||
|
|
|
@ -170,7 +170,7 @@ void Sys_Error (char *error, ...)
|
|||
Host_Shutdown();
|
||||
|
||||
gfxExit();
|
||||
exit(1);
|
||||
Sys_Quit();
|
||||
}
|
||||
|
||||
void Sys_Printf (char *fmt, ...)
|
||||
|
|
Loading…
Reference in a new issue