mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-03-13 11:43:29 +00:00
viewable nearest loc support (sw and gl)
(r_drawentities 0 to turn on) (from WildCode)
This commit is contained in:
parent
fc005fc215
commit
a71f589c77
2 changed files with 65 additions and 3 deletions
|
@ -45,7 +45,9 @@
|
||||||
#include "cl_main.h"
|
#include "cl_main.h"
|
||||||
#include "commdef.h"
|
#include "commdef.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "locs.h"
|
||||||
#include "glquake.h"
|
#include "glquake.h"
|
||||||
|
#include "mathlib.h"
|
||||||
#include "qargs.h"
|
#include "qargs.h"
|
||||||
#include "r_dynamic.h"
|
#include "r_dynamic.h"
|
||||||
#include "skin.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
|
R_DrawEntitiesOnList
|
||||||
|
@ -899,8 +928,10 @@ R_DrawEntitiesOnList (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!r_drawentities->int_val)
|
if (!r_drawentities->int_val) {
|
||||||
|
R_ShowNearestLoc();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// LordHavoc: split into 3 loops to simplify state changes
|
// LordHavoc: split into 3 loops to simplify state changes
|
||||||
for (i = 0; i < cl_numvisedicts; i++) {
|
for (i = 0; i < cl_numvisedicts; i++) {
|
||||||
|
|
|
@ -43,6 +43,9 @@
|
||||||
#include "cl_main.h"
|
#include "cl_main.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
#include "locs.h"
|
||||||
|
#include "mathlib.h"
|
||||||
|
#include "r_dynamic.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
@ -578,6 +581,32 @@ 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
|
@ -596,8 +625,10 @@ R_DrawEntitiesOnList (void)
|
||||||
vec3_t dist;
|
vec3_t dist;
|
||||||
float add;
|
float add;
|
||||||
|
|
||||||
if (!r_drawentities->int_val)
|
if (!r_drawentities->int_val) {
|
||||||
|
R_ShowNearestLoc();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < cl_numvisedicts; i++) {
|
for (i = 0; i < cl_numvisedicts; i++) {
|
||||||
currententity = cl_visedicts[i];
|
currententity = cl_visedicts[i];
|
||||||
|
|
Loading…
Reference in a new issue