From feb22f39c2c1a481b8c7a2364767b6402d5d94a1 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Fri, 2 Oct 2020 01:56:50 +0000 Subject: [PATCH] model_shared: Rename dp_model_t to model_t, to avoid confusion with the dpm format git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12984 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_collision.c | 14 +-- cl_collision.h | 4 +- cl_ents5.c | 2 +- cl_main.c | 8 +- cl_parse.c | 8 +- client.h | 20 ++-- clvm_cmds.c | 38 +++---- collision.c | 20 ++-- csprogs.c | 4 +- csprogs.h | 2 +- gl_draw.c | 12 +-- gl_rmain.c | 16 +-- gl_rsurf.c | 32 +++--- mod_skeletal_animatevertices_generic.c | 2 +- mod_skeletal_animatevertices_generic.h | 2 +- mod_skeletal_animatevertices_sse.c | 2 +- mod_skeletal_animatevertices_sse.h | 2 +- model_alias.c | 36 +++---- model_brush.c | 86 ++++++++-------- model_shared.c | 134 ++++++++++++------------- model_shared.h | 90 ++++++++--------- model_sprite.c | 4 +- portals.c | 8 +- portals.h | 6 +- progsvm.h | 6 +- prvm_cmds.c | 32 +++--- r_lightning.c | 4 +- r_shadow.c | 6 +- r_sprites.c | 2 +- r_stats.c | 2 +- render.h | 2 +- server.h | 4 +- snd_main.c | 2 +- sv_ccmds.c | 10 +- sv_ents5.c | 6 +- sv_main.c | 6 +- sv_phys.c | 14 +-- sv_send.c | 6 +- svvm_cmds.c | 22 ++-- world.c | 2 +- 40 files changed, 339 insertions(+), 339 deletions(-) diff --git a/cl_collision.c b/cl_collision.c index 559e91fa..2cd3a619 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -83,7 +83,7 @@ void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius) cl.worldmodel->brush.FindNonSolidLocation(cl.worldmodel, in, out, radius); } -dp_model_t *CL_GetModelByIndex(int modelindex) +model_t *CL_GetModelByIndex(int modelindex) { if(!modelindex) return NULL; @@ -101,7 +101,7 @@ dp_model_t *CL_GetModelByIndex(int modelindex) return NULL; } -dp_model_t *CL_GetModelFromEdict(prvm_edict_t *ed) +model_t *CL_GetModelFromEdict(prvm_edict_t *ed) { prvm_prog_t *prog = CLVM_prog; if (!ed || ed->priv.server->free) @@ -124,7 +124,7 @@ void CL_LinkEdict(prvm_edict_t *ent) if (PRVM_clientedictfloat(ent, solid) == SOLID_BSP) { - dp_model_t *model = CL_GetModelByIndex( (int)PRVM_clientedictfloat(ent, modelindex) ); + model_t *model = CL_GetModelByIndex( (int)PRVM_clientedictfloat(ent, modelindex) ); if (model == NULL) { Con_Printf("edict %i: SOLID_BSP with invalid modelindex!\n", PRVM_NUM_FOR_EDICT(ent)); @@ -223,7 +223,7 @@ trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -444,7 +444,7 @@ trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -672,7 +672,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -914,7 +914,7 @@ trace_t CL_Cache_TraceLineSurfaces(const vec3_t start, const vec3_t end, int typ // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; diff --git a/cl_collision.h b/cl_collision.h index d0c5b09d..620ea045 100644 --- a/cl_collision.h +++ b/cl_collision.h @@ -5,8 +5,8 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent); void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius); -dp_model_t *CL_GetModelByIndex(int modelindex); -dp_model_t *CL_GetModelFromEdict(prvm_edict_t *ed); +model_t *CL_GetModelByIndex(int modelindex); +model_t *CL_GetModelFromEdict(prvm_edict_t *ed); void CL_LinkEdict(prvm_edict_t *ent); int CL_GenericHitSuperContentsMask(const prvm_edict_t *edict); diff --git a/cl_ents5.c b/cl_ents5.c index d245e8a2..fceb5b3d 100644 --- a/cl_ents5.c +++ b/cl_ents5.c @@ -119,7 +119,7 @@ static void EntityState5_ReadUpdate(entity_state_t *s, int number) if (bits & E5_COMPLEXANIMATION) { skeleton_t *skeleton; - const dp_model_t *model; + const model_t *model; int modelindex; int type; int bonenum; diff --git a/cl_main.c b/cl_main.c index 3f24ce7b..d758cec8 100644 --- a/cl_main.c +++ b/cl_main.c @@ -612,7 +612,7 @@ List information on all models in the client modelindex static void CL_ModelIndexList_f(cmd_state_t *cmd) { int i; - dp_model_t *model; + model_t *model; // Print Header Con_Printf("%3s: %-30s %-8s %-8s\n", "ID", "Name", "Type", "Triangles"); @@ -659,7 +659,7 @@ void CL_UpdateRenderEntity(entity_render_t *ent) { vec3_t org; vec_t scale; - dp_model_t *model = ent->model; + model_t *model = ent->model; // update the inverse matrix for the renderer Matrix4x4_Invert_Simple(&ent->inversematrix, &ent->matrix); // update the animation blend state @@ -769,7 +769,7 @@ entity_render_t *CL_NewTempEntity(double shadertime) return render; } -void CL_Effect(vec3_t org, dp_model_t *model, int startframe, int framecount, float framerate) +void CL_Effect(vec3_t org, model_t *model, int startframe, int framecount, float framerate) { int i; cl_effect_t *e; @@ -2466,7 +2466,7 @@ void CL_Locs_Reload_f(cmd_state_t *cmd) } entity_t cl_meshentities[NUM_MESHENTITIES]; -dp_model_t cl_meshentitymodels[NUM_MESHENTITIES]; +model_t cl_meshentitymodels[NUM_MESHENTITIES]; const char *cl_meshentitynames[NUM_MESHENTITIES] = { "MESH_SCENE", diff --git a/cl_parse.c b/cl_parse.c index a78b67f6..4f1a07e2 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1953,7 +1953,7 @@ static void CL_ParseServerInfo (void) void CL_ValidateState(entity_state_t *s) { - dp_model_t *model; + model_t *model; if (!s->active) return; @@ -2345,7 +2345,7 @@ static void CL_ParseEffect2 (void) CL_Effect(org, CL_GetModelByIndex(modelindex), startframe, framecount, framerate); } -void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning) +void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning) { int i; beam_t *b = NULL; @@ -2384,7 +2384,7 @@ void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning Con_DPrint("beam list overflow!\n"); } -static void CL_ParseBeam (dp_model_t *m, int lightning) +static void CL_ParseBeam (model_t *m, int lightning) { int ent; vec3_t start, end; @@ -3994,7 +3994,7 @@ void CL_ParseServerMessage(void) { if (i >= 1 && i < MAX_MODELS) { - dp_model_t *model = Mod_ForName(s, false, false, s[0] == '*' ? cl.model_name[1] : NULL); + model_t *model = Mod_ForName(s, false, false, s[0] == '*' ? cl.model_name[1] : NULL); if (!model) Con_DPrintf("svc_precache: Mod_ForName(\"%s\") failed\n", s); cl.model_precache[i] = model; diff --git a/client.h b/client.h index 6c23f812..f561d06e 100644 --- a/client.h +++ b/client.h @@ -54,7 +54,7 @@ tridecal_t; typedef struct decalsystem_s { - dp_model_t *model; + model_t *model; double lastupdatetime; int maxdecals; int freedecal; @@ -74,7 +74,7 @@ typedef struct effect_s vec3_t origin; double starttime; float framerate; - dp_model_t *model; + model_t *model; int startframe; int endframe; // these are for interpolation @@ -341,7 +341,7 @@ typedef struct entity_render_s float transparent_offset; // NULL = no model - dp_model_t *model; + model_t *model; // number of the entity represents, or 0 for non-network entities int entitynumber; // literal colormap colors for renderer, if both are 0 0 0 it is not colormapped @@ -944,10 +944,10 @@ typedef struct client_state_s int gametype; // models and sounds used by engine code (particularly cl_parse.c) - dp_model_t *model_bolt; - dp_model_t *model_bolt2; - dp_model_t *model_bolt3; - dp_model_t *model_beam; + model_t *model_bolt; + model_t *model_bolt2; + model_t *model_bolt3; + model_t *model_beam; sfx_t *sfx_wizhit; sfx_t *sfx_knighthit; sfx_t *sfx_tink1; @@ -1278,7 +1278,7 @@ void CL_ValidateState(entity_state_t *s); void CL_MoveLerpEntityStates(entity_t *ent); void CL_LerpUpdate(entity_t *e); void CL_ParseTEnt (void); -void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning); +void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning); void CL_RelinkBeams (void); void CL_Beam_CalculatePositions (const beam_t *b, vec3_t start, vec3_t end); void CL_ClientMovement_Replay(void); @@ -1286,7 +1286,7 @@ void CL_ClientMovement_Replay(void); void CL_ClearTempEntities (void); entity_render_t *CL_NewTempEntity (double shadertime); -void CL_Effect(vec3_t org, dp_model_t *model, int startframe, int framecount, float framerate); +void CL_Effect(vec3_t org, model_t *model, int startframe, int framecount, float framerate); void CL_ClearState (void); void CL_ExpandEntities(int num); @@ -1385,7 +1385,7 @@ typedef enum meshname_e { NUM_MESHENTITIES, } meshname_t; extern entity_t cl_meshentities[NUM_MESHENTITIES]; -extern dp_model_t cl_meshentitymodels[NUM_MESHENTITIES]; +extern model_t cl_meshentitymodels[NUM_MESHENTITIES]; extern const char *cl_meshentitynames[NUM_MESHENTITIES]; #define CL_Mesh_Scene() (&cl_meshentitymodels[MESH_SCENE]) #define CL_Mesh_UI() (&cl_meshentitymodels[MESH_UI]) diff --git a/clvm_cmds.c b/clvm_cmds.c index 8432a0a0..7ad7020d 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -91,7 +91,7 @@ static void VM_CL_setmodel (prvm_prog_t *prog) { prvm_edict_t *e; const char *m; - dp_model_t *mod; + model_t *mod; int i; VM_SAFEPARMCOUNT(2, VM_CL_setmodel); @@ -420,7 +420,7 @@ static void VM_CL_precache_model (prvm_prog_t *prog) { const char *name; int i; - dp_model_t *m; + model_t *m; VM_SAFEPARMCOUNT(1, VM_CL_precache_model); @@ -441,7 +441,7 @@ static void VM_CL_precache_model (prvm_prog_t *prog) { if (!cl.csqc_model_precache[i]) { - cl.csqc_model_precache[i] = (dp_model_t*)m; + cl.csqc_model_precache[i] = (model_t*)m; PRVM_G_FLOAT(OFS_RETURN) = -(i+1); return; } @@ -1299,7 +1299,7 @@ static void VM_CL_setmodelindex (prvm_prog_t *prog) //#334 string(float mdlindex) modelnameforindex (EXT_CSQC) static void VM_CL_modelnameforindex (prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; VM_SAFEPARMCOUNT(1, VM_CL_modelnameforindex); @@ -1872,7 +1872,7 @@ static void VM_CL_copyentity (prvm_prog_t *prog) // #404 void(vector org, string modelname, float startframe, float endframe, float framerate) effect (DP_SV_EFFECT) static void VM_CL_effect (prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; vec3_t org; VM_SAFEPARMCOUNT(5, VM_CL_effect); VectorCopy(PRVM_G_VECTOR(OFS_PARM0), org); @@ -2302,7 +2302,7 @@ static void VM_CL_setattachment (prvm_prog_t *prog) const char *tagname; int modelindex; int tagindex; - dp_model_t *model; + model_t *model; VM_SAFEPARMCOUNT(3, VM_CL_setattachment); e = PRVM_G_EDICT(OFS_PARM0); @@ -2347,7 +2347,7 @@ static void VM_CL_setattachment (prvm_prog_t *prog) static int CL_GetTagIndex (prvm_prog_t *prog, prvm_edict_t *e, const char *tagname) { - dp_model_t *model = CL_GetModelFromEdict(e); + model_t *model = CL_GetModelFromEdict(e); if (model) return Mod_Alias_GetTagIndexForName(model, (int)PRVM_clientedictfloat(e, skin), tagname); else @@ -2357,7 +2357,7 @@ static int CL_GetTagIndex (prvm_prog_t *prog, prvm_edict_t *e, const char *tagna static int CL_GetExtendedTagInfo (prvm_prog_t *prog, prvm_edict_t *e, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix) { int r; - dp_model_t *model; + model_t *model; *tagname = NULL; *parentindex = 0; @@ -2380,7 +2380,7 @@ static int CL_GetExtendedTagInfo (prvm_prog_t *prog, prvm_edict_t *e, int tagind int CL_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent) { - dp_model_t *model; + model_t *model; if ((model = CL_GetModelFromEdict(ent)) && model->type == mod_alias) return -1; return 1; @@ -2418,7 +2418,7 @@ void CL_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, static int CL_GetEntityLocalTagMatrix(prvm_prog_t *prog, prvm_edict_t *ent, int tagindex, matrix4x4_t *out) { - dp_model_t *model; + model_t *model; if (tagindex >= 0 && (model = CL_GetModelFromEdict(ent)) && model->animscenes) @@ -2447,7 +2447,7 @@ int CL_GetTagMatrix (prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int int ret; int attachloop; matrix4x4_t entitymatrix, tagmatrix, attachmatrix; - dp_model_t *model; + model_t *model; vec3_t shadingorigin; *out = identitymatrix; // warnings and errors return identical matrix @@ -2576,7 +2576,7 @@ static void VM_CL_gettaginfo (prvm_prog_t *prog) const char *tagname; int returncode; vec3_t forward, left, up, origin; - const dp_model_t *model; + const model_t *model; VM_SAFEPARMCOUNT(2, VM_CL_gettaginfo); @@ -3292,7 +3292,7 @@ static void VM_CL_R_PolygonBegin (prvm_prog_t *prog) const char *texname; int drawflags; qbool draw2d; - dp_model_t *mod; + model_t *mod; VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_R_PolygonBegin); @@ -3328,7 +3328,7 @@ static void VM_CL_R_PolygonVertex (prvm_prog_t *prog) const prvm_vec_t *c = PRVM_G_VECTOR(OFS_PARM2); const prvm_vec_t a = PRVM_G_FLOAT(OFS_PARM3); float *o; - dp_model_t *mod = prog->polygonbegin_model; + model_t *mod = prog->polygonbegin_model; VM_SAFEPARMCOUNT(4, VM_CL_R_PolygonVertex); @@ -3365,7 +3365,7 @@ static void VM_CL_R_PolygonEnd (prvm_prog_t *prog) qbool hasalpha; int e0 = 0, e1 = 0, e2 = 0; float *o; - dp_model_t *mod = prog->polygonbegin_model; + model_t *mod = prog->polygonbegin_model; msurface_t *surf; texture_t *tex; int materialflags; @@ -3760,7 +3760,7 @@ static void VM_CL_checkpvs (prvm_prog_t *prog) static void VM_CL_skel_create(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = CL_GetModelByIndex(modelindex); + model_t *model = CL_GetModelByIndex(modelindex); skeleton_t *skeleton; int i; PRVM_G_FLOAT(OFS_RETURN) = 0; @@ -3790,7 +3790,7 @@ static void VM_CL_skel_build(prvm_prog_t *prog) float retainfrac = PRVM_G_FLOAT(OFS_PARM3); int firstbone = PRVM_G_FLOAT(OFS_PARM4) - 1; int lastbone = PRVM_G_FLOAT(OFS_PARM5) - 1; - dp_model_t *model = CL_GetModelByIndex(modelindex); + model_t *model = CL_GetModelByIndex(modelindex); int numblends; int bonenum; int blendindex; @@ -4033,7 +4033,7 @@ static void VM_CL_skel_delete(prvm_prog_t *prog) static void VM_CL_frameforname(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = CL_GetModelByIndex(modelindex); + model_t *model = CL_GetModelByIndex(modelindex); const char *name = PRVM_G_STRING(OFS_PARM1); int i; PRVM_G_FLOAT(OFS_RETURN) = -1; @@ -4053,7 +4053,7 @@ static void VM_CL_frameforname(prvm_prog_t *prog) static void VM_CL_frameduration(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = CL_GetModelByIndex(modelindex); + model_t *model = CL_GetModelByIndex(modelindex); int framenum = (int)PRVM_G_FLOAT(OFS_PARM1); PRVM_G_FLOAT(OFS_RETURN) = 0; if (!model || !model->animscenes || framenum < 0 || framenum >= model->numframes) diff --git a/collision.c b/collision.c index fa1797aa..02115ccb 100644 --- a/collision.c +++ b/collision.c @@ -1445,7 +1445,7 @@ static void Collision_TransformBrush(const matrix4x4_t *matrix, colbrushf_t *bru typedef struct collision_cachedtrace_parameters_s { - dp_model_t *model; + model_t *model; vec3_t end; vec3_t start; int hitsupercontentsmask; @@ -1580,7 +1580,7 @@ static unsigned int Collision_Cache_HashIndexForArray(unsigned int *array, unsig return hashindex; } -static collision_cachedtrace_t *Collision_Cache_Lookup(dp_model_t *model, const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +static collision_cachedtrace_t *Collision_Cache_Lookup(model_t *model, const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { int hashindex = 0; unsigned int fullhashindex; @@ -1688,7 +1688,7 @@ static collision_cachedtrace_t *Collision_Cache_Lookup(dp_model_t *model, const return cached; } -void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, dp_model_t *model, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, model_t *model, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { collision_cachedtrace_t *cached = Collision_Cache_Lookup(model, matrix, inversematrix, start, end, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask); if (cached->valid) @@ -1702,7 +1702,7 @@ void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, dp_model_t cached->result = *trace; } -void Collision_Cache_ClipLineToWorldSurfaces(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Collision_Cache_ClipLineToWorldSurfaces(trace_t *trace, model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { collision_cachedtrace_t *cached = Collision_Cache_Lookup(model, &identitymatrix, &identitymatrix, start, end, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask); if (cached->valid) @@ -1788,7 +1788,7 @@ static void Collision_ClipExtendFinish(extendtraceinfo_t *extendtraceinfo) VectorMA(extendtraceinfo->realstart, trace->fraction, extendtraceinfo->realdelta, trace->endpos); } -void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend) +void Collision_ClipToGenericEntity(trace_t *trace, model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend) { vec3_t starttransformed, endtransformed; extendtraceinfo_t extendtraceinfo; @@ -1831,7 +1831,7 @@ void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const fram Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } -void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend) +void Collision_ClipToWorld(trace_t *trace, model_t *model, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend) { extendtraceinfo_t extendtraceinfo; Collision_ClipExtendPrepare(&extendtraceinfo, trace, tstart, tend, extend); @@ -1841,7 +1841,7 @@ void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstar Collision_ClipExtendFinish(&extendtraceinfo); } -void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces) +void Collision_ClipLineToGenericEntity(trace_t *trace, model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces) { vec3_t starttransformed, endtransformed; extendtraceinfo_t extendtraceinfo; @@ -1867,7 +1867,7 @@ void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } -void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces) +void Collision_ClipLineToWorld(trace_t *trace, model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces) { extendtraceinfo_t extendtraceinfo; Collision_ClipExtendPrepare(&extendtraceinfo, trace, tstart, tend, extend); @@ -1880,7 +1880,7 @@ void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t t Collision_ClipExtendFinish(&extendtraceinfo); } -void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Collision_ClipPointToGenericEntity(trace_t *trace, model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { float starttransformed[3]; memset(trace, 0, sizeof(*trace)); @@ -1902,7 +1902,7 @@ void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } -void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Collision_ClipPointToWorld(trace_t *trace, model_t *model, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { memset(trace, 0, sizeof(*trace)); trace->fraction = 1; diff --git a/csprogs.c b/csprogs.c index 21453fae..94e3b9d0 100644 --- a/csprogs.c +++ b/csprogs.c @@ -293,7 +293,7 @@ qbool CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum) int c; float scale; entity_render_t *entrender; - dp_model_t *model; + model_t *model; prvm_vec3_t modellight_origin; model = CL_GetModelFromEdict(ed); @@ -1172,7 +1172,7 @@ qbool CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out) { prvm_prog_t *prog = CLVM_prog; prvm_edict_t *ed; - dp_model_t *mod; + model_t *mod; matrix4x4_t matrix; qbool r = 0; diff --git a/csprogs.h b/csprogs.h index 4b2fc486..9f49bfb1 100644 --- a/csprogs.h +++ b/csprogs.h @@ -113,7 +113,7 @@ void CSQC_Think(prvm_edict_t *ed); qbool CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum);//csprogs.c void CSQC_R_RecalcView(void); -dp_model_t *CL_GetModelByIndex(int modelindex); +model_t *CL_GetModelByIndex(int modelindex); int CL_VM_GetViewEntity(void); diff --git a/gl_draw.c b/gl_draw.c index 0b97a288..2211f261 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -782,7 +782,7 @@ qbool r_draw2d_force = false; void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags) { - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf; int e0, e1, e2, e3; if (!pic) @@ -810,7 +810,7 @@ void DrawQ_RotPic(float x, float y, cachepic_t *pic, float width, float height, float cosaf = cos(af); float sinar = sin(ar); float cosar = cos(ar); - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf; int e0, e1, e2, e3; if (!pic) @@ -1095,7 +1095,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma size_t bytes_left; float dw, dh; const float *width_of; - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf = NULL; int e0, e1, e2, e3; int tw, th; @@ -1384,7 +1384,7 @@ static int DrawQ_BuildColoredText(char *output2c, size_t maxoutchars, const char void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags) { - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf; int e0, e1, e2, e3; if (!pic) @@ -1406,7 +1406,7 @@ void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags) { - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf; int e0, e1, e2, e3; float offsetx, offsety; @@ -1473,7 +1473,7 @@ void DrawQ_RecalcView(void) void DrawQ_FlushUI(void) { - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); if (mod->num_surfaces == 0) return; diff --git a/gl_rmain.c b/gl_rmain.c index 4e76b895..1b6c3d8e 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3851,7 +3851,7 @@ void R_AnimCache_ClearCache(void) qbool R_AnimCache_GetEntity(entity_render_t *ent, qbool wantnormals, qbool wanttangents) { - dp_model_t *model = ent->model; + model_t *model = ent->model; int numvertices; // see if this ent is worth caching @@ -3957,7 +3957,7 @@ qbool R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t en vec3_t padmins, padmaxs; vec3_t start; vec3_t end; - dp_model_t *model = r_refdef.scene.worldmodel; + model_t *model = r_refdef.scene.worldmodel; static vec3_t positions[] = { { 0.5f, 0.5f, 0.5f }, { 0.0f, 0.0f, 0.0f }, @@ -6598,7 +6598,7 @@ texture_t *R_GetCurrentTexture(texture_t *t) { int i, q; const entity_render_t *ent = rsurface.entity; - dp_model_t *model = ent->model; // when calling this, ent must not be NULL + model_t *model = ent->model; // when calling this, ent must not be NULL q3shaderinfo_layer_tcmod_t *tcmod; float specularscale = 0.0f; @@ -6968,7 +6968,7 @@ rsurfacestate_t rsurface; void RSurf_ActiveModelEntity(const entity_render_t *ent, qbool wantnormals, qbool wanttangents, qbool prepass) { - dp_model_t *model = ent->model; + model_t *model = ent->model; //if (rsurface.entity == ent && (!model->surfmesh.isanimated || (!wantnormals && !wanttangents))) // return; rsurface.entity = (entity_render_t *)ent; @@ -9310,7 +9310,7 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor matrix4x4_t projection; decalsystem_t *decalsystem; qbool dynamic; - dp_model_t *model; + model_t *model; const msurface_t *surface; const msurface_t *surfaces; const int *surfacelist; @@ -9777,7 +9777,7 @@ static void R_DrawDebugModel(void) entity_render_t *ent = rsurface.entity; int i, j, flagsmask; const msurface_t *surface; - dp_model_t *model = ent->model; + model_t *model = ent->model; if (!sv.active && !cls.demoplayback && ent != r_refdef.scene.worldentity) return; @@ -9995,7 +9995,7 @@ const msurface_t **r_surfacelist = NULL; void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedepth, qbool depthonly, qbool debug, qbool prepass, qbool ui) { int i, j, endj, flagsmask; - dp_model_t *model = ent->model; + model_t *model = ent->model; msurface_t *surfaces; unsigned char *update; int numsurfacelist = 0; @@ -10112,7 +10112,7 @@ void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedep void R_DebugLine(vec3_t start, vec3_t end) { - dp_model_t *mod = CL_Mesh_UI(); + model_t *mod = CL_Mesh_UI(); msurface_t *surf; int e0, e1, e2, e3; float offsetx, offsety, x1, y1, x2, y2, width = 1.0f; diff --git a/gl_rsurf.c b/gl_rsurf.c index d97098d5..5864b457 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -52,7 +52,7 @@ void R_BuildLightMap (const entity_render_t *ent, msurface_t *surface) int smax, tmax, i, size, size3, maps, l; int *bl, scale; unsigned char *lightmap, *out, *stain; - dp_model_t *model = ent->model; + model_t *model = ent->model; int *intblocklights; unsigned char *templight; @@ -173,7 +173,7 @@ void R_BuildLightMap (const entity_render_t *ent, msurface_t *surface) } } -static void R_StainNode (mnode_t *node, dp_model_t *model, const vec3_t origin, float radius, const float fcolor[8]) +static void R_StainNode (mnode_t *node, model_t *model, const vec3_t origin, float radius, const float fcolor[8]) { float ndist, a, ratio, maxdist, maxdist2, maxdist3, invradius, sdtable[256], td, dist2; msurface_t *surface, *endsurface; @@ -300,7 +300,7 @@ void R_Stain (const vec3_t origin, float radius, int cr1, int cg1, int cb1, int int n; float fcolor[8]; entity_render_t *ent; - dp_model_t *model; + model_t *model; vec3_t org; if (r_refdef.scene.worldmodel == NULL || !r_refdef.scene.worldmodel->brush.data_nodes || !r_refdef.scene.worldmodel->brushq1.lightdata) return; @@ -383,7 +383,7 @@ void R_DrawPortals(void) int i, leafnum; mportal_t *portal; float center[3], f; - dp_model_t *model = r_refdef.scene.worldmodel; + model_t *model = r_refdef.scene.worldmodel; if (model == NULL) return; for (leafnum = 0;leafnum < r_refdef.scene.worldmodel->brush.num_leafs;leafnum++) @@ -415,7 +415,7 @@ static void R_View_WorldVisibility_CullSurfaces(void) int surfaceindexend; unsigned char *surfacevisible; msurface_t *surfaces; - dp_model_t *model = r_refdef.scene.worldmodel; + model_t *model = r_refdef.scene.worldmodel; if (!model) return; if (r_trippy.integer) @@ -442,7 +442,7 @@ void R_View_WorldVisibility(qbool forcenovis) int i, j, *mark; mleaf_t *leaf; mleaf_t *viewleaf; - dp_model_t *model = r_refdef.scene.worldmodel; + model_t *model = r_refdef.scene.worldmodel; if (!model) return; @@ -609,7 +609,7 @@ void R_Mod_DrawSky(entity_render_t *ent) void R_Mod_DrawAddWaterPlanes(entity_render_t *ent) { int i, j, n, flagsmask; - dp_model_t *model = ent->model; + model_t *model = ent->model; msurface_t *surfaces; if (model == NULL) return; @@ -648,7 +648,7 @@ void R_Mod_DrawAddWaterPlanes(entity_render_t *ent) void R_Mod_Draw(entity_render_t *ent) { - dp_model_t *model = ent->model; + model_t *model = ent->model; if (model == NULL) return; R_DrawModelSurfaces(ent, false, true, false, false, false, false); @@ -656,7 +656,7 @@ void R_Mod_Draw(entity_render_t *ent) void R_Mod_DrawDepth(entity_render_t *ent) { - dp_model_t *model = ent->model; + model_t *model = ent->model; if (model == NULL || model->surfmesh.isanimated) return; GL_ColorMask(0,0,0,0); @@ -678,7 +678,7 @@ void R_Mod_DrawDebug(entity_render_t *ent) void R_Mod_DrawPrepass(entity_render_t *ent) { - dp_model_t *model = ent->model; + model_t *model = ent->model; if (model == NULL) return; R_DrawModelSurfaces(ent, false, true, false, false, true, false); @@ -686,7 +686,7 @@ void R_Mod_DrawPrepass(entity_render_t *ent) typedef struct r_q1bsp_getlightinfo_s { - dp_model_t *model; + model_t *model; vec3_t relativelightorigin; float lightradius; int *outleaflist; @@ -1297,7 +1297,7 @@ void R_Mod_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, float void R_Mod_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist) { - dp_model_t *model = ent->model; + model_t *model = ent->model; msurface_t *surface; int surfacelistindex; int sidetotals[6] = { 0, 0, 0, 0, 0, 0 }, sidemasks = 0; @@ -1328,7 +1328,7 @@ static const msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES]; void R_Mod_DrawShadowMap(int side, entity_render_t *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs) { - dp_model_t *model = ent->model; + model_t *model = ent->model; const msurface_t *surface; int modelsurfacelistindex, batchnumsurfaces; // check the box in modelspace, it was already checked in worldspace @@ -1407,7 +1407,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co extern qbool r_shadow_usingdeferredprepass; void R_Mod_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *lighttrispvs) { - dp_model_t *model = ent->model; + model_t *model = ent->model; const msurface_t *surface; int i, k, kend, l, endsurface, batchnumsurfaces, texturenumsurfaces; const msurface_t **texturesurfacelist; @@ -1491,7 +1491,7 @@ void R_Mod_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfaceli //Made by [515] static void R_ReplaceWorldTexture_f(cmd_state_t *cmd) { - dp_model_t *m; + model_t *m; texture_t *t; int i; const char *r, *newt; @@ -1540,7 +1540,7 @@ static void R_ReplaceWorldTexture_f(cmd_state_t *cmd) //Made by [515] static void R_ListWorldTextures_f(cmd_state_t *cmd) { - dp_model_t *m; + model_t *m; texture_t *t; int i; if (!r_refdef.scene.worldmodel) diff --git a/mod_skeletal_animatevertices_generic.c b/mod_skeletal_animatevertices_generic.c index 5a1047d9..932546eb 100644 --- a/mod_skeletal_animatevertices_generic.c +++ b/mod_skeletal_animatevertices_generic.c @@ -1,6 +1,6 @@ #include "mod_skeletal_animatevertices_generic.h" -void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) +void Mod_Skeletal_AnimateVertices_Generic(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex weighted skeletal int i, k; diff --git a/mod_skeletal_animatevertices_generic.h b/mod_skeletal_animatevertices_generic.h index 2ad97eb6..672e4324 100644 --- a/mod_skeletal_animatevertices_generic.h +++ b/mod_skeletal_animatevertices_generic.h @@ -3,6 +3,6 @@ #include "quakedef.h" -void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f); +void Mod_Skeletal_AnimateVertices_Generic(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f); #endif diff --git a/mod_skeletal_animatevertices_sse.c b/mod_skeletal_animatevertices_sse.c index ea39f8a0..0c2fa5d9 100644 --- a/mod_skeletal_animatevertices_sse.c +++ b/mod_skeletal_animatevertices_sse.c @@ -8,7 +8,7 @@ #include -void Mod_Skeletal_AnimateVertices_SSE(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) +void Mod_Skeletal_AnimateVertices_SSE(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex weighted skeletal int i, k; diff --git a/mod_skeletal_animatevertices_sse.h b/mod_skeletal_animatevertices_sse.h index 7de55ca6..aa98fce8 100644 --- a/mod_skeletal_animatevertices_sse.h +++ b/mod_skeletal_animatevertices_sse.h @@ -4,7 +4,7 @@ #include "quakedef.h" #ifdef SSE_POSSIBLE -void Mod_Skeletal_AnimateVertices_SSE(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f); +void Mod_Skeletal_AnimateVertices_SSE(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f); #endif #endif diff --git a/model_alias.c b/model_alias.c index b5f304f6..95f61ab7 100644 --- a/model_alias.c +++ b/model_alias.c @@ -62,7 +62,7 @@ void *Mod_Skeletal_AnimateVertices_AllocBuffers(size_t nbytes) return Mod_Skeletal_AnimateVertices_bonepose; } -void Mod_Skeletal_BuildTransforms(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT bonepose, float * RESTRICT boneposerelative) +void Mod_Skeletal_BuildTransforms(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT bonepose, float * RESTRICT boneposerelative) { int i, blends; float m[12]; @@ -160,7 +160,7 @@ void Mod_Skeletal_BuildTransforms(const dp_model_t * RESTRICT model, const frame } } -static void Mod_Skeletal_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) +static void Mod_Skeletal_AnimateVertices(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { if (!model->surfmesh.num_vertices) @@ -213,7 +213,7 @@ void Mod_AliasInit (void) #endif } -static int Mod_Skeletal_AddBlend(dp_model_t *model, const blendweights_t *newweights) +static int Mod_Skeletal_AddBlend(model_t *model, const blendweights_t *newweights) { int i; blendweights_t *weights; @@ -230,7 +230,7 @@ static int Mod_Skeletal_AddBlend(dp_model_t *model, const blendweights_t *newwei return model->num_bones + i; } -static int Mod_Skeletal_CompressBlend(dp_model_t *model, const int *newindex, const float *newinfluence) +static int Mod_Skeletal_CompressBlend(model_t *model, const int *newindex, const float *newinfluence) { int i, total; float scale; @@ -273,7 +273,7 @@ static int Mod_Skeletal_CompressBlend(dp_model_t *model, const int *newindex, co return Mod_Skeletal_AddBlend(model, &newweights); } -static void Mod_MD3_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) +static void Mod_MD3_AnimateVertices(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex morph int i, numblends, blendnum; @@ -361,7 +361,7 @@ static void Mod_MD3_AnimateVertices(const dp_model_t * RESTRICT model, const fra } } } -static void Mod_MDL_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) +static void Mod_MDL_AnimateVertices(const model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex morph int i, numblends, blendnum; @@ -458,7 +458,7 @@ static void Mod_MDL_AnimateVertices(const dp_model_t * RESTRICT model, const fra } } -int Mod_Alias_GetTagMatrix(const dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, int tagindex, matrix4x4_t *outmatrix) +int Mod_Alias_GetTagMatrix(const model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, int tagindex, matrix4x4_t *outmatrix) { matrix4x4_t temp; matrix4x4_t parentbonematrix; @@ -525,7 +525,7 @@ int Mod_Alias_GetTagMatrix(const dp_model_t *model, const frameblend_t *frameble return 0; } -int Mod_Alias_GetExtendedTagInfoForIndex(const dp_model_t *model, unsigned int skin, const frameblend_t *frameblend, const skeleton_t *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix) +int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const frameblend_t *frameblend, const skeleton_t *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix) { int blendindex; int k; @@ -582,7 +582,7 @@ int Mod_Alias_GetExtendedTagInfoForIndex(const dp_model_t *model, unsigned int s return 2; } -int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname) +int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname) { int i; if(skin >= (unsigned int)model->numskins) @@ -752,7 +752,7 @@ static void Mod_Alias_MorphMesh_CompileFrames(void) } } -static void Mod_MDLMD2MD3_TraceLine(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +static void Mod_MDLMD2MD3_TraceLine(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { int i; float segmentmins[3], segmentmaxs[3]; @@ -791,7 +791,7 @@ static void Mod_MDLMD2MD3_TraceLine(dp_model_t *model, const frameblend_t *frame Mem_Free(freevertex3f); } -static void Mod_MDLMD2MD3_TraceBox(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +static void Mod_MDLMD2MD3_TraceBox(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { int i; vec3_t shiftstart, shiftend; @@ -969,7 +969,7 @@ void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfile, con extern cvar_t r_nolerp_list; #define BOUNDI(VALUE,MIN,MAX) if (VALUE < MIN || VALUE >= MAX) Host_Error("model %s has an invalid ##VALUE (%d exceeds %d - %d)", loadmodel->name, VALUE, MIN, MAX); #define BOUNDF(VALUE,MIN,MAX) if (VALUE < MIN || VALUE >= MAX) Host_Error("model %s has an invalid ##VALUE (%f exceeds %f - %f)", loadmodel->name, VALUE, MIN, MAX); -void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, version, totalskins, skinwidth, skinheight, groupframes, groupskins, numverts; float scales, scalet, interval; @@ -1331,7 +1331,7 @@ void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend) } } -void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, hashindex, numxyz, numst, xyz, st, skinwidth, skinheight, *vertremap, version, end; float iskinwidth, iskinheight; @@ -1595,7 +1595,7 @@ void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend) } } -void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, k, version, meshvertices, meshtriangles; unsigned char *data; @@ -1785,7 +1785,7 @@ void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend) } } -void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend) { zymtype1header_t *pinmodel, *pheader; unsigned char *pbase; @@ -2178,7 +2178,7 @@ void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) } } -void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend) { dpmheader_t *pheader; dpmframe_t *frames; @@ -2554,7 +2554,7 @@ void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) // no idea why PSK/PSA files contain weird quaternions but they do... #define PSKQUATNEGATIONS -void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, index, version, recordsize, numrecords, meshvertices, meshtriangles; int numpnts, numvtxw, numfaces, nummatts, numbones, numrawweights, numanimbones, numanims, numanimkeys; @@ -3223,7 +3223,7 @@ void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) } } -void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend) { unsigned char *data; const char *text; diff --git a/model_brush.c b/model_brush.c index f9cd4e29..cc52e72e 100644 --- a/model_brush.c +++ b/model_brush.c @@ -148,7 +148,7 @@ void Mod_BrushInit(void) mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER; } -static mleaf_t *Mod_BSP_PointInLeaf(dp_model_t *model, const vec3_t p) +static mleaf_t *Mod_BSP_PointInLeaf(model_t *model, const vec3_t p) { mnode_t *node; @@ -164,7 +164,7 @@ static mleaf_t *Mod_BSP_PointInLeaf(dp_model_t *model, const vec3_t p) return (mleaf_t *)node; } -static void Mod_Q1BSP_AmbientSoundLevelsForPoint(dp_model_t *model, const vec3_t p, unsigned char *out, int outsize) +static void Mod_Q1BSP_AmbientSoundLevelsForPoint(model_t *model, const vec3_t p, unsigned char *out, int outsize) { int i; mleaf_t *leaf; @@ -183,7 +183,7 @@ static void Mod_Q1BSP_AmbientSoundLevelsForPoint(dp_model_t *model, const vec3_t memset(out, 0, outsize); } -static int Mod_BSP_FindBoxClusters(dp_model_t *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist) +static int Mod_BSP_FindBoxClusters(model_t *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist) { int numclusters = 0; int nodestackindex = 0; @@ -249,7 +249,7 @@ static int Mod_BSP_FindBoxClusters(dp_model_t *model, const vec3_t mins, const v return numclusters; } -static int Mod_BSP_BoxTouchingPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingPVS(model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -320,7 +320,7 @@ static int Mod_BSP_BoxTouchingPVS(dp_model_t *model, const unsigned char *pvs, c return false; } -static int Mod_BSP_BoxTouchingLeafPVS(dp_model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingLeafPVS(model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -391,7 +391,7 @@ static int Mod_BSP_BoxTouchingLeafPVS(dp_model_t *model, const unsigned char *pv return false; } -static int Mod_BSP_BoxTouchingVisibleLeafs(dp_model_t *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs) +static int Mod_BSP_BoxTouchingVisibleLeafs(model_t *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs) { int nodestackindex = 0; mnode_t *node, *nodestack[1024]; @@ -467,7 +467,7 @@ typedef struct findnonsolidlocationinfo_s vec_t radius; vec3_t nudge; vec_t bestdist; - dp_model_t *model; + model_t *model; } findnonsolidlocationinfo_t; @@ -595,7 +595,7 @@ static void Mod_Q1BSP_FindNonSolidLocation_r(findnonsolidlocationinfo_t *info, m } } -static void Mod_BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, vec3_t out, float radius) +static void Mod_BSP_FindNonSolidLocation(model_t *model, const vec3_t in, vec3_t out, float radius) { int i; findnonsolidlocationinfo_t info; @@ -1183,7 +1183,7 @@ static qbool Mod_Q1BSP_TraceLineOfSight(struct model_s *model, const vec3_t star return trace.fraction == 1 || BoxesOverlap(trace.endpos, trace.endpos, acceptmins, acceptmaxs); } -static int Mod_BSP_LightPoint_RecursiveBSPNode(dp_model_t *model, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal, const mnode_t *node, float x, float y, float startz, float endz) +static int Mod_BSP_LightPoint_RecursiveBSPNode(model_t *model, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal, const mnode_t *node, float x, float y, float startz, float endz) { int side; float front, back; @@ -1327,7 +1327,7 @@ static int Mod_BSP_LightPoint_RecursiveBSPNode(dp_model_t *model, vec3_t ambient return false; } -static void Mod_BSP_LightPoint(dp_model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) +static void Mod_BSP_LightPoint(model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) { // pretend lighting is coming down from above (due to lack of a lightgrid to know primary lighting direction) VectorSet(diffusenormal, 0, 0, 1); @@ -1342,7 +1342,7 @@ static void Mod_BSP_LightPoint(dp_model_t *model, const vec3_t p, vec3_t ambient Mod_BSP_LightPoint_RecursiveBSPNode(model, ambientcolor, diffusecolor, diffusenormal, model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode, p[0], p[1], p[2] + 0.125, p[2] - 65536); } -static const texture_t *Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode(RecursiveHullCheckTraceInfo_t *t, const dp_model_t *model, const mnode_t *node, double mid[3]) +static const texture_t *Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode(RecursiveHullCheckTraceInfo_t *t, const model_t *model, const mnode_t *node, double mid[3]) { unsigned int i; int j; @@ -1413,7 +1413,7 @@ static const texture_t *Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode(Recu return NULL; } -static int Mod_Q1BSP_TraceLineAgainstSurfacesRecursiveBSPNode(RecursiveHullCheckTraceInfo_t *t, const dp_model_t *model, const mnode_t *node, const double p1[3], const double p2[3]) +static int Mod_Q1BSP_TraceLineAgainstSurfacesRecursiveBSPNode(RecursiveHullCheckTraceInfo_t *t, const model_t *model, const mnode_t *node, const double p1[3], const double p2[3]) { const mplane_t *plane; double t1, t2; @@ -3244,7 +3244,7 @@ static void Mod_Q1BSP_LoadPlanes(sizebuf_t *sb) } // fixes up sky surfaces that have SKY contents behind them, so that they do not cast shadows (e1m5 logo shadow trick). -static void Mod_Q1BSP_AssignNoShadowSkySurfaces(dp_model_t *mod) +static void Mod_Q1BSP_AssignNoShadowSkySurfaces(model_t *mod) { int i; msurface_t *surface; @@ -3764,7 +3764,7 @@ static void Mod_BSP_MakePortals(void) //Returns PVS data for a given point //(note: can return NULL) -static unsigned char *Mod_BSP_GetPVS(dp_model_t *model, const vec3_t p) +static unsigned char *Mod_BSP_GetPVS(model_t *model, const vec3_t p) { mnode_t *node; node = model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode; @@ -3776,7 +3776,7 @@ static unsigned char *Mod_BSP_GetPVS(dp_model_t *model, const vec3_t p) return NULL; } -static void Mod_BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbytes, mnode_t *node) +static void Mod_BSP_FatPVS_RecursiveBSPNode(model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbytes, mnode_t *node) { while (node->plane) { @@ -3804,7 +3804,7 @@ static void Mod_BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t org, //Calculates a PVS that is the inclusive or of all leafs within radius pixels //of the given point. -static int Mod_BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qbool merge) +static int Mod_BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qbool merge) { int bytes = model->brush.num_pvsclusterbytes; bytes = min(bytes, pvsbufferlength); @@ -3819,7 +3819,7 @@ static int Mod_BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, uns return bytes; } -static void Mod_Q1BSP_RoundUpToHullSize(dp_model_t *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs) +static void Mod_Q1BSP_RoundUpToHullSize(model_t *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs) { vec3_t size; const hull_t *hull; @@ -3852,9 +3852,9 @@ static void Mod_Q1BSP_RoundUpToHullSize(dp_model_t *cmodel, const vec3_t inmins, VectorAdd(inmins, hull->clip_size, outmaxs); } -void Mod_CollisionBIH_TraceLineAgainstSurfaces(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceLineAgainstSurfaces(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_2PSB_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend) { mod->brush.isbsp2 = true; mod->brush.isbsp2rmqe = true; // like bsp2 except leaf/node bounds are 16bit (unexpanded) @@ -3862,21 +3862,21 @@ void Mod_2PSB_Load(dp_model_t *mod, void *buffer, void *bufferend) Mod_Q1BSP_Load(mod, buffer, bufferend); } -void Mod_BSP2_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend) { mod->brush.isbsp2 = true; mod->modeldatatypestring = "Q1BSP2"; Mod_Q1BSP_Load(mod, buffer, bufferend); } -void Mod_HLBSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend) { mod->brush.ishlbsp = true; mod->modeldatatypestring = "HLBSP"; Mod_Q1BSP_Load(mod, buffer, bufferend); } -void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, k; sizebuf_t lumpsb[HEADER_LUMPS]; @@ -4014,7 +4014,7 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) mod->numskins = 1; if (loadmodel->brush.numsubmodels) - loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *)); + loadmodel->brush.submodels = (model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(model_t *)); // LadyHavoc: to clear the fog around the original quake submodel code, I // will explain: @@ -4812,7 +4812,7 @@ static void Mod_Q2BSP_LoadAreaPortals(sizebuf_t *sb) sb->readcount = sb->cursize; } -static void Mod_Q2BSP_FindSubmodelBrushRange_r(dp_model_t *mod, mnode_t *node, int *first, int *last) +static void Mod_Q2BSP_FindSubmodelBrushRange_r(model_t *mod, mnode_t *node, int *first, int *last) { int i; mleaf_t *leaf; @@ -4832,7 +4832,7 @@ static void Mod_Q2BSP_FindSubmodelBrushRange_r(dp_model_t *mod, mnode_t *node, i } } -static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +static void Mod_Q2BSP_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, k; sizebuf_t lumpsb[Q2HEADER_LUMPS]; @@ -4963,7 +4963,7 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) mod->numskins = 1; if (loadmodel->brush.numsubmodels) - loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *)); + loadmodel->brush.submodels = (model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(model_t *)); totalstylesurfaces = 0; totalstyles = 0; @@ -6641,7 +6641,7 @@ static void Mod_Q3BSP_LoadPVS(lump_t *l) memcpy(loadmodel->brush.data_pvsclusters, (unsigned char *)(in + 1), totalchains); } -static void Mod_Q3BSP_LightPoint(dp_model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) +static void Mod_Q3BSP_LightPoint(model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal) { int i, j, k, index[3]; float transformed[3], blend1, blend2, blend, stylescale = 1; @@ -6789,7 +6789,7 @@ static qbool Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t star } } -void Mod_CollisionBIH_TracePoint(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TracePoint(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { const bih_t *bih; const bih_leaf_t *leaf; @@ -6855,7 +6855,7 @@ void Mod_CollisionBIH_TracePoint(dp_model_t *model, const frameblend_t *frameble } } -static void Mod_CollisionBIH_TraceLineShared(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, const bih_t *bih) +static void Mod_CollisionBIH_TraceLineShared(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, const bih_t *bih) { const bih_leaf_t *leaf; const bih_node_t *node; @@ -6983,7 +6983,7 @@ static void Mod_CollisionBIH_TraceLineShared(dp_model_t *model, const frameblend } } -void Mod_CollisionBIH_TraceLine(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TraceLine(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { if (VectorCompare(start, end)) { @@ -6993,7 +6993,7 @@ void Mod_CollisionBIH_TraceLine(dp_model_t *model, const frameblend_t *frameblen Mod_CollisionBIH_TraceLineShared(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, &model->collision_bih); } -void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, colbrushf_t *thisbrush_start, colbrushf_t *thisbrush_end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TraceBrush(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, colbrushf_t *thisbrush_start, colbrushf_t *thisbrush_end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { const bih_t *bih; const bih_leaf_t *leaf; @@ -7138,7 +7138,7 @@ void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const frameblend_t *frameble } } -void Mod_CollisionBIH_TraceBox(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TraceBox(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { colboxbrushf_t thisbrush_start, thisbrush_end; vec3_t boxstartmins, boxstartmaxs, boxendmins, boxendmaxs; @@ -7168,7 +7168,7 @@ qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t star return trace.fraction == 1 || BoxesOverlap(trace.endpos, trace.endpos, acceptmins, acceptmaxs); } -void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TracePoint_Mesh(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { #if 0 // broken - needs to be modified to count front faces and backfaces to figure out if it is in solid @@ -7212,13 +7212,13 @@ int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, c #endif } -void Mod_CollisionBIH_TraceLineAgainstSurfaces(dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) +void Mod_CollisionBIH_TraceLineAgainstSurfaces(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask) { Mod_CollisionBIH_TraceLineShared(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, &model->render_bih); } -bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qbool userendersurfaces, bih_t *out) +bih_t *Mod_MakeCollisionBIH(model_t *model, qbool userendersurfaces, bih_t *out) { int j; int bihnumleafs; @@ -7426,7 +7426,7 @@ static void Mod_Q3BSP_RecursiveFindNumLeafs(mnode_t *node) loadmodel->brush.num_leafs = numleafs; } -static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +static void Mod_Q3BSP_Load(model_t *mod, void *buffer, void *bufferend) { int i, j, lumps; q3dheader_t *header; @@ -7562,7 +7562,7 @@ static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) Mod_Q3BSP_RecursiveFindNumLeafs(loadmodel->brush.data_nodes); if (loadmodel->brush.numsubmodels) - loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *)); + loadmodel->brush.submodels = (model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(model_t *)); mod = loadmodel; for (i = 0;i < loadmodel->brush.numsubmodels;i++) @@ -7693,7 +7693,7 @@ static void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend) Con_DPrintf("Stats for q3bsp model \"%s\": %i faces, %i nodes, %i leafs, %i clusters, %i clusterportals, mesh: %i vertices, %i triangles, %i surfaces\n", loadmodel->name, loadmodel->num_surfaces, loadmodel->brush.num_nodes, loadmodel->brush.num_leafs, mod->brush.num_pvsclusters, loadmodel->brush.num_portals, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->num_surfaces); } -void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend) { int i = LittleLong(((int *)buffer)[1]); if (i == Q3BSPVERSION || i == Q3BSPVERSION_IG || i == Q3BSPVERSION_LIVE) @@ -7704,7 +7704,7 @@ void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend) Host_Error("Mod_IBSP_Load: unknown/unsupported version %i", i); } -void Mod_MAP_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend) { Host_Error("Mod_MAP_Load: not yet implemented"); } @@ -7722,7 +7722,7 @@ objvertex_t; static unsigned char nobsp_pvs[1] = {1}; -void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend) { const char *textbase = (char *)buffer, *text = textbase; char *s; @@ -8135,8 +8135,8 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend) // allocate storage for final mesh data loadmodel->num_textures = numtextures * loadmodel->numskins; loadmodel->num_texturesperskin = numtextures; - data = (unsigned char *)Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * sizeof(int) + loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t) + numtriangles * sizeof(int[3]) + (numvertices <= 65536 ? numtriangles * sizeof(unsigned short[3]) : 0) + numvertices * sizeof(float[14]) + loadmodel->brush.numsubmodels * sizeof(dp_model_t *)); - loadmodel->brush.submodels = (dp_model_t **)data;data += loadmodel->brush.numsubmodels * sizeof(dp_model_t *); + data = (unsigned char *)Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * sizeof(int) + loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t) + numtriangles * sizeof(int[3]) + (numvertices <= 65536 ? numtriangles * sizeof(unsigned short[3]) : 0) + numvertices * sizeof(float[14]) + loadmodel->brush.numsubmodels * sizeof(model_t *)); + loadmodel->brush.submodels = (model_t **)data;data += loadmodel->brush.numsubmodels * sizeof(model_t *); loadmodel->sortedmodelsurfaces = (int *)data;data += loadmodel->num_surfaces * sizeof(int); loadmodel->data_textures = (texture_t *)data;data += loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t); loadmodel->surfmesh.num_vertices = numvertices; @@ -8211,7 +8211,7 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->brush.supportwateralpha = true; if (loadmodel->brush.numsubmodels) - loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *)); + loadmodel->brush.submodels = (model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(model_t *)); mod = loadmodel; for (i = 0;i < loadmodel->brush.numsubmodels;i++) diff --git a/model_shared.c b/model_shared.c index 91ba91e0..9a269a62 100644 --- a/model_shared.c +++ b/model_shared.c @@ -39,7 +39,7 @@ cvar_t mod_generatelightmaps_lightmapradius = {CF_CLIENT | CF_ARCHIVE, "mod_gene cvar_t mod_generatelightmaps_vertexradius = {CF_CLIENT | CF_ARCHIVE, "mod_generatelightmaps_vertexradius", "16", "sampling area around each vertex"}; cvar_t mod_generatelightmaps_gridradius = {CF_CLIENT | CF_ARCHIVE, "mod_generatelightmaps_gridradius", "64", "sampling area around each lightgrid cell center"}; -dp_model_t *loadmodel; +model_t *loadmodel; // Supported model formats static modloader_t loader[] = @@ -85,16 +85,16 @@ static void mod_start(void) { int i, count; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; SCR_PushLoadingScreen("Loading models", 1.0); count = 0; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') if (mod->used) ++count; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') if (mod->used) { SCR_PushLoadingScreen(mod->name, 1.0 / count); @@ -108,10 +108,10 @@ static void mod_shutdown(void) { int i; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && (mod->loaded || mod->mempool)) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && (mod->loaded || mod->mempool)) Mod_UnloadModel(mod); Mod_FreeQ3Shaders(); @@ -123,11 +123,11 @@ static void mod_newmap(void) msurface_t *surface; int i, j, k, l, surfacenum, ssize, tsize; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; for (i = 0;i < nummodels;i++) { - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool) { for (j = 0;j < mod->num_textures && mod->data_textures;j++) { @@ -149,7 +149,7 @@ static void mod_newmap(void) for (i = 0;i < nummodels;i++) { - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_surfaces) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_surfaces) { for (surfacenum = 0, surface = mod->data_surfaces;surfacenum < mod->num_surfaces;surfacenum++, surface++) { @@ -177,7 +177,7 @@ static void Mod_GenerateLightmaps_f(cmd_state_t *cmd); void Mod_Init (void) { mod_mempool = Mem_AllocPool("modelinfo", 0, NULL); - Mem_ExpandableArray_NewArray(&models, mod_mempool, sizeof(dp_model_t), 16); + Mem_ExpandableArray_NewArray(&models, mod_mempool, sizeof(model_t), 16); Mod_BrushInit(); Mod_AliasInit(); @@ -207,11 +207,11 @@ void Mod_RenderInit(void) R_RegisterModule("Models", mod_start, mod_shutdown, mod_newmap, NULL, NULL); } -void Mod_UnloadModel (dp_model_t *mod) +void Mod_UnloadModel (model_t *mod) { char name[MAX_QPATH]; qbool used; - dp_model_t *parentmodel; + model_t *parentmodel; if (developer_loading.integer) Con_Printf("unloading model %s\n", mod->name); @@ -243,7 +243,7 @@ void Mod_UnloadModel (dp_model_t *mod) R_FreeTexturePool(&mod->texturepool); Mem_FreePool(&mod->mempool); // clear the struct to make it available - memset(mod, 0, sizeof(dp_model_t)); + memset(mod, 0, sizeof(model_t)); // restore the fields we want to preserve strlcpy(mod->name, name, sizeof(mod->name)); mod->brush.parentmodel = parentmodel; @@ -334,7 +334,7 @@ static int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_pars static void Mod_FrameGroupify_ParseGroups_Store (unsigned int i, int start, int len, float fps, qbool loop, const char *name, void *pass) { - dp_model_t *mod = (dp_model_t *) pass; + model_t *mod = (model_t *) pass; animscene_t *anim = &mod->animscenes[i]; if(name) strlcpy(anim->name, name, sizeof(anim[i].name)); @@ -347,7 +347,7 @@ static void Mod_FrameGroupify_ParseGroups_Store (unsigned int i, int start, int //Con_Printf("frame group %d is %d %d %f %d\n", i, start, len, fps, loop); } -static void Mod_FrameGroupify(dp_model_t *mod, const char *buf) +static void Mod_FrameGroupify(model_t *mod, const char *buf) { unsigned int cnt; @@ -368,7 +368,7 @@ static void Mod_FrameGroupify(dp_model_t *mod, const char *buf) Mod_FrameGroupify_ParseGroups(buf, Mod_FrameGroupify_ParseGroups_Store, mod); } -static void Mod_FindPotentialDeforms(dp_model_t *mod) +static void Mod_FindPotentialDeforms(model_t *mod) { int i, j; texture_t *texture; @@ -402,7 +402,7 @@ Mod_LoadModel Loads a model ================== */ -dp_model_t *Mod_LoadModel(dp_model_t *mod, qbool crash, qbool checkdisk) +model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk) { unsigned int crc; void *buf; @@ -563,9 +563,9 @@ void Mod_ClearUsed(void) { int i; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0]) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0]) mod->used = false; } @@ -573,10 +573,10 @@ void Mod_PurgeUnused(void) { int i; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; for (i = 0;i < nummodels;i++) { - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !mod->used) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !mod->used) { Mod_UnloadModel(mod); Mem_ExpandableArray_FreeRecord(&models, mod); @@ -590,11 +590,11 @@ Mod_FindName ================== */ -dp_model_t *Mod_FindName(const char *name, const char *parentname) +model_t *Mod_FindName(const char *name, const char *parentname) { int i; int nummodels; - dp_model_t *mod; + model_t *mod; if (!parentname) parentname = ""; @@ -607,7 +607,7 @@ dp_model_t *Mod_FindName(const char *name, const char *parentname) // search the currently loaded models for (i = 0;i < nummodels;i++) { - if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !strcmp(mod->name, name) && ((!mod->brush.parentmodel && !parentname[0]) || (mod->brush.parentmodel && parentname[0] && !strcmp(mod->brush.parentmodel->name, parentname)))) + if ((mod = (model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !strcmp(mod->name, name) && ((!mod->brush.parentmodel && !parentname[0]) || (mod->brush.parentmodel && parentname[0] && !strcmp(mod->brush.parentmodel->name, parentname)))) { mod->used = true; return mod; @@ -615,7 +615,7 @@ dp_model_t *Mod_FindName(const char *name, const char *parentname) } // no match found, create a new one - mod = (dp_model_t *) Mem_ExpandableArray_AllocRecord(&models); + mod = (model_t *) Mem_ExpandableArray_AllocRecord(&models); strlcpy(mod->name, name, sizeof(mod->name)); if (parentname[0]) mod->brush.parentmodel = Mod_FindName(parentname, NULL); @@ -635,9 +635,9 @@ Mod_ForName Loads in a model for the given name ================== */ -dp_model_t *Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname) +model_t *Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname) { - dp_model_t *model; + model_t *model; // FIXME: So we don't crash if a server is started early. if(!vid_opened) @@ -660,15 +660,15 @@ void Mod_Reload(void) { int i, count; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; SCR_PushLoadingScreen("Reloading models", 1.0); count = 0; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used) + if ((mod = (model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used) ++count; for (i = 0;i < nummodels;i++) - if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used) + if ((mod = (model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used) { SCR_PushLoadingScreen(mod->name, 1.0 / count); Mod_LoadModel(mod, true, true); @@ -691,12 +691,12 @@ static void Mod_Print_f(cmd_state_t *cmd) { int i; int nummodels = (int)Mem_ExpandableArray_IndexRange(&models); - dp_model_t *mod; + model_t *mod; Con_Print("Loaded models:\n"); for (i = 0;i < nummodels;i++) { - if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') + if ((mod = (model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*') { if (mod->brush.numsubmodels) Con_Printf("%4iK %s (%i submodels)\n", mod->mempool ? (int)((mod->mempool->totalsize + 1023) / 1024) : 0, mod->name, mod->brush.numsubmodels); @@ -1185,7 +1185,7 @@ void Mod_ShadowMesh_Free(shadowmesh_t *mesh) Mem_Free(mesh); } -void Mod_CreateCollisionMesh(dp_model_t *mod) +void Mod_CreateCollisionMesh(model_t *mod) { int k, numcollisionmeshtriangles; qbool usesinglecollisionmesh = false; @@ -1291,7 +1291,7 @@ static void Mod_ConstructTerrainPatchFromBGRA(const unsigned char *imagepixels, #endif #if 0 -void Mod_Terrain_SurfaceRecurseChunk(dp_model_t *model, int stepsize, int x, int y) +void Mod_Terrain_SurfaceRecurseChunk(model_t *model, int stepsize, int x, int y) { float mins[3]; float maxs[3]; @@ -1362,7 +1362,7 @@ void Mod_Terrain_SurfaceRecurseChunk(dp_model_t *model, int stepsize, int x, int // TODO: emit skirt vertices } -void Mod_Terrain_UpdateSurfacesForViewOrigin(dp_model_t *model) +void Mod_Terrain_UpdateSurfacesForViewOrigin(model_t *model) { for (y = 0;y < model->terrain.size[1];y += model->terrain. Mod_Terrain_SurfaceRecurseChunk(model, model->terrain.maxstepsize, x, y); @@ -2881,7 +2881,7 @@ void Mod_VertexRangeFromElements(int numelements, const int *elements, int *firs *lastvertexpointer = lastvertex; } -void Mod_MakeSortedSurfaces(dp_model_t *mod) +void Mod_MakeSortedSurfaces(model_t *mod) { // make an optimal set of texture-sorted batches to draw... int j, t; @@ -2987,7 +2987,7 @@ void Mod_BuildVBOs(void) } extern cvar_t mod_obj_orientation; -static void Mod_Decompile_OBJ(dp_model_t *model, const char *filename, const char *mtlfilename, const char *originalfilename) +static void Mod_Decompile_OBJ(model_t *model, const char *filename, const char *mtlfilename, const char *originalfilename) { int submodelindex, vertexindex, surfaceindex, triangleindex, textureindex, countvertices = 0, countsurfaces = 0, countfaces = 0, counttextures = 0; int a, b, c; @@ -3001,7 +3001,7 @@ static void Mod_Decompile_OBJ(dp_model_t *model, const char *filename, const cha const msurface_t *surface; const int maxtextures = 256; char *texturenames = (char *) Z_Malloc(maxtextures * MAX_QPATH); - dp_model_t *submodel; + model_t *submodel; // construct the mtllib file l = dpsnprintf(outbuffer + outbufferpos, outbuffermax - outbufferpos, "# mtllib for %s exported by darkplaces engine\n", originalfilename); @@ -3108,7 +3108,7 @@ static void Mod_Decompile_OBJ(dp_model_t *model, const char *filename, const cha Con_Printf("Wrote %s (%i bytes, %i vertices, %i faces, %i surfaces with %i distinct textures)\n", filename, (int)outbufferpos, countvertices, countfaces, countsurfaces, counttextures); } -static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int firstpose, int numposes, qbool writetriangles) +static void Mod_Decompile_SMD(model_t *model, const char *filename, int firstpose, int numposes, qbool writetriangles) { int countnodes = 0, counttriangles = 0, countframes = 0; int surfaceindex; @@ -3275,7 +3275,7 @@ decompiles a model to editable files static void Mod_Decompile_f(cmd_state_t *cmd) { int i, j, k, l, first, count; - dp_model_t *mod; + model_t *mod; char inname[MAX_QPATH]; char outname[MAX_QPATH]; char mtlname[MAX_QPATH]; @@ -3536,7 +3536,7 @@ static lightmaplight_t *mod_generatelightmaps_lightinfo; extern cvar_t r_shadow_lightattenuationdividebias; extern cvar_t r_shadow_lightattenuationlinearscale; -static void Mod_GenerateLightmaps_LightPoint(dp_model_t *model, const vec3_t pos, vec3_t ambient, vec3_t diffuse, vec3_t lightdir) +static void Mod_GenerateLightmaps_LightPoint(model_t *model, const vec3_t pos, vec3_t ambient, vec3_t diffuse, vec3_t lightdir) { int i; int index; @@ -3605,7 +3605,7 @@ static void Mod_GenerateLightmaps_LightPoint(dp_model_t *model, const vec3_t pos VectorCopy(dir, lightdir); } -static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP_InsertSurfaces(const dp_model_t *model, svbsp_t *svbsp, const float *mins, const float *maxs) +static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP_InsertSurfaces(const model_t *model, svbsp_t *svbsp, const float *mins, const float *maxs) { int surfaceindex; int triangleindex; @@ -3630,7 +3630,7 @@ static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP_InsertSurfaces(const } } -static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP(dp_model_t *model, lightmaplight_t *lightinfo) +static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP(model_t *model, lightmaplight_t *lightinfo) { int maxnodes = 1<<14; svbsp_node_t *nodes; @@ -3669,7 +3669,7 @@ static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP(dp_model_t *model, l Mem_Free(nodes); } -static void Mod_GenerateLightmaps_CreateLights(dp_model_t *model) +static void Mod_GenerateLightmaps_CreateLights(model_t *model) { int index; int result; @@ -3708,7 +3708,7 @@ static void Mod_GenerateLightmaps_CreateLights(dp_model_t *model) } } -static void Mod_GenerateLightmaps_DestroyLights(dp_model_t *model) +static void Mod_GenerateLightmaps_DestroyLights(model_t *model) { int i; if (mod_generatelightmaps_lightinfo) @@ -3871,7 +3871,7 @@ static void Mod_GenerateLightmaps_GridSample(const float *pos, q3dlightgrid_t *s else {s->diffusepitch = (unsigned char)(acos(dir[2]) * (127.5f/M_PI));s->diffuseyaw = (unsigned char)(atan2(dir[1], dir[0]) * (127.5f/M_PI));} } -static void Mod_GenerateLightmaps_InitSampleOffsets(dp_model_t *model) +static void Mod_GenerateLightmaps_InitSampleOffsets(model_t *model) { float radius[3]; float temp[3]; @@ -3893,7 +3893,7 @@ static void Mod_GenerateLightmaps_InitSampleOffsets(dp_model_t *model) } } -static void Mod_GenerateLightmaps_DestroyLightmaps(dp_model_t *model) +static void Mod_GenerateLightmaps_DestroyLightmaps(model_t *model) { msurface_t *surface; int surfaceindex; @@ -3922,7 +3922,7 @@ static void Mod_GenerateLightmaps_DestroyLightmaps(dp_model_t *model) } } -static void Mod_GenerateLightmaps_UnweldTriangles(dp_model_t *model) +static void Mod_GenerateLightmaps_UnweldTriangles(model_t *model) { msurface_t *surface; int surfaceindex; @@ -4025,7 +4025,7 @@ static void Mod_GenerateLightmaps_UnweldTriangles(dp_model_t *model) model->brush.submodels[i]->surfmesh = model->surfmesh; } -static void Mod_GenerateLightmaps_CreateTriangleInformation(dp_model_t *model) +static void Mod_GenerateLightmaps_CreateTriangleInformation(model_t *model) { msurface_t *surface; int surfaceindex; @@ -4067,7 +4067,7 @@ static void Mod_GenerateLightmaps_CreateTriangleInformation(dp_model_t *model) } } -static void Mod_GenerateLightmaps_DestroyTriangleInformation(dp_model_t *model) +static void Mod_GenerateLightmaps_DestroyTriangleInformation(model_t *model) { if (mod_generatelightmaps_lightmaptriangles) Mem_Free(mod_generatelightmaps_lightmaptriangles); @@ -4076,7 +4076,7 @@ static void Mod_GenerateLightmaps_DestroyTriangleInformation(dp_model_t *model) float lmaxis[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; -static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model) +static void Mod_GenerateLightmaps_CreateLightmaps(model_t *model) { msurface_t *surface; int surfaceindex; @@ -4330,14 +4330,14 @@ static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model) } } -static void Mod_GenerateLightmaps_UpdateVertexColors(dp_model_t *model) +static void Mod_GenerateLightmaps_UpdateVertexColors(model_t *model) { int i; for (i = 0;i < model->surfmesh.num_vertices;i++) Mod_GenerateLightmaps_VertexSample(model->surfmesh.data_vertex3f + 3*i, model->surfmesh.data_normal3f + 3*i, model->surfmesh.data_lightmapcolor4f + 4*i); } -static void Mod_GenerateLightmaps_UpdateLightGrid(dp_model_t *model) +static void Mod_GenerateLightmaps_UpdateLightGrid(model_t *model) { int x; int y; @@ -4360,10 +4360,10 @@ static void Mod_GenerateLightmaps_UpdateLightGrid(dp_model_t *model) } extern cvar_t mod_q3bsp_nolightmaps; -static void Mod_GenerateLightmaps(dp_model_t *model) +static void Mod_GenerateLightmaps(model_t *model) { //lightmaptriangle_t *lightmaptriangles = Mem_Alloc(model->mempool, model->surfmesh.num_triangles * sizeof(lightmaptriangle_t)); - dp_model_t *oldloadmodel = loadmodel; + model_t *oldloadmodel = loadmodel; loadmodel = model; Mod_GenerateLightmaps_InitSampleOffsets(model); @@ -4396,7 +4396,7 @@ static void Mod_GenerateLightmaps_f(cmd_state_t *cmd) Mod_GenerateLightmaps(cl.worldmodel); } -void Mod_Mesh_Create(dp_model_t *mod, const char *name) +void Mod_Mesh_Create(model_t *mod, const char *name) { memset(mod, 0, sizeof(*mod)); strlcpy(mod->name, name, sizeof(mod->name)); @@ -4411,14 +4411,14 @@ void Mod_Mesh_Create(dp_model_t *mod, const char *name) mod->DrawLight = R_Mod_DrawLight; } -void Mod_Mesh_Destroy(dp_model_t *mod) +void Mod_Mesh_Destroy(model_t *mod) { Mod_UnloadModel(mod); } // resets the mesh model to have no geometry to render, ready for a new frame - // the mesh will be prepared for rendering later using Mod_Mesh_Finalize -void Mod_Mesh_Reset(dp_model_t *mod) +void Mod_Mesh_Reset(model_t *mod) { mod->num_surfaces = 0; mod->surfmesh.num_vertices = 0; @@ -4428,7 +4428,7 @@ void Mod_Mesh_Reset(dp_model_t *mod) mod->DrawAddWaterPlanes = NULL; // will be set if a texture needs it } -texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags) +texture_t *Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags) { int i; texture_t *t; @@ -4480,7 +4480,7 @@ texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdra return t; } -msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qbool batchwithprevioussurface) +msurface_t *Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface) { msurface_t *surf; // batch if possible; primarily useful for UI rendering where bounding boxes don't matter @@ -4506,7 +4506,7 @@ msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qbool batchwith return surf; } -int Mod_Mesh_IndexForVertex(dp_model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a) +int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a) { int hashindex, h, vnum, mask; surfmesh_t *mesh = &mod->surfmesh; @@ -4585,7 +4585,7 @@ int Mod_Mesh_IndexForVertex(dp_model_t *mod, msurface_t *surf, float x, float y, return vnum; } -void Mod_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int e2) +void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2) { surfmesh_t *mesh = &mod->surfmesh; if (mesh->max_triangles == mesh->num_triangles) @@ -4604,7 +4604,7 @@ void Mod_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int surf->num_triangles++; } -static void Mod_Mesh_MakeSortedSurfaces(dp_model_t *mod) +static void Mod_Mesh_MakeSortedSurfaces(model_t *mod) { int i, j; texture_t *tex; @@ -4636,7 +4636,7 @@ static void Mod_Mesh_MakeSortedSurfaces(dp_model_t *mod) } } -static void Mod_Mesh_ComputeBounds(dp_model_t *mod) +static void Mod_Mesh_ComputeBounds(model_t *mod) { int i; vec_t x2a, x2b, y2a, y2b, z2a, z2b, x2, y2, z2, yawradius, rotatedradius; @@ -4692,7 +4692,7 @@ static void Mod_Mesh_ComputeBounds(dp_model_t *mod) } } -void Mod_Mesh_Validate(dp_model_t *mod) +void Mod_Mesh_Validate(model_t *mod) { int i; qbool warned = false; @@ -4716,7 +4716,7 @@ void Mod_Mesh_Validate(dp_model_t *mod) } } -static void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod) +static void Mod_Mesh_UploadDynamicBuffers(model_t *mod) { mod->surfmesh.data_element3s_indexbuffer = mod->surfmesh.data_element3s ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(short[3]), mod->surfmesh.data_element3s, R_BUFFERDATA_INDEX16, &mod->surfmesh.data_element3s_bufferoffset) : NULL; mod->surfmesh.data_element3i_indexbuffer = mod->surfmesh.data_element3i ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(int[3]), mod->surfmesh.data_element3i, R_BUFFERDATA_INDEX32, &mod->surfmesh.data_element3i_bufferoffset) : NULL; @@ -4731,7 +4731,7 @@ static void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod) mod->surfmesh.data_skeletalweight4ub_vertexbuffer = mod->surfmesh.data_skeletalweight4ub ? R_BufferData_Store(mod->surfmesh.num_vertices * sizeof(unsigned char[4]), mod->surfmesh.data_skeletalweight4ub, R_BUFFERDATA_VERTEX, &mod->surfmesh.data_skeletalweight4ub_bufferoffset) : NULL; } -void Mod_Mesh_Finalize(dp_model_t *mod) +void Mod_Mesh_Finalize(model_t *mod) { if (gl_paranoid.integer) Mod_Mesh_Validate(mod); diff --git a/model_shared.h b/model_shared.h index 8bbd6921..0e477789 100644 --- a/model_shared.h +++ b/model_shared.h @@ -541,12 +541,12 @@ typedef struct model_s qbool nolerp; } -dp_model_t; +model_t; //============================================================================ // model loading -extern dp_model_t *loadmodel; +extern model_t *loadmodel; extern unsigned char *mod_base; typedef struct modloader_s @@ -554,7 +554,7 @@ typedef struct modloader_s const char *extension; const char *header; size_t headersize; // The header might not be NULL terminated - void (*Load)(dp_model_t *, void *, void *); + void (*Load)(model_t *, void *, void *); } modloader_t; // sky/water subdivision @@ -577,16 +577,16 @@ extern struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces; void Mod_Init (void); void Mod_Reload (void); -dp_model_t *Mod_LoadModel(dp_model_t *mod, qbool crash, qbool checkdisk); -dp_model_t *Mod_FindName (const char *name, const char *parentname); -dp_model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname); -void Mod_UnloadModel (dp_model_t *mod); +model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk); +model_t *Mod_FindName (const char *name, const char *parentname); +model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname); +void Mod_UnloadModel (model_t *mod); void Mod_ClearUsed(void); void Mod_PurgeUnused(void); -void Mod_RemoveStaleWorldModels(dp_model_t *skip); // only used during loading! +void Mod_RemoveStaleWorldModels(model_t *skip); // only used during loading! -extern dp_model_t *loadmodel; +extern model_t *loadmodel; extern char loadname[32]; // for hunk tags int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices); @@ -595,7 +595,7 @@ void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int nu qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline); void Mod_AllocSurfMesh(struct mempool_s *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors); -void Mod_MakeSortedSurfaces(dp_model_t *mod); +void Mod_MakeSortedSurfaces(model_t *mod); // called specially by brush model loaders before generating submodels // automatically called after model loader returns @@ -609,7 +609,7 @@ shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *firstmesh, qbool createvbo); void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius); void Mod_ShadowMesh_Free(shadowmesh_t *mesh); -void Mod_CreateCollisionMesh(dp_model_t *mod); +void Mod_CreateCollisionMesh(model_t *mod); void Mod_FreeQ3Shaders(void); void Mod_LoadQ3Shaders(void); @@ -693,34 +693,34 @@ void R_Mod_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t rel void R_Mod_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs); // dynamic mesh building (every frame) for debugging and other uses -void Mod_Mesh_Create(dp_model_t *mod, const char *name); -void Mod_Mesh_Destroy(dp_model_t *mod); -void Mod_Mesh_Reset(dp_model_t *mod); -texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags); -msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qbool batchwithprevioussurface); -int Mod_Mesh_IndexForVertex(dp_model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a); -void Mod_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int e2); -void Mod_Mesh_Validate(dp_model_t *mod); -void Mod_Mesh_Finalize(dp_model_t *mod); +void Mod_Mesh_Create(model_t *mod, const char *name); +void Mod_Mesh_Destroy(model_t *mod); +void Mod_Mesh_Reset(model_t *mod); +texture_t *Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags); +msurface_t *Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface); +int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a); +void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2); +void Mod_Mesh_Validate(model_t *mod); +void Mod_Mesh_Finalize(model_t *mod); // Collision optimization using Bounding Interval Hierarchy -void Mod_CollisionBIH_TracePoint(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceLine(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceBox(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); -void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TracePoint(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceLine(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceBox(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TraceBrush(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); +void Mod_CollisionBIH_TracePoint_Mesh(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask); qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs); int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const vec3_t point); int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point); -bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qbool userendersurfaces, bih_t *out); +bih_t *Mod_MakeCollisionBIH(model_t *model, qbool userendersurfaces, bih_t *out); // alias models struct frameblend_s; struct skeleton_s; void Mod_AliasInit(void); -int Mod_Alias_GetTagMatrix(const dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix); -int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname); -int Mod_Alias_GetExtendedTagInfoForIndex(const dp_model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix); +int Mod_Alias_GetTagMatrix(const model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix); +int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname); +int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix); void Mod_Skeletal_FreeBuffers(void); @@ -728,22 +728,22 @@ void Mod_Skeletal_FreeBuffers(void); void Mod_SpriteInit(void); // loaders -void Mod_2PSB_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_BSP2_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_HLBSP_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_MAP_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend); -void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend); +void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend); +void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend); #endif // MODEL_SHARED_H diff --git a/model_sprite.c b/model_sprite.c index 0c121dc6..d21d88ff 100644 --- a/model_sprite.c +++ b/model_sprite.c @@ -263,7 +263,7 @@ static void Mod_Sprite_SharedSetup(const unsigned char *datapointer, int version loadmodel->radius2 = modelradius * modelradius; } -void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend) { int version; const unsigned char *datapointer; @@ -376,7 +376,7 @@ void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend) } -void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend) +void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend) { int i, version; qbool fullbright; diff --git a/portals.c b/portals.c index 7cd20a5d..e831466a 100644 --- a/portals.c +++ b/portals.c @@ -128,7 +128,7 @@ loc0: goto loc0; } -int Portal_CheckPolygon(dp_model_t *model, vec3_t eye, float *polypoints, int numpoints) +int Portal_CheckPolygon(model_t *model, vec3_t eye, float *polypoints, int numpoints) { int i, prev, returnvalue; mleaf_t *eyeleaf; @@ -205,7 +205,7 @@ int Portal_CheckPolygon(dp_model_t *model, vec3_t eye, float *polypoints, int nu }\ } -int Portal_CheckBox(dp_model_t *model, vec3_t eye, vec3_t a, vec3_t b) +int Portal_CheckBox(model_t *model, vec3_t eye, vec3_t a, vec3_t b) { if (eye[0] >= (a[0] - 1.0f) && eye[0] < (b[0] + 1.0f) && eye[1] >= (a[1] - 1.0f) && eye[1] < (b[1] + 1.0f) @@ -279,7 +279,7 @@ typedef struct portalrecursioninfo_s unsigned char *leafpvs; unsigned char *shadowtrispvs; unsigned char *lighttrispvs; - dp_model_t *model; + model_t *model; vec3_t eye; float *updateleafsmins; float *updateleafsmaxs; @@ -420,7 +420,7 @@ static void Portal_RecursiveFindLeafForFlow(portalrecursioninfo_t *info, mnode_t } } -void Portal_Visibility(dp_model_t *model, const vec3_t eye, int *leaflist, unsigned char *leafpvs, int *numleafspointer, int *surfacelist, unsigned char *surfacepvs, int *numsurfacespointer, const mplane_t *frustumplanes, int numfrustumplanes, int exact, const float *boxmins, const float *boxmaxs, float *updateleafsmins, float *updateleafsmaxs, unsigned char *shadowtrispvs, unsigned char *lighttrispvs, unsigned char *visitingleafpvs) +void Portal_Visibility(model_t *model, const vec3_t eye, int *leaflist, unsigned char *leafpvs, int *numleafspointer, int *surfacelist, unsigned char *surfacepvs, int *numsurfacespointer, const mplane_t *frustumplanes, int numfrustumplanes, int exact, const float *boxmins, const float *boxmaxs, float *updateleafsmins, float *updateleafsmaxs, unsigned char *shadowtrispvs, unsigned char *lighttrispvs, unsigned char *visitingleafpvs) { int i; portalrecursioninfo_t info; diff --git a/portals.h b/portals.h index fb613280..6715f796 100644 --- a/portals.h +++ b/portals.h @@ -2,9 +2,9 @@ #ifndef PORTALS_H #define PORTALS_H -int Portal_CheckPolygon(dp_model_t *model, vec3_t eye, float *polypoints, int numpoints); -int Portal_CheckBox(dp_model_t *model, vec3_t eye, vec3_t a, vec3_t b); -void Portal_Visibility(dp_model_t *model, const vec3_t eye, int *leaflist, unsigned char *leafpvs, int *numleafspointer, int *surfacelist, unsigned char *surfacepvs, int *numsurfacespointer, const mplane_t *frustumplanes, int numfrustumplanes, int exact, const float *boxmins, const float *boxmaxs, float *updateleafsmins, float *updateleafsmaxs, unsigned char *shadowtrispvs, unsigned char *lighttrispvs, unsigned char *visitingleafpvs); +int Portal_CheckPolygon(model_t *model, vec3_t eye, float *polypoints, int numpoints); +int Portal_CheckBox(model_t *model, vec3_t eye, vec3_t a, vec3_t b); +void Portal_Visibility(model_t *model, const vec3_t eye, int *leaflist, unsigned char *leafpvs, int *numleafspointer, int *surfacelist, unsigned char *surfacepvs, int *numsurfacespointer, const mplane_t *frustumplanes, int numfrustumplanes, int exact, const float *boxmins, const float *boxmaxs, float *updateleafsmins, float *updateleafsmaxs, unsigned char *shadowtrispvs, unsigned char *lighttrispvs, unsigned char *visitingleafpvs); #endif diff --git a/progsvm.h b/progsvm.h index 9ee619a0..1029c2e1 100644 --- a/progsvm.h +++ b/progsvm.h @@ -634,7 +634,7 @@ typedef struct prvm_prog_s // this tracks the last polygonbegin's choice of // CL_Mesh_CSQC or CL_Mesh_UI for this polygon - dp_model_t *polygonbegin_model; + model_t *polygonbegin_model; // indicates if polygonbegin should be interpreted as 2d // (clearscene sets this to false, renderscene sets this to true, drawpic // also sets this to true) @@ -917,8 +917,8 @@ void PRVM_Watchpoint(prvm_prog_t *prog, int stack_index, const char *text, etype void VM_Warning(prvm_prog_t *prog, const char *fmt, ...) DP_FUNC_PRINTF(2); void VM_GenerateFrameGroupBlend(prvm_prog_t *prog, framegroupblend_t *framegroupblend, const prvm_edict_t *ed); -void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const dp_model_t *model, double curtime); -void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const dp_model_t *edmodel, const frameblend_t *frameblend); +void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const model_t *model, double curtime); +void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const model_t *edmodel, const frameblend_t *frameblend); void VM_RemoveEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed); void PRVM_ExplicitCoverageEvent(prvm_prog_t *prog, mfunction_t *func, int statement); diff --git a/prvm_cmds.c b/prvm_cmds.c index 4782261c..66e97242 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -87,7 +87,7 @@ void VM_GenerateFrameGroupBlend(prvm_prog_t *prog, framegroupblend_t *framegroup // LadyHavoc: quite tempting to break apart this function to reuse the // duplicated code, but I suspect it is better for performance // this way -void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const dp_model_t *model, double curtime) +void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const model_t *model, double curtime) { int sub2, numframes, f, i, k; int isfirstframegroup = true; @@ -188,7 +188,7 @@ void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroup } } -void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const dp_model_t *edmodel, const frameblend_t *frameblend) +void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const model_t *edmodel, const frameblend_t *frameblend) { if (ed->priv.server->skeleton.model != edmodel) { @@ -6869,7 +6869,7 @@ finished: // surface querying -static dp_model_t *getmodel(prvm_prog_t *prog, prvm_edict_t *ed) +static model_t *getmodel(prvm_prog_t *prog, prvm_edict_t *ed) { if (prog == SVVM_prog) return SV_GetModelFromEdict(ed); @@ -6881,7 +6881,7 @@ static dp_model_t *getmodel(prvm_prog_t *prog, prvm_edict_t *ed) struct animatemodel_cache { - dp_model_t *model; + model_t *model; frameblend_t frameblend[MAX_FRAMEBLENDS]; skeleton_t *skeleton_p; skeleton_t skeleton; @@ -6907,7 +6907,7 @@ static void animatemodel_reset(prvm_prog_t *prog) Mem_Free(prog->animatemodel_cache); } -static void animatemodel(prvm_prog_t *prog, dp_model_t *model, prvm_edict_t *ed) +static void animatemodel(prvm_prog_t *prog, model_t *model, prvm_edict_t *ed) { skeleton_t *skeleton; int skeletonindex = -1; @@ -7005,7 +7005,7 @@ static void applytransform_forward_normal(prvm_prog_t *prog, const vec3_t in, pr VectorCopy(p, out); } -static void clippointtosurface(prvm_prog_t *prog, prvm_edict_t *ed, dp_model_t *model, msurface_t *surface, vec3_t p, vec3_t out) +static void clippointtosurface(prvm_prog_t *prog, prvm_edict_t *ed, model_t *model, msurface_t *surface, vec3_t p, vec3_t out) { int i, j, k; float *v[3], facenormal[3], edgenormal[3], sidenormal[3], temp[3], offsetdist, dist, bestdist; @@ -7042,7 +7042,7 @@ static void clippointtosurface(prvm_prog_t *prog, prvm_edict_t *ed, dp_model_t * } } -static msurface_t *getsurface(dp_model_t *model, int surfacenum) +static msurface_t *getsurface(model_t *model, int surfacenum) { if (surfacenum < 0 || surfacenum >= model->nummodelsurfaces) return NULL; @@ -7053,7 +7053,7 @@ static msurface_t *getsurface(dp_model_t *model, int surfacenum) //PF_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints = #434; void VM_getsurfacenumpoints(prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; msurface_t *surface; VM_SAFEPARMCOUNT(2, VM_getsurfacenumpoints); // return 0 if no such surface @@ -7070,7 +7070,7 @@ void VM_getsurfacenumpoints(prvm_prog_t *prog) void VM_getsurfacepoint(prvm_prog_t *prog) { prvm_edict_t *ed; - dp_model_t *model; + model_t *model; msurface_t *surface; int pointnum; vec3_t result; @@ -7098,7 +7098,7 @@ void VM_getsurfacepoint(prvm_prog_t *prog) void VM_getsurfacepointattribute(prvm_prog_t *prog) { prvm_edict_t *ed; - dp_model_t *model; + model_t *model; msurface_t *surface; int pointnum; int attributetype; @@ -7168,7 +7168,7 @@ void VM_getsurfacepointattribute(prvm_prog_t *prog) //PF_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal = #436; void VM_getsurfacenormal(prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; msurface_t *surface; vec3_t normal; vec3_t result; @@ -7187,7 +7187,7 @@ void VM_getsurfacenormal(prvm_prog_t *prog) //PF_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture = #437; void VM_getsurfacetexture(prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; msurface_t *surface; VM_SAFEPARMCOUNT(2, VM_getsurfacetexture); PRVM_G_INT(OFS_RETURN) = OFS_NULL; @@ -7202,7 +7202,7 @@ void VM_getsurfacenearpoint(prvm_prog_t *prog) vec3_t clipped, p; vec_t dist, bestdist; prvm_edict_t *ed; - dp_model_t *model; + model_t *model; msurface_t *surface; vec3_t point; VM_SAFEPARMCOUNT(2, VM_getsurfacenearpoint); @@ -7249,7 +7249,7 @@ void VM_getsurfacenearpoint(prvm_prog_t *prog) void VM_getsurfaceclippedpoint(prvm_prog_t *prog) { prvm_edict_t *ed; - dp_model_t *model; + model_t *model; msurface_t *surface; vec3_t p, out, inp; VM_SAFEPARMCOUNT(3, VM_getsurfaceclippedpoint); @@ -7267,7 +7267,7 @@ void VM_getsurfaceclippedpoint(prvm_prog_t *prog) //PF_getsurfacenumtriangles, // #??? float(entity e, float s) getsurfacenumtriangles = #???; void VM_getsurfacenumtriangles(prvm_prog_t *prog) { - dp_model_t *model; + model_t *model; msurface_t *surface; VM_SAFEPARMCOUNT(2, VM_getsurfacenumtriangles); // return 0 if no such surface @@ -7284,7 +7284,7 @@ void VM_getsurfacetriangle(prvm_prog_t *prog) { const vec3_t d = {-1, -1, -1}; prvm_edict_t *ed; - dp_model_t *model; + model_t *model; msurface_t *surface; int trinum; VM_SAFEPARMCOUNT(3, VM_getsurfacetriangle); diff --git a/r_lightning.c b/r_lightning.c index 3d2d6ffe..9a73a50f 100644 --- a/r_lightning.c +++ b/r_lightning.c @@ -105,7 +105,7 @@ void R_LightningBeams_Init(void) R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap, NULL, NULL); } -static void CL_Beam_AddQuad(dp_model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2) +static void CL_Beam_AddQuad(model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2) { int e0, e1, e2, e3; vec3_t n; @@ -132,7 +132,7 @@ void CL_Beam_AddPolygons(const beam_t *b) vec_t beamscroll = r_refdef.scene.time * -r_lightningbeam_scroll.value; vec_t beamrepeatscale = 1.0f / r_lightningbeam_repeatdistance.value; float length, t1, t2; - dp_model_t *mod; + model_t *mod; msurface_t *surf; if (r_lightningbeam_qmbtexture.integer && cl_beams_externaltexture.currentskinframe == NULL) diff --git a/r_shadow.c b/r_shadow.c index cd1151fa..67cf27ce 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -3052,7 +3052,7 @@ void R_RTLight_Compile(rtlight_t *rtlight) int numsurfaces, numleafs, numleafpvsbytes, numshadowtrispvsbytes, numlighttrispvsbytes; int lighttris, shadowtris; entity_render_t *ent = r_refdef.scene.worldentity; - dp_model_t *model = r_refdef.scene.worldmodel; + model_t *model = r_refdef.scene.worldmodel; unsigned char *data; // compile the light @@ -3409,7 +3409,7 @@ static void R_Shadow_DrawWorldLight(int numsurfaces, int *surfacelist, const uns static void R_Shadow_DrawEntityLight(entity_render_t *ent) { - dp_model_t *model = ent->model; + model_t *model = ent->model; if (!model->DrawLight) return; @@ -3580,7 +3580,7 @@ static void R_Shadow_PrepareLight(rtlight_t *rtlight) // add dynamic entities that are lit by the light for (i = 0; i < r_refdef.scene.numentities; i++) { - dp_model_t *model; + model_t *model; entity_render_t *ent = r_refdef.scene.entities[i]; vec3_t org; if (!BoxesOverlap(ent->mins, ent->maxs, rtlight->cached_cullmins, rtlight->cached_cullmaxs)) diff --git a/r_sprites.c b/r_sprites.c index 4118a5b7..9bf13fb9 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -208,7 +208,7 @@ static float spritetexcoord2f[4*2] = {0, 1, 0, 0, 1, 0, 1, 1}; static void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist) { int i; - dp_model_t *model = ent->model; + model_t *model = ent->model; vec3_t left, up, org, mforward, mleft, mup, middle; float scale, dx, dy, hud_vs_screen; int edge = 0; diff --git a/r_stats.c b/r_stats.c index e490e263..6dfc7938 100644 --- a/r_stats.c +++ b/r_stats.c @@ -239,7 +239,7 @@ void R_TimeReport_BeginFrame(void) } } -static int R_CountLeafTriangles(const dp_model_t *model, const mleaf_t *leaf) +static int R_CountLeafTriangles(const model_t *model, const mleaf_t *leaf) { int i, triangles = 0; for (i = 0;i < leaf->numleafsurfaces;i++) diff --git a/render.h b/render.h index 0a9213e3..db5f9e85 100644 --- a/render.h +++ b/render.h @@ -354,7 +354,7 @@ typedef struct r_refdef_scene_s { entity_render_t *worldentity; // same as worldentity->model - dp_model_t *worldmodel; + model_t *worldmodel; // renderable entities (excluding world) entity_render_t **entities; diff --git a/server.h b/server.h index 0df1b40a..f494a632 100644 --- a/server.h +++ b/server.h @@ -540,8 +540,8 @@ int SV_SoundIndex(const char *s, int precachemode); int SV_ParticleEffectIndex(const char *name); -dp_model_t *SV_GetModelByIndex(int modelindex); -dp_model_t *SV_GetModelFromEdict(prvm_edict_t *ed); +model_t *SV_GetModelByIndex(int modelindex); +model_t *SV_GetModelFromEdict(prvm_edict_t *ed); void SV_SetIdealPitch (void); diff --git a/snd_main.c b/snd_main.c index aab18140..3e8d52a8 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1226,7 +1226,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qbool isstatic, sfx_t *sfx) } else if (cl.entities[ch->entnum].state_current.active) { - dp_model_t *model; + model_t *model; //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]); model = CL_GetModelByIndex(cl.entities[ch->entnum].state_current.modelindex); if (model && model->soundfromcenter) diff --git a/sv_ccmds.c b/sv_ccmds.c index 125ea582..613ae309 100644 --- a/sv_ccmds.c +++ b/sv_ccmds.c @@ -1278,7 +1278,7 @@ static void SV_Viewmodel_f(cmd_state_t *cmd) { prvm_prog_t *prog = SVVM_prog; prvm_edict_t *e; - dp_model_t *m; + model_t *m; if (!sv.active) return; @@ -1307,7 +1307,7 @@ static void SV_Viewframe_f(cmd_state_t *cmd) prvm_prog_t *prog = SVVM_prog; prvm_edict_t *e; int f; - dp_model_t *m; + model_t *m; if (!sv.active) return; @@ -1325,7 +1325,7 @@ static void SV_Viewframe_f(cmd_state_t *cmd) } } -static void PrintFrameName (dp_model_t *m, int frame) +static void PrintFrameName (model_t *m, int frame) { if (m->animscenes) Con_Printf("frame %i: %s\n", frame, m->animscenes[frame].name); @@ -1342,7 +1342,7 @@ static void SV_Viewnext_f(cmd_state_t *cmd) { prvm_prog_t *prog = SVVM_prog; prvm_edict_t *e; - dp_model_t *m; + model_t *m; if (!sv.active) return; @@ -1369,7 +1369,7 @@ static void SV_Viewprev_f(cmd_state_t *cmd) { prvm_prog_t *prog = SVVM_prog; prvm_edict_t *e; - dp_model_t *m; + model_t *m; if (!sv.active) return; diff --git a/sv_ents5.c b/sv_ents5.c index 98be9b36..4ede6d3d 100644 --- a/sv_ents5.c +++ b/sv_ents5.c @@ -17,7 +17,7 @@ static double anim_reducetime(double t, double frameduration, double maxtime) } // see VM_SV_frameduration -static double anim_frameduration(dp_model_t *model, int framenum) +static double anim_frameduration(model_t *model, int framenum) { if (!model || !model->animscenes || framenum < 0 || framenum >= model->numframes) return 0; @@ -179,7 +179,7 @@ void EntityState5_WriteUpdate(int number, const entity_state_t *s, int changedbi { prvm_prog_t *prog = SVVM_prog; unsigned int bits = 0; - //dp_model_t *model; + //model_t *model; if (s->active != ACTIVE_NETWORK) { @@ -352,7 +352,7 @@ void EntityState5_WriteUpdate(int number, const entity_state_t *s, int changedbi } else { - dp_model_t *model = SV_GetModelByIndex(s->modelindex); + model_t *model = SV_GetModelByIndex(s->modelindex); if (s->framegroupblend[3].lerp > 0) { MSG_WriteByte(msg, 3); diff --git a/sv_main.c b/sv_main.c index 867c0bdf..1da0531e 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1519,12 +1519,12 @@ int SV_ParticleEffectIndex(const char *name) return 0; } -dp_model_t *SV_GetModelByIndex(int modelindex) +model_t *SV_GetModelByIndex(int modelindex) { return (modelindex > 0 && modelindex < MAX_MODELS) ? sv.models[modelindex] : NULL; } -dp_model_t *SV_GetModelFromEdict(prvm_edict_t *ed) +model_t *SV_GetModelFromEdict(prvm_edict_t *ed) { prvm_prog_t *prog = SVVM_prog; int modelindex; @@ -1715,7 +1715,7 @@ void SV_SpawnServer (const char *map) prvm_edict_t *ent; int i; char *entities; - dp_model_t *worldmodel; + model_t *worldmodel; char modelname[sizeof(sv.worldname)]; char vabuf[1024]; diff --git a/sv_phys.c b/sv_phys.c index d0371577..131eda9f 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -46,7 +46,7 @@ void SV_Physics_Toss (prvm_edict_t *ent); int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent) { - dp_model_t *model; + model_t *model; if ( (model = SV_GetModelFromEdict(ent)) ? @@ -122,7 +122,7 @@ trace_t SV_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -274,7 +274,7 @@ trace_t SV_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -437,7 +437,7 @@ trace_t SV_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; // list of entities to test for collisions int numtouchedicts; static prvm_edict_t *touchedicts[MAX_EDICTS]; @@ -618,7 +618,7 @@ int SV_PointSuperContents(const vec3_t point) // matrices to transform into/out of other entity's space matrix4x4_t matrix, imatrix; // model of other entity - dp_model_t *model; + model_t *model; int frame; // list of entities to test for collisions int numtouchedicts; @@ -804,7 +804,7 @@ SV_LinkEdict void SV_LinkEdict (prvm_edict_t *ent) { prvm_prog_t *prog = SVVM_prog; - dp_model_t *model; + model_t *model; vec3_t mins, maxs, entmins, entmaxs, entangles; int modelindex; @@ -1682,7 +1682,7 @@ static void SV_PushMove (prvm_edict_t *pusher, float movetime) int num_moved; int numcheckentities; static prvm_edict_t *checkentities[MAX_EDICTS]; - dp_model_t *pushermodel; + model_t *pushermodel; trace_t trace, trace2; matrix4x4_t pusherfinalmatrix, pusherfinalimatrix; static unsigned short moved_edicts[MAX_EDICTS]; diff --git a/sv_send.c b/sv_send.c index d0205f98..a9aec2b9 100644 --- a/sv_send.c +++ b/sv_send.c @@ -402,7 +402,7 @@ static qbool SV_PrepareEntityForSending (prvm_edict_t *ent, entity_state_t *cs, float f; prvm_vec_t *v; vec3_t cullmins, cullmaxs; - dp_model_t *model; + model_t *model; // fast path for games that do not use legacy entity networking // note: still networks clients even if they are legacy @@ -733,7 +733,7 @@ qbool SV_CanSeeBox(int numtraces, vec_t eyejitter, vec_t enlarge, vec_t entboxex int numtouchedicts = 0; int touchindex; matrix4x4_t matrix, imatrix; - dp_model_t *model; + model_t *model; prvm_edict_t *touch; static prvm_edict_t *touchedicts[MAX_EDICTS]; vec3_t eyemins, eyemaxs, start; @@ -863,7 +863,7 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s) { prvm_prog_t *prog = SVVM_prog; int isbmodel; - dp_model_t *model; + model_t *model; prvm_edict_t *ed; if (sv.sententitiesconsideration[s->number] == sv.sententitiesmark) return; diff --git a/svvm_cmds.c b/svvm_cmds.c index 634de814..18997ba5 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -327,7 +327,7 @@ static vec3_t quakemins = {-16, -16, -16}, quakemaxs = {16, 16, 16}; static void VM_SV_setmodel(prvm_prog_t *prog) { prvm_edict_t *e; - dp_model_t *mod; + model_t *mod; int i; VM_SAFEPARMCOUNT(2, VM_SV_setmodel); @@ -2366,7 +2366,7 @@ static void VM_SV_setattachment(prvm_prog_t *prog) prvm_edict_t *e = PRVM_G_EDICT(OFS_PARM0); prvm_edict_t *tagentity = PRVM_G_EDICT(OFS_PARM1); const char *tagname = PRVM_G_STRING(OFS_PARM2); - dp_model_t *model; + model_t *model; int tagindex; VM_SAFEPARMCOUNT(3, VM_SV_setattachment); @@ -2420,7 +2420,7 @@ static int SV_GetTagIndex (prvm_prog_t *prog, prvm_edict_t *e, const char *tagna static int SV_GetExtendedTagInfo (prvm_prog_t *prog, prvm_edict_t *e, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix) { int r; - dp_model_t *model; + model_t *model; *tagname = NULL; *parentindex = 0; @@ -2459,7 +2459,7 @@ void SV_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, static int SV_GetEntityLocalTagMatrix(prvm_prog_t *prog, prvm_edict_t *ent, int tagindex, matrix4x4_t *out) { - dp_model_t *model; + model_t *model; if (tagindex >= 0 && (model = SV_GetModelFromEdict(ent)) && model->animscenes) { VM_GenerateFrameGroupBlend(prog, ent->priv.server->framegroupblend, ent); @@ -2486,7 +2486,7 @@ static int SV_GetTagMatrix (prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *e int ret; int modelindex, attachloop; matrix4x4_t entitymatrix, tagmatrix, attachmatrix; - dp_model_t *model; + model_t *model; *out = identitymatrix; // warnings and errors return identical matrix @@ -2614,7 +2614,7 @@ static void VM_SV_gettaginfo(prvm_prog_t *prog) const char *tagname; int returncode; vec3_t forward, left, up, origin; - const dp_model_t *model; + const model_t *model; VM_SAFEPARMCOUNT(2, VM_SV_gettaginfo); @@ -2743,7 +2743,7 @@ static void VM_SV_serverkey(prvm_prog_t *prog) static void VM_SV_setmodelindex(prvm_prog_t *prog) { prvm_edict_t *e; - dp_model_t *mod; + model_t *mod; int i; VM_SAFEPARMCOUNT(2, VM_SV_setmodelindex); @@ -2895,7 +2895,7 @@ static void VM_SV_setpause(prvm_prog_t *prog) { static void VM_SV_skel_create(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = SV_GetModelByIndex(modelindex); + model_t *model = SV_GetModelByIndex(modelindex); skeleton_t *skeleton; int i; PRVM_G_FLOAT(OFS_RETURN) = 0; @@ -2925,7 +2925,7 @@ static void VM_SV_skel_build(prvm_prog_t *prog) float retainfrac = PRVM_G_FLOAT(OFS_PARM3); int firstbone = PRVM_G_FLOAT(OFS_PARM4) - 1; int lastbone = PRVM_G_FLOAT(OFS_PARM5) - 1; - dp_model_t *model = SV_GetModelByIndex(modelindex); + model_t *model = SV_GetModelByIndex(modelindex); int numblends; int bonenum; int blendindex; @@ -3168,7 +3168,7 @@ static void VM_SV_skel_delete(prvm_prog_t *prog) static void VM_SV_frameforname(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = SV_GetModelByIndex(modelindex); + model_t *model = SV_GetModelByIndex(modelindex); const char *name = PRVM_G_STRING(OFS_PARM1); int i; PRVM_G_FLOAT(OFS_RETURN) = -1; @@ -3188,7 +3188,7 @@ static void VM_SV_frameforname(prvm_prog_t *prog) static void VM_SV_frameduration(prvm_prog_t *prog) { int modelindex = (int)PRVM_G_FLOAT(OFS_PARM0); - dp_model_t *model = SV_GetModelByIndex(modelindex); + model_t *model = SV_GetModelByIndex(modelindex); int framenum = (int)PRVM_G_FLOAT(OFS_PARM1); PRVM_G_FLOAT(OFS_RETURN) = 0; if (!model || !model->animscenes || framenum < 0 || framenum >= model->numframes) diff --git a/world.c b/world.c index eb645c8f..d7369692 100644 --- a/world.c +++ b/world.c @@ -2118,7 +2118,7 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) dMass mass; const dReal *ovelocity, *ospinvelocity; void *dataID; - dp_model_t *model; + model_t *model; float *ov; int *oe; int axisindex; -- 2.39.2