mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 01:01:13 +00:00
[client] Move qw's loc code into client
This makes the location code available to nq (not used yet) but more importantly moves some definitely client-side code into the right place.
This commit is contained in:
parent
b8267f2edd
commit
abaccbec53
13 changed files with 51 additions and 41 deletions
|
@ -76,7 +76,10 @@ EXTRA_DIST += \
|
||||||
include/vregset.h \
|
include/vregset.h \
|
||||||
include/winquake.h \
|
include/winquake.h \
|
||||||
include/world.h \
|
include/world.h \
|
||||||
|
include/client/effects.h \
|
||||||
include/client/entities.h \
|
include/client/entities.h \
|
||||||
|
include/client/temp_entities.h \
|
||||||
|
include/client/locs.h \
|
||||||
include/qw/bothdefs.h \
|
include/qw/bothdefs.h \
|
||||||
include/qw/msg_backbuf.h \
|
include/qw/msg_backbuf.h \
|
||||||
include/qw/msg_ucmd.h \
|
include/qw/msg_ucmd.h \
|
||||||
|
|
|
@ -25,7 +25,6 @@ include_qf = \
|
||||||
include/QF/keys.h \
|
include/QF/keys.h \
|
||||||
include/QF/link.h \
|
include/QF/link.h \
|
||||||
include/QF/llist.h \
|
include/QF/llist.h \
|
||||||
include/QF/locs.h \
|
|
||||||
include/QF/mathlib.h \
|
include/QF/mathlib.h \
|
||||||
include/QF/mdfour.h \
|
include/QF/mdfour.h \
|
||||||
include/QF/mersenne.h \
|
include/QF/mersenne.h \
|
||||||
|
|
|
@ -46,5 +46,6 @@ int locs_nearest (const vec3_t loc) __attribute__((pure));
|
||||||
void locs_reset (void);
|
void locs_reset (void);
|
||||||
void locs_save (const char *filename, qboolean gz);
|
void locs_save (const char *filename, qboolean gz);
|
||||||
void map_to_loc (const char *mapname, char *filename);
|
void map_to_loc (const char *mapname, char *filename);
|
||||||
|
void locs_draw (vec3_t simorg);
|
||||||
|
|
||||||
#endif//__QF_locs_h
|
#endif//__QF_locs_h
|
|
@ -6,4 +6,5 @@ libs_client_libQFclient_la_SOURCES= \
|
||||||
libs/client/cl_effects.c \
|
libs/client/cl_effects.c \
|
||||||
libs/client/cl_entities.c \
|
libs/client/cl_entities.c \
|
||||||
libs/client/cl_temp_entities.c \
|
libs/client/cl_temp_entities.c \
|
||||||
|
libs/client/locs.c \
|
||||||
$e
|
$e
|
||||||
|
|
|
@ -41,15 +41,19 @@
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "QF/locs.h"
|
#include "QF/mathlib.h"
|
||||||
|
#include "QF/render.h"
|
||||||
#include "QF/qtypes.h"
|
#include "QF/qtypes.h"
|
||||||
#include "QF/quakefs.h"
|
#include "QF/quakefs.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
|
|
||||||
#include "compat.h"
|
#include "QF/plugin/vid_render.h" //FIXME
|
||||||
|
|
||||||
#include "qw/include/client.h"
|
#include "compat.h"
|
||||||
|
#include "d_iface.h" //FIXME part_tex_smoke and part_tex_dot
|
||||||
|
|
||||||
|
#include "client/locs.h"
|
||||||
|
|
||||||
#define LOCATION_BLOCK 128 // 128 locations per block.
|
#define LOCATION_BLOCK 128 // 128 locations per block.
|
||||||
|
|
||||||
|
@ -276,3 +280,37 @@ map_to_loc (const char *mapname, char *filename)
|
||||||
t1++;
|
t1++;
|
||||||
strcpy (t1, "loc");
|
strcpy (t1, "loc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
locs_draw (vec3_t simorg)
|
||||||
|
{
|
||||||
|
//FIXME custom ent rendering code would be nice
|
||||||
|
dlight_t *dl;
|
||||||
|
location_t *nearloc;
|
||||||
|
vec3_t trueloc;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
nearloc = locs_find (simorg);
|
||||||
|
if (nearloc) {
|
||||||
|
dl = r_funcs->R_AllocDlight (4096);
|
||||||
|
if (dl) {
|
||||||
|
VectorCopy (nearloc->loc, dl->origin);
|
||||||
|
dl->radius = 200;
|
||||||
|
dl->die = r_data->realtime + 0.1;
|
||||||
|
dl->color[0] = 0;
|
||||||
|
dl->color[1] = 1;
|
||||||
|
dl->color[2] = 0;
|
||||||
|
dl->color[3] = 0.7;
|
||||||
|
}
|
||||||
|
VectorCopy (nearloc->loc, trueloc);
|
||||||
|
r_funcs->particles->R_Particle_New (pt_smokecloud, part_tex_smoke,
|
||||||
|
trueloc, 2.0,
|
||||||
|
vec3_origin, r_data->realtime + 9.0, 254,
|
||||||
|
0.25 + qfrandom (0.125), 0.0);
|
||||||
|
for (i = 0; i < 15; i++)
|
||||||
|
r_funcs->particles->R_Particle_NewRandom (pt_fallfade,
|
||||||
|
part_tex_dot, trueloc, 12,
|
||||||
|
0.7, 96, r_data->realtime + 5.0,
|
||||||
|
104 + (rand () & 7), 1.0, 0.0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,7 +44,6 @@
|
||||||
|
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/entity.h"
|
#include "QF/entity.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
#include "QF/entity.h"
|
#include "QF/entity.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/entity.h"
|
#include "QF/entity.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/entity.h"
|
#include "QF/entity.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
|
|
|
@ -104,7 +104,7 @@ qw_source_libqw_client_a_SOURCES= \
|
||||||
qw/source/cl_entparse.c qw/source/cl_ents.c qw/source/cl_http.c qw/source/cl_input.c qw/source/cl_main.c qw/source/cl_ngraph.c \
|
qw/source/cl_entparse.c qw/source/cl_ents.c qw/source/cl_http.c qw/source/cl_input.c qw/source/cl_main.c qw/source/cl_ngraph.c \
|
||||||
qw/source/cl_parse.c qw/source/cl_pred.c qw/source/cl_rss.c qw/source/cl_screen.c qw/source/cl_skin.c qw/source/cl_slist.c \
|
qw/source/cl_parse.c qw/source/cl_pred.c qw/source/cl_rss.c qw/source/cl_screen.c qw/source/cl_skin.c qw/source/cl_slist.c \
|
||||||
qw/source/cl_view.c \
|
qw/source/cl_view.c \
|
||||||
qw/source/locs.c qw/source/sbar.c qw/source/teamplay.c
|
qw/source/sbar.c qw/source/teamplay.c
|
||||||
|
|
||||||
# Software-rendering clients
|
# Software-rendering clients
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/msg.h"
|
#include "QF/msg.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/skin.h"
|
#include "QF/skin.h"
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/entity.h"
|
#include "QF/entity.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/msg.h"
|
#include "QF/msg.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/skin.h"
|
#include "QF/skin.h"
|
||||||
|
@ -48,6 +47,7 @@
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
|
|
||||||
#include "client/effects.h"
|
#include "client/effects.h"
|
||||||
|
#include "client/locs.h"
|
||||||
#include "client/temp_entities.h"
|
#include "client/temp_entities.h"
|
||||||
|
|
||||||
#include "qw/bothdefs.h"
|
#include "qw/bothdefs.h"
|
||||||
|
@ -490,35 +490,7 @@ CL_EmitEntities (void)
|
||||||
CL_LinkPacketEntities ();
|
CL_LinkPacketEntities ();
|
||||||
CL_UpdateTEnts (cl.time, &tentCtx);
|
CL_UpdateTEnts (cl.time, &tentCtx);
|
||||||
if (cl_draw_locs->int_val) {
|
if (cl_draw_locs->int_val) {
|
||||||
//FIXME custom ent rendering code would be nice
|
locs_draw (cl.simorg);
|
||||||
dlight_t *dl;
|
|
||||||
location_t *nearloc;
|
|
||||||
vec3_t trueloc;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
nearloc = locs_find (cl.simorg);
|
|
||||||
if (nearloc) {
|
|
||||||
dl = r_funcs->R_AllocDlight (4096);
|
|
||||||
if (dl) {
|
|
||||||
VectorCopy (nearloc->loc, dl->origin);
|
|
||||||
dl->radius = 200;
|
|
||||||
dl->die = r_data->realtime + 0.1;
|
|
||||||
dl->color[0] = 0;
|
|
||||||
dl->color[1] = 1;
|
|
||||||
dl->color[2] = 0;
|
|
||||||
dl->color[3] = 0.7;
|
|
||||||
}
|
|
||||||
VectorCopy (nearloc->loc, trueloc);
|
|
||||||
r_funcs->particles->R_Particle_New (pt_smokecloud, part_tex_smoke,
|
|
||||||
trueloc, 2.0,
|
|
||||||
vec3_origin, r_data->realtime + 9.0, 254,
|
|
||||||
0.25 + qfrandom (0.125), 0.0);
|
|
||||||
for (i = 0; i < 15; i++)
|
|
||||||
r_funcs->particles->R_Particle_NewRandom (pt_fallfade,
|
|
||||||
part_tex_dot, trueloc, 12,
|
|
||||||
0.7, 96, r_data->realtime + 5.0,
|
|
||||||
104 + (rand () & 7), 1.0, 0.0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/gib.h"
|
#include "QF/gib.h"
|
||||||
#include "QF/locs.h"
|
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/skin.h"
|
#include "QF/skin.h"
|
||||||
|
@ -52,6 +51,8 @@
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
|
#include "client/locs.h"
|
||||||
|
|
||||||
#include "qw/bothdefs.h"
|
#include "qw/bothdefs.h"
|
||||||
#include "qw/include/cl_input.h"
|
#include "qw/include/cl_input.h"
|
||||||
#include "qw/include/client.h"
|
#include "qw/include/client.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue