cvar_t cl_noplayershadow = {CVAR_SAVE, "cl_noplayershadow", "0"};
+cvar_t cl_prydoncursor = {0, "cl_prydoncursor", "0"};
+
mempool_t *cl_refdef_mempool;
mempool_t *cl_entities_mempool;
Con_DPrintf("CL_Disconnect\n");
// stop sounds (especially looping!)
- S_StopAllSounds (true);
+ S_StopAllSounds ();
// clear contents blends
cl.cshifts[0].percent = 0;
return;
// clear menu's connect error message
- m_return_reason[0] = 0;
+ M_Update_Return_Reason("");
cls.demonum = -1;
// stop demo loop in case this fails
cls.connect_trying = true;
cls.connect_remainingtries = 3;
cls.connect_nextsendtime = 0;
+ M_Update_Return_Reason("Trying to connect...");
if (sv.active)
{
NetConn_ClientFrame();
else
{
Con_Print("Unable to find a suitable network socket to connect to server.\n");
- strcpy(m_return_reason, "No network");
+ M_Update_Return_Reason("No network");
}
}
ent->render.colormap = -1; // no special coloring
ent->render.scale = 1;
ent->render.alpha = 1;
+ VectorSet(ent->render.colormod, 1, 1, 1);
return ent;
}
}
}
-void CL_AllocDlight(entity_render_t *ent, matrix4x4_t *matrix, float radius, float red, float green, float blue, float decay, float lifetime, int cubemapnum, int style, int shadowenable, vec_t corona)
+void CL_AllocDlight(entity_render_t *ent, matrix4x4_t *matrix, float radius, float red, float green, float blue, float decay, float lifetime, int cubemapnum, int style, int shadowenable, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags)
{
int i;
dlight_t *dl;
dl->style = style;
dl->shadow = shadowenable;
dl->corona = corona;
+ dl->flags = flags;
+ dl->coronasizescale = coronasizescale;
+ dl->ambientscale = ambientscale;
+ dl->diffusescale = diffusescale;
+ dl->specularscale = specularscale;
}
void CL_DecayLights(void)
else
e->render.colormap = -1; // no special coloring
e->render.skinnum = e->state_current.skin;
+ VectorScale(e->state_current.colormod, (1.0f / 32.0f), e->render.colormod);
if (e->render.flags & RENDER_VIEWMODEL)
{
if (!r_drawviewmodel.integer || chase_active.integer || envmap)
// transfer certain model flags to effects
if (e->render.model->flags2 & EF_FULLBRIGHT)
e->render.effects |= EF_FULLBRIGHT;
+ if (cl_prydoncursor.integer && (e->render.effects & EF_SELECTABLE) && cl.cmd.cursor_entitynumber == e - cl_entities)
+ VectorScale(e->render.colormod, 2, e->render.colormod);
}
// animation lerp
e->render.framelerp = 1;
if (e->render.frame2time > e->render.frame1time)
{
- e->render.framelerp = (cl.time - e->render.frame2time) / (e->render.frame2time - e->render.frame1time);
+ // make sure frame lerp won't last longer than 100ms
+ // (this mainly helps with models that use framegroups and
+ // switch between them infrequently)
+ e->render.framelerp = (cl.time - e->render.frame2time) / min(e->render.frame2time - e->render.frame1time, 0.1);
e->render.framelerp = bound(0, e->render.framelerp, 1);
}
}
e->render.frame = e->render.frame2 = e->state_current.frame;
e->render.frame2time = cl.time;
e->render.framelerp = 0;
- // make sure frame lerp won't last longer than 100ms
- // (this mainly helps with models that use framegroups and
- // switch between them infrequently)
- e->render.frame1time = max(e->render.frame1time, e->render.frame2time - 0.1f);
}
R_LerpAnimation(&e->render);
tempmatrix.m[0][3] = v[0];
tempmatrix.m[1][3] = v[1];
tempmatrix.m[2][3] = v[2];
- CL_AllocDlight(NULL, &tempmatrix, 100, e->persistent.muzzleflash, e->persistent.muzzleflash, e->persistent.muzzleflash, 0, 0, 0, 0, true, 0);
+ CL_AllocDlight(NULL, &tempmatrix, 100, e->persistent.muzzleflash, e->persistent.muzzleflash, e->persistent.muzzleflash, 0, 0, 0, -1, true, 0, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
e->persistent.muzzleflash -= cl.frametime * 10;
}
// LordHavoc: if the model has no flags, don't check each
// hack to make glowing player light shine on their gun
//if ((e - cl_entities) == cl.viewentity/* && !chase_active.integer*/)
// dlightmatrix.m[2][3] += 30;
- CL_AllocDlight(&e->render, &e->render.matrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, 0, 0, true, 1);
+ CL_AllocDlight(&e->render, &e->render.matrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
}
// custom rtlight
if (e->state_current.lightpflags & PFLAGS_FULLDYNAMIC)
VectorSet(light, 1, 1, 1);
if (light[3] == 0)
light[3] = 350;
- CL_AllocDlight(&e->render, &e->render.matrix, light[3], light[0], light[1], light[2], 0, 0, e->state_current.skin, e->state_current.lightstyle, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_CORONA) != 0);
+ // FIXME: add ambient/diffuse/specular scales as an extension ontop of TENEBRAE_GFX_DLIGHTS?
+ CL_AllocDlight(&e->render, &e->render.matrix, light[3], light[0], light[1], light[2], 0, 0, e->state_current.skin, e->state_current.lightstyle, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_CORONA) != 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
}
// do trails
if (e->render.flags & RENDER_GLOWTRAIL)
ent->render.flags = RENDER_SHADOW;
if (!r_fullbright.integer)
ent->render.flags |= RENDER_LIGHT;
+ VectorSet(ent->render.colormod, 1, 1, 1);
}
static void CL_RelinkStaticEntities(void)
// hide player shadow during intermission or nehahra movie
if (!(e->render.effects & EF_NOSHADOW) && !(e->render.flags & RENDER_TRANSPARENT))
e->render.flags |= RENDER_SHADOW;
+ VectorSet(e->render.colormod, 1, 1, 1);
R_LerpAnimation(&e->render);
r_refdef.entities[r_refdef.numentities++] = &e->render;
}
ent->state_current.flags = RENDER_VIEWMODEL;
if (cl.stats[STAT_HEALTH] <= 0 || cl.intermission)
ent->state_current.modelindex = 0;
- else if (cl.items & IT_INVISIBILITY)
+ else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
{
if (gamemode == GAME_TRANSFUSION)
ent->state_current.alpha = 128;
ent->render.frame = ent->render.frame2;
ent->render.colormap = -1; // no special coloring
ent->render.alpha = 1;
+ VectorSet(ent->render.colormod, 1, 1, 1);
Matrix4x4_CreateFromQuakeEntity(&ent->render.matrix, e->origin[0], e->origin[1], e->origin[2], 0, 0, 0, 1);
Matrix4x4_Invert_Simple(&ent->render.inversematrix, &ent->render.matrix);
{
// FIXME: create a matrix from the beam start/end orientation
Matrix4x4_CreateTranslate(&tempmatrix, b->end[0], b->end[1], b->end[2]);
- CL_AllocDlight (NULL, &tempmatrix, 200, 0.3, 0.7, 1, 0, 0, 0, 0, true, 1);
+ CL_AllocDlight (NULL, &tempmatrix, 200, 0.3, 0.7, 1, 0, 0, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
}
if (cl_beams_polygons.integer)
continue;
CL_SendCmd
=================
*/
-void CL_SendCmd(usercmd_t *cmd)
+void CL_SendCmd(void)
{
if (cls.signon == SIGNONS)
- CL_SendMove(cmd);
+ CL_SendMove();
if (cls.demoplayback)
{
SZ_Alloc (&cls.message, 1024, "cls.message");
CL_InitInput ();
- CL_InitTEnts ();
//
// register our commands
Cvar_RegisterVariable(&cl_beams_lightatend);
Cvar_RegisterVariable(&cl_noplayershadow);
+ Cvar_RegisterVariable(&cl_prydoncursor);
+
if (gamemode == GAME_NETHERWORLD)
{
Cvar_RegisterVariable (&cl_playermodel);