viewable nearest loc support (sw and gl)

(r_drawentities 0 to turn on)

(from WildCode)
This commit is contained in:
Bill Currie 2001-01-06 07:32:53 +00:00
parent fc005fc215
commit a71f589c77
2 changed files with 65 additions and 3 deletions

View file

@ -45,7 +45,9 @@
#include "cl_main.h"
#include "commdef.h"
#include "console.h"
#include "locs.h"
#include "glquake.h"
#include "mathlib.h"
#include "qargs.h"
#include "r_dynamic.h"
#include "skin.h"
@ -889,6 +891,33 @@ R_DrawAliasModel (entity_t *e)
//==================================================================================
/*
=============
R_ShowNearestLoc
=============
*/
static void
R_ShowNearestLoc (void)
{
location_t *nearloc;
vec3_t trueloc;
dlight_t *dl;
if (r_drawentities->int_val)
return;
nearloc = locs_find (cl.simorg);
if (nearloc) {
dl = CL_AllocDlight (4096);
VectorCopy (nearloc->loc, dl->origin);
dl->radius = 200;
dl->die = cl.time + 0.1;
dl->color[1]=1;
VectorCopy(nearloc->loc,trueloc);
R_RunSpikeEffect(trueloc,7);
}
}
/*
=============
R_DrawEntitiesOnList
@ -899,8 +928,10 @@ R_DrawEntitiesOnList (void)
{
int i;
if (!r_drawentities->int_val)
if (!r_drawentities->int_val) {
R_ShowNearestLoc();
return;
}
// LordHavoc: split into 3 loops to simplify state changes
for (i = 0; i < cl_numvisedicts; i++) {

View file

@ -43,6 +43,9 @@
#include "cl_main.h"
#include "console.h"
#include "cmd.h"
#include "locs.h"
#include "mathlib.h"
#include "r_dynamic.h"
#include "r_local.h"
#include "screen.h"
#include "sound.h"
@ -578,7 +581,33 @@ R_MarkLeaves (void)
}
}
/*
=============
R_ShowNearestLoc
=============
*/
static void
R_ShowNearestLoc (void)
{
location_t *nearloc;
vec3_t trueloc;
dlight_t *dl;
if (r_drawentities->int_val)
return;
nearloc = locs_find (cl.simorg);
if (nearloc) {
dl = CL_AllocDlight (4096);
VectorCopy (nearloc->loc, dl->origin);
dl->radius = 200;
dl->die = cl.time + 0.1;
dl->color[1]=1;
VectorCopy(nearloc->loc,trueloc);
R_RunParticleEffect(trueloc,252,10);
}
}
/*
=============
R_DrawEntitiesOnList
@ -596,8 +625,10 @@ R_DrawEntitiesOnList (void)
vec3_t dist;
float add;
if (!r_drawentities->int_val)
if (!r_drawentities->int_val) {
R_ShowNearestLoc();
return;
}
for (i = 0; i < cl_numvisedicts; i++) {
currententity = cl_visedicts[i];