diff --git a/include/QF/plugin/vid_render.h b/include/QF/plugin/vid_render.h index e7027d07d..60fda8e3b 100644 --- a/include/QF/plugin/vid_render.h +++ b/include/QF/plugin/vid_render.h @@ -142,7 +142,6 @@ typedef struct vid_render_data_s { qboolean paused; int lineadj; struct entity_s *view_model; - float gravity; double frametime; double realtime; lightstyle_t *lightstyle; diff --git a/include/QF/render.h b/include/QF/render.h index 18c760f7f..b4f6c32d6 100644 --- a/include/QF/render.h +++ b/include/QF/render.h @@ -35,25 +35,6 @@ #include "QF/simd/types.h" #include "QF/ui/vrect.h" -typedef enum { - pt_static, - pt_grav, - pt_slowgrav, - pt_fire, - pt_explode, - pt_explode2, - pt_blob, - pt_blob2, - pt_smoke, - pt_smokecloud, - pt_bloodcloud, - pt_fadespark, - pt_fadespark2, - pt_fallfade, - pt_fallfadespark, - pt_flame -} ptype_t; - typedef enum { part_tex_dot, part_tex_spark, @@ -91,6 +72,7 @@ typedef struct partparm_s { } partparm_t; typedef struct psystem_s { + vec4f_t gravity; uint32_t maxparticles; uint32_t numparticles; particle_t *particles; diff --git a/include/client/particles.h b/include/client/particles.h index a56762bd8..0b91f9daf 100644 --- a/include/client/particles.h +++ b/include/client/particles.h @@ -29,6 +29,25 @@ #include "QF/render.h" +typedef enum { + pt_static, + pt_grav, + pt_slowgrav, + pt_fire, + pt_explode, + pt_explode2, + pt_blob, + pt_blob2, + pt_smoke, + pt_smokecloud, + pt_bloodcloud, + pt_fadespark, + pt_fadespark2, + pt_fallfade, + pt_fallfadespark, + pt_flame +} ptype_t; + typedef struct cl_particle_funcs_s { void (*RocketTrail) (vec4f_t start, vec4f_t end); void (*GrenadeTrail) (vec4f_t start, vec4f_t end); @@ -70,6 +89,7 @@ extern float cl_frametime; extern float cl_realtime; void CL_Particles_Init (void); +void CL_ParticlesGravity (float gravity); struct model_s; void CL_LoadPointFile (const struct model_s *model); diff --git a/libs/client/cl_particles.c b/libs/client/cl_particles.c index e43a028c2..7ff731315 100644 --- a/libs/client/cl_particles.c +++ b/libs/client/cl_particles.c @@ -1279,3 +1279,9 @@ CL_Particles_Init (void) "Sets particle style. 0 for Id, 1 for QF."); CL_ParticleFunctionInit (); } + +void +CL_ParticlesGravity (float gravity) +{ + cl_psystem->gravity = (vec4f_t) { 0, 0, -gravity, 0 }; +} diff --git a/libs/video/renderer/r_part.c b/libs/video/renderer/r_part.c index fd12cc206..e0b6c56be 100644 --- a/libs/video/renderer/r_part.c +++ b/libs/video/renderer/r_part.c @@ -88,7 +88,7 @@ void R_RunParticles (float dT) { psystem_t *ps = &r_psystem;//FIXME - vec4f_t gravity = {0, 0, -r_data->gravity, 0}; + vec4f_t gravity = ps->gravity; unsigned j = 0; for (unsigned i = 0; i < ps->numparticles; i++) { diff --git a/libs/video/renderer/vid_common.c b/libs/video/renderer/vid_common.c index 2a5285859..c8edf8067 100644 --- a/libs/video/renderer/vid_common.c +++ b/libs/video/renderer/vid_common.c @@ -55,7 +55,6 @@ vid_render_data_t vid_render_data = { .paused = false, .lineadj = 0, .view_model = 0, - .gravity = 0, .frametime = 0.0, .realtime = 0.0, .lightstyle = 0, diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index f186b31c8..de98ec63d 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -56,6 +56,7 @@ #include "QF/plugin/vid_render.h" #include "QF/scene/entity.h" +#include "client/particles.h" #include "client/temp_entities.h" #include "client/world.h" @@ -378,7 +379,7 @@ CL_ParseServerInfo (void) Hunk_Check (0); // make sure nothing is hurt noclip_anglehack = false; // noclip is turned off at start - r_data->gravity = 800.0; // Set up gravity for renderer effects + CL_ParticlesGravity (800); // Set up gravity for renderer effects done: S_UnblockSound (); } diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index b27dff394..2dfe6e25b 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -67,6 +67,7 @@ #include "sbar.h" #include "client/effects.h" +#include "client/particles.h" #include "client/temp_entities.h" #include "client/view.h" #include "client/world.h" @@ -782,7 +783,7 @@ CL_ParseServerData (void) // get the movevars movevars.gravity = MSG_ReadFloat (net_message); - r_data->gravity = movevars.gravity; // Gravity for renderer effects + CL_ParticlesGravity (movevars.gravity);// Gravity for renderer effects movevars.stopspeed = MSG_ReadFloat (net_message); movevars.maxspeed = MSG_ReadFloat (net_message); movevars.spectatormaxspeed = MSG_ReadFloat (net_message);