From a8d606e04251d9c056e3b7db1f0a2e896f24574d Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 27 Aug 2021 04:29:25 +0000 Subject: [PATCH] Fix c++isms. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6043 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_parse.c | 2 +- engine/client/cl_tent.c | 4 ++-- engine/client/p_script.c | 6 +++--- engine/client/pr_csqc.c | 4 ++-- engine/client/r_surf.c | 2 +- engine/common/particles.h | 1 + 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 9f105027a..21f1660bd 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -4774,7 +4774,7 @@ static void CL_ParseStaticProt (int baselinetype) } cl_static_entities[i].mdlidx = es.modelindex; - cl_static_entities[i].emit = NULL; + cl_static_entities[i].emit = trailkey_null; cl_static_entities[i].state = es; ent = &cl_static_entities[i].ent; diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index 5313d4bff..568487078 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -1065,8 +1065,8 @@ void CL_ParseStream (int type) P_DelinkTrailstate(&b2->trailstate); P_DelinkTrailstate(&b2->emitstate); memcpy(b2, b, sizeof(*b2)); - b2->trailstate = NULL; - b2->emitstate = NULL; + b2->trailstate = trailkey_null; + b2->emitstate = trailkey_null; b2->alpha = 0.5; b2->rflags = RF_TRANSLUCENT|RF_NOSHADOW; } diff --git a/engine/client/p_script.c b/engine/client/p_script.c index 5707e2753..52ab65889 100644 --- a/engine/client/p_script.c +++ b/engine/client/p_script.c @@ -4159,7 +4159,7 @@ static void PScript_DelinkTrailstate(trailkey_t *tk) } } -static trailstate_t *P_NewTrailstate() +static trailstate_t *P_NewTrailstate(void) { trailstate_t *ts; @@ -4954,7 +4954,7 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count, p->rgba[3] += ptype->alpharand*frandom(); // p->color = 0; if (ptype->emittime < 0) - p->state.trailstate = NULL; + p->state.trailstate = trailkey_null; else p->state.nextemit = particletime + ptype->emitstart - p->die; @@ -5787,7 +5787,7 @@ static void P_ParticleTrailSpawn (vec3_t startpos, vec3_t end, part_type_t *ptyp VectorClear (p->vel); if (ptype->emittime < 0) - p->state.trailstate = NULL; // init trailstate + p->state.trailstate = trailkey_null; // init trailstate else p->state.nextemit = particletime + ptype->emitstart - p->die; diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 9a0f91218..0d6712d9b 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -1048,7 +1048,7 @@ static void QCBUILTIN PF_cs_makestatic (pubprogfuncs_t *prinst, struct globalvar { entity_state_t *state = &cl_static_entities[cl.num_statics].state; memset(state, 0, sizeof(*state)); - cl_static_entities[cl.num_statics].emit = NULL; + cl_static_entities[cl.num_statics].emit = trailkey_null; cl_static_entities[cl.num_statics].mdlidx = in->v->modelindex; if (cl.worldmodel && cl.worldmodel->funcs.FindTouchedLeafs) cl.worldmodel->funcs.FindTouchedLeafs(cl.worldmodel, &cl_static_entities[cl.num_statics].ent.pvscache, in->v->absmin, in->v->absmax); @@ -3672,7 +3672,7 @@ void CSQC_ResetTrails(void) for (i = 0; i < *prinst->parms->num_edicts; i++) { ent = (csqcedict_t*)EDICT_NUM_PB(prinst, i); - ent->trailstate = NULL; + ent->trailstate = trailkey_null; } } diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index eeb5218a2..b86c7502d 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -4703,7 +4703,7 @@ TRACE(("dbg: Surf_NewMap: tp\n")); } if (cl.worldmodel && cl.worldmodel->loadstate == MLS_LOADED) cl.worldmodel->funcs.FindTouchedLeafs(cl.worldmodel, &cl_static_entities[i].ent.pvscache, mins, maxs); - cl_static_entities[i].emit = NULL; + cl_static_entities[i].emit = trailkey_null; } CL_InitDlights(); diff --git a/engine/common/particles.h b/engine/common/particles.h index 6446c463a..0f532a04b 100644 --- a/engine/common/particles.h +++ b/engine/common/particles.h @@ -167,6 +167,7 @@ extern int pt_q2[]; #endif typedef quint32_t trailkey_t; +#define trailkey_null 0 #define PARTICLE_Z_CLIP 8.0