From ef0e99b3126128183afb9d99a591ad86c7763cb3 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Fri, 19 May 2006 21:00:55 +0000 Subject: [PATCH] allow viewmodel to be seen with SW again (cl_gunx, etc do not work properly with software) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2292 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_ents.c | 4 ++ engine/client/cl_screen.c | 2 +- engine/client/clq2_ents.c | 4 ++ engine/sw/r_main.c | 122 -------------------------------------- 4 files changed, 9 insertions(+), 123 deletions(-) diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index 60ea8a4ba..e77abf778 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -2974,6 +2974,10 @@ void CL_LinkViewModel(void) && r_drawviewmodelinvis.value < 1) alpha *= r_drawviewmodelinvis.value; +#ifdef PEXT_SCALE + ent.scale = 1; +#endif + ent.origin[0] = cl_gunz.value; ent.origin[1] = -cl_gunx.value; ent.origin[2] = -cl_guny.value; diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index b65acfa63..e7c495da5 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -1232,7 +1232,7 @@ void SCR_DrawFPS (void) lastframetime = t; } break; - case 4: + case 4: // immediate FPS/MS lastfps = 1/host_frametime; lastframetime = t; break; diff --git a/engine/client/clq2_ents.c b/engine/client/clq2_ents.c index e839c4d7f..b57b85fb9 100644 --- a/engine/client/clq2_ents.c +++ b/engine/client/clq2_ents.c @@ -1914,6 +1914,10 @@ void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops) gun.shaderRGBAf[3] = 1; // set up gun position +#ifdef PEXT_SCALE + gun.scale = 1; +#endif + gun.origin[0] = cl_gunz.value; gun.origin[1] = -cl_gunx.value; gun.origin[2] = -cl_guny.value; diff --git a/engine/sw/r_main.c b/engine/sw/r_main.c index c962bed45..9765df4d5 100644 --- a/engine/sw/r_main.c +++ b/engine/sw/r_main.c @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2; -extern cvar_t r_drawviewmodel; extern cvar_t r_netgraph; extern cvar_t r_sirds; @@ -821,124 +820,6 @@ void SWR_DrawEntitiesOnList (void) } } -/* -============= -R_DrawViewModel -============= -*/ -void SWR_DrawViewModel (void) -{ - /* -// FIXME: remove and do real lighting - float lightvec[3] = {-1, 0, 0}; - int j; - int lnum; - vec3_t dist; - float add; - dlight_t *dl; - - int pnum = r_refdef.currentplayernum; - static struct model_s *oldmodel[MAX_SPLITS]; - static float lerptime[MAX_SPLITS]; - static int prevframe[MAX_SPLITS]; - -#ifdef SIDEVIEWS - if (r_secondaryview==1) - return; -#endif - -#ifdef Q2CLIENT - if (cls.q2server) - return; -#endif - - if (!r_drawviewmodel.value || r_fov_greater_than_90 || !Cam_DrawViewModel(pnum)) - return; - - if (cl.stats[pnum][STAT_ITEMS] & IT_INVISIBILITY) - return; - - if (cl.stats[pnum][STAT_HEALTH] <= 0) - return; - - - currententity = &cl.viewent[pnum]; - if (!currententity->model) - return; - - VectorCopy (currententity->origin, r_entorigin); - VectorSubtract (r_origin, r_entorigin, modelorg); - - VectorCopy (vup, viewlightvec); - VectorInverse (viewlightvec); - - j = SWR_LightPoint (currententity->origin); - - if (j < 24) - j = 24; // always give some light on gun - r_viewlighting.ambientlight = j; - r_viewlighting.shadelight = j; - -// add dynamic lights - for (lnum=0 ; lnumradius) - continue; - if (dl->die < cl.time) - continue; - - VectorSubtract (currententity->origin, dl->origin, dist); - add = dl->radius - Length(dist); - if (add > 0) - r_viewlighting.ambientlight += add; - } - -// clamp lighting so it doesn't overbright as much - if (r_viewlighting.ambientlight > 128) - r_viewlighting.ambientlight = 128; - if (r_viewlighting.ambientlight + r_viewlighting.shadelight > 192) - r_viewlighting.shadelight = 192 - r_viewlighting.ambientlight; - - r_viewlighting.plightvec = lightvec; - - currententity->scale = 1; - if (r_drawviewmodel.value > 0 && r_drawviewmodel.value < 1) - currententity->alpha = r_drawviewmodel.value; - else - currententity->alpha = 1; - - if (currententity->frame != prevframe[pnum]) - { - currententity->oldframe = prevframe[pnum]; - lerptime[pnum] = realtime; - } - prevframe[pnum] = currententity->frame; - - if (currententity->model != oldmodel[pnum]) - { - oldmodel[pnum] = currententity->model; - currententity->oldframe = currententity->frame; - lerptime[pnum] = realtime; - } - currententity->lerptime = 1-(realtime-lerptime[pnum])*10; - if (currententity->lerptime<0)currententity->lerptime=0; - - switch(currententity->model->type) - { - default: - Sys_Error("Invalid model type in R_DrawViewModel"); - break; - case mod_alias: - R_AliasDrawModel (&r_viewlighting); - break; - case mod_dummy: - break; - } - */ -} - - /* ============= R_BmodelCheckBBox @@ -1425,7 +1306,6 @@ void SWR_RenderView_ (void) { D_ClearDepth(); SWR_DrawEntitiesOnList (); - SWR_DrawViewModel (); return; } @@ -1473,8 +1353,6 @@ SetVisibilityByPassages (); dv_time1 = de_time2; } - SWR_DrawViewModel (); - if (r_dspeeds.value) { dv_time2 = Sys_DoubleTime ();