X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=view.c;h=5b37040fa4e658741e37c83bb2f48b15e523c665;hp=7d907cd20c732d66d059634c5d13e7a3a46d7c8e;hb=069960ea1e54b56f7dbd65f09ec3fb37a761f0d5;hpb=468db062ea41a78210871ea5b2d53c01f9cab190 diff --git a/view.c b/view.c index 7d907cd2..5b37040f 100644 --- a/view.c +++ b/view.c @@ -54,7 +54,8 @@ cvar_t crosshair = {"crosshair", "0", true}; cvar_t cl_crossx = {"cl_crossx", "0", false}; cvar_t cl_crossy = {"cl_crossy", "0", false}; -cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false}; +//cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false}; +cvar_t gl_polyblend = {"gl_polyblend", "1", true}; float v_dmg_time, v_dmg_roll, v_dmg_pitch; @@ -277,29 +278,32 @@ void V_ParseDamage (void) cl.faceanimtime = cl.time + 0.2; // but sbar face into pain frame - cl.cshifts[CSHIFT_DAMAGE].percent += 3*count; - if (cl.cshifts[CSHIFT_DAMAGE].percent < 0) - cl.cshifts[CSHIFT_DAMAGE].percent = 0; - if (cl.cshifts[CSHIFT_DAMAGE].percent > 150) - cl.cshifts[CSHIFT_DAMAGE].percent = 150; - - if (armor > blood) - { - cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 200; - cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 100; - cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 100; - } - else if (armor) - { - cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 220; - cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 50; - cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 50; - } - else + if (gl_polyblend.value) { - cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 255; - cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 0; - cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 0; + cl.cshifts[CSHIFT_DAMAGE].percent += 3*count; + if (cl.cshifts[CSHIFT_DAMAGE].percent < 0) + cl.cshifts[CSHIFT_DAMAGE].percent = 0; + if (cl.cshifts[CSHIFT_DAMAGE].percent > 150) + cl.cshifts[CSHIFT_DAMAGE].percent = 150; + + if (armor > blood) + { + cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 200; + cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 100; + cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 100; + } + else if (armor) + { + cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 220; + cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 50; + cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 50; + } + else + { + cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 255; + cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 0; + cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 0; + } } // @@ -345,10 +349,13 @@ When you run over an item, the server sends this command */ void V_BonusFlash_f (void) { - cl.cshifts[CSHIFT_BONUS].destcolor[0] = 215; - cl.cshifts[CSHIFT_BONUS].destcolor[1] = 186; - cl.cshifts[CSHIFT_BONUS].destcolor[2] = 69; - cl.cshifts[CSHIFT_BONUS].percent = 50; + if (gl_polyblend.value) + { + cl.cshifts[CSHIFT_BONUS].destcolor[0] = 215; + cl.cshifts[CSHIFT_BONUS].destcolor[1] = 186; + cl.cshifts[CSHIFT_BONUS].destcolor[2] = 69; + cl.cshifts[CSHIFT_BONUS].percent = 50; + } } /* @@ -362,6 +369,11 @@ void V_SetContentsColor (int contents) { cshift_t* c; c = &cl.cshifts[CSHIFT_CONTENTS]; // just to shorten the code below + if (!gl_polyblend.value) + { + c->percent = 0; + return; + } switch (contents) { case CONTENTS_EMPTY: @@ -402,6 +414,11 @@ V_CalcPowerupCshift */ void V_CalcPowerupCshift (void) { + if (!gl_polyblend.value) + { + cl.cshifts[CSHIFT_POWERUP].percent = 0; + return; + } if (cl.items & IT_QUAD) { cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; @@ -450,11 +467,12 @@ void V_CalcBlend (void) b = 0; a = 0; - if (gl_cshiftpercent.value) - { +// if (gl_cshiftpercent.value) +// { for (j=0 ; jangles[YAW] = cl.viewangles[YAW]; // the model should face the view dir - ent->angles[PITCH] = -cl.viewangles[PITCH]; // the model should face the view dir + if (!chase_active.value) // LordHavoc: get rid of angle problems in chase_active mode + { + ent->angles[YAW] = cl.viewangles[YAW]; // the model should face the view dir + ent->angles[PITCH] = -cl.viewangles[PITCH]; // the model should face the view dir + } bob = V_CalcBob (); @@ -742,7 +764,10 @@ void V_CalcRefdef (void) r_refdef.vieworg[1] += 1.0/32; r_refdef.vieworg[2] += 1.0/32; - VectorCopy (cl.viewangles, r_refdef.viewangles); + if (!intimerefresh) + { + VectorCopy (cl.viewangles, r_refdef.viewangles); + } V_CalcViewRoll (); V_AddIdle (); @@ -775,27 +800,15 @@ void V_CalcRefdef (void) // fudge position around to keep amount of weapon visible // roughly equal with different FOV -#if 0 - if (cl.model_precache[cl.stats[STAT_WEAPON]] && strcmp (cl.model_precache[cl.stats[STAT_WEAPON]]->name, "progs/v_shot2.mdl")) -#endif -// LordHavoc: everyone hates the gun moving around -/* - if (scr_viewsize.value == 110) - view->origin[2] += 1; - else if (scr_viewsize.value == 100) - view->origin[2] += 2; - else if (scr_viewsize.value == 90) - view->origin[2] += 1; - else if (scr_viewsize.value == 80) - view->origin[2] += 0.5; -*/ - view->model = cl.model_precache[cl.stats[STAT_WEAPON]]; view->frame = cl.stats[STAT_WEAPONFRAME]; - view->colormap = 0; //vid.colormap; + view->colormap = -1; // no special coloring // set up the refresh position - VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles); + if (!intimerefresh) + { + VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles); + } // smooth out stair step ups if (cl.onground && ent->origin[2] - oldz > 0) @@ -845,8 +858,6 @@ void V_RenderView (void) V_CalcRefdef (); } - R_PushDlights (); - R_RenderView (); } @@ -877,7 +888,8 @@ void V_Init (void) Cvar_RegisterVariable (&crosshair); Cvar_RegisterVariable (&cl_crossx); Cvar_RegisterVariable (&cl_crossy); - Cvar_RegisterVariable (&gl_cshiftpercent); +// Cvar_RegisterVariable (&gl_cshiftpercent); + Cvar_RegisterVariable (&gl_polyblend); Cvar_RegisterVariable (&cl_rollspeed); Cvar_RegisterVariable (&cl_rollangle);