diff --git a/include/r_local.h b/include/r_local.h index 48f5a9698..4f79c9a47 100644 --- a/include/r_local.h +++ b/include/r_local.h @@ -260,6 +260,10 @@ void R_ReadPointFile_f (void); void R_InitSprites (void); void R_SurfacePatch (void); +extern float r_gravity; + +// renderer stuff again =================================== + extern int r_amodels_drawn; extern edge_t *auxedges; extern int r_numallocatededges; diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index ff75d75eb..b4eba3e49 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -1363,7 +1363,7 @@ R_DrawParticles (void) qfglDepthMask (GL_FALSE); qfglInterleavedArrays (GL_T2F_C4UB_V3F, 0, particleVertexArray); - grav = (fast_grav = r_frametime * 800.0) * 0.05; + grav = (fast_grav = r_frametime * r_gravity) * 0.05; time_125 = r_frametime * 0.125; time_25= r_frametime * 0.25; time_40 = r_frametime * 0.40; diff --git a/libs/video/renderer/sw/sw_rpart.c b/libs/video/renderer/sw/sw_rpart.c index ce0c0614b..d28b82f50 100644 --- a/libs/video/renderer/sw/sw_rpart.c +++ b/libs/video/renderer/sw/sw_rpart.c @@ -73,8 +73,7 @@ R_ReadPointFile_f (void) { QFile *f; vec3_t org; - int r; - int c; + int c, r; particle_t *p; char name[MAX_OSPATH]; @@ -137,18 +136,13 @@ R_ParticleExplosion_QF (const vec3_t org) p->die = r_realtime + 5; p->color = ramp1[0]; p->ramp = rand () & 3; - if (i & 1) { + if (i & 1) p->type = pt_explode; - for (j = 0; j < 3; j++) { - p->org[j] = org[j] + ((rand () % 32) - 16); - p->vel[j] = (rand () % 512) - 256; - } - } else { + else p->type = pt_explode2; - for (j = 0; j < 3; j++) { - p->org[j] = org[j] + ((rand () % 32) - 16); - p->vel[j] = (rand () % 512) - 256; - } + for (j = 0; j < 3; j++) { + p->org[j] = org[j] + ((rand () % 32) - 16); + p->vel[j] = (rand () % 512) - 256; } } } @@ -157,11 +151,10 @@ static void R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength) { int i, j; - particle_t *p; int colorMod = 0; + particle_t *p; - for (i=0; i<512; i++) - { + for (i=0; i<512; i++) { if (!free_particles) return; p = free_particles; @@ -174,8 +167,7 @@ R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength) colorMod++; p->type = pt_blob; - for (j=0 ; j<3 ; j++) - { + for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + ((rand()%32)-16); p->vel[j] = (rand()%512)-256; } @@ -204,17 +196,13 @@ R_BlobExplosion_QF (const vec3_t org) if (i & 1) { p->type = pt_blob; p->color = 66 + rand () % 6; - for (j = 0; j < 3; j++) { - p->org[j] = org[j] + ((rand () % 32) - 16); - p->vel[j] = (rand () % 512) - 256; - } } else { p->type = pt_blob2; p->color = 150 + rand () % 6; - for (j = 0; j < 3; j++) { - p->org[j] = org[j] + ((rand () % 32) - 16); - p->vel[j] = (rand () % 512) - 256; - } + } + for (j = 0; j < 3; j++) { + p->org[j] = org[j] + ((rand () % 32) - 16); + p->vel[j] = (rand () % 512) - 256; } } } @@ -643,13 +631,9 @@ R_VoorTrail_QF (entity_t *ent) void R_DrawParticles (void) { - particle_t *p, **particle; - float grav; int i; - float time2, time3; - float time1; - float dvel; - float frametime; + float dvel, frametime, grav, time1, time2, time3; + particle_t *p, **particle; D_StartParticles (); @@ -661,7 +645,7 @@ R_DrawParticles (void) time3 = frametime * 15; time2 = frametime * 10; // 15; time1 = frametime * 5; - grav = frametime * 800 * 0.05; + grav = frametime * r_gravity * 0.05; dvel = 4 * frametime; for (particle = &active_particles; *particle;) { diff --git a/libs/video/renderer/sw32/sw32_rpart.c b/libs/video/renderer/sw32/sw32_rpart.c index 0fcc64d74..fb10c23b5 100644 --- a/libs/video/renderer/sw32/sw32_rpart.c +++ b/libs/video/renderer/sw32/sw32_rpart.c @@ -661,7 +661,7 @@ R_DrawParticles (void) time3 = frametime * 15; time2 = frametime * 10; // 15; time1 = frametime * 5; - grav = frametime * 800 * 0.05; + grav = frametime * r_gravity * 0.05; dvel = 4 * frametime; for (particle = &active_particles; *particle;) { diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index 39a6f3203..8943c905a 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -103,6 +103,8 @@ const char *svc_strings[] = { "svc_cutscene" }; +float r_gravity; + /* CL_EntityNum @@ -188,14 +190,14 @@ CL_KeepaliveMessage (void) do { ret = CL_GetMessage (); switch (ret) { - default: + default: Host_Error ("CL_KeepaliveMessage: CL_GetMessage failed"); - case 0: + case 0: break; // nothing waiting - case 1: + case 1: Host_Error ("CL_KeepaliveMessage: received a message"); break; - case 2: + case 2: if (MSG_ReadByte (net_message) != svc_nop) Host_Error ("CL_KeepaliveMessage: datagram wasn't a nop"); break; @@ -236,10 +238,11 @@ map_cfg (const char *mapname, int all) } else { Cmd_Exec_File (cbuf, "maps_default.cfg", 1); } - if (all) + if (all) { Cbuf_Execute_Stack (cbuf); - else + } else { Cbuf_Execute_Sets (cbuf); + } free (name); Cbuf_Delete (cbuf); } @@ -352,6 +355,7 @@ CL_ParseServerInfo (void) Hunk_Check (); // make sure nothing is hurt noclip_anglehack = false; // noclip is turned off at start + r_gravity = 800.0; // Set up gravity for renderer effects } int bitcounts[16]; diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 5be3856ed..a42537e89 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -168,6 +168,8 @@ int cl_h_playerindex, cl_gib1index, cl_gib2index, cl_gib3index; int packet_latency[NET_TIMINGS]; +float r_gravity; + extern cvar_t *hud_scoreboard_uid; @@ -735,6 +737,7 @@ CL_ParseServerData (void) // get the movevars movevars.gravity = MSG_ReadFloat (net_message); + r_gravity = movevars.gravity; // Gravity for renderer effects movevars.stopspeed = MSG_ReadFloat (net_message); movevars.maxspeed = MSG_ReadFloat (net_message); movevars.spectatormaxspeed = MSG_ReadFloat (net_message);