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;
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)
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));
// 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];
// 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];
// 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];
// 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];
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);
if (bits & E5_COMPLEXANIMATION)
{
skeleton_t *skeleton;
- const dp_model_t *model;
+ const model_t *model;
int modelindex;
int type;
int bonenum;
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");
{
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
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;
}
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",
void CL_ValidateState(entity_state_t *s)
{
- dp_model_t *model;
+ model_t *model;
if (!s->active)
return;
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;
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;
{
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;
typedef struct decalsystem_s
{
- dp_model_t *model;
+ model_t *model;
double lastupdatetime;
int maxdecals;
int freedecal;
vec3_t origin;
double starttime;
float framerate;
- dp_model_t *model;
+ model_t *model;
int startframe;
int endframe;
// these are for interpolation
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
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;
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);
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);
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])
{
prvm_edict_t *e;
const char *m;
- dp_model_t *mod;
+ model_t *mod;
int i;
VM_SAFEPARMCOUNT(2, VM_CL_setmodel);
{
const char *name;
int i;
- dp_model_t *m;
+ model_t *m;
VM_SAFEPARMCOUNT(1, VM_CL_precache_model);
{
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;
}
//#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);
// #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);
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);
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
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;
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;
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)
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
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);
const char *texname;
int drawflags;
qbool draw2d;
- dp_model_t *mod;
+ model_t *mod;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_R_PolygonBegin);
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);
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;
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;
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;
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;
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)
typedef struct collision_cachedtrace_parameters_s
{
- dp_model_t *model;
+ model_t *model;
vec3_t end;
vec3_t start;
int hitsupercontentsmask;
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;
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)
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)
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;
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);
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;
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);
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));
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;
int c;
float scale;
entity_render_t *entrender;
- dp_model_t *model;
+ model_t *model;
prvm_vec3_t modellight_origin;
model = CL_GetModelFromEdict(ed);
{
prvm_prog_t *prog = CLVM_prog;
prvm_edict_t *ed;
- dp_model_t *mod;
+ model_t *mod;
matrix4x4_t matrix;
qbool r = 0;
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);
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)
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)
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;
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)
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;
void DrawQ_FlushUI(void)
{
- dp_model_t *mod = CL_Mesh_UI();
+ model_t *mod = CL_Mesh_UI();
if (mod->num_surfaces == 0)
return;
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
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 },
{
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;
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;
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;
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;
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;
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;
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;
}
}
-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;
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;
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++)
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)
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;
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;
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);
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);
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);
typedef struct r_q1bsp_getlightinfo_s
{
- dp_model_t *model;
+ model_t *model;
vec3_t relativelightorigin;
float lightradius;
int *outleaflist;
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;
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
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;
//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;
//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)
#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;
#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
#include <xmmintrin.h>
-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;
#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
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];
}
}
-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)
#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;
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;
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;
}
}
}
-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;
}
}
-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;
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;
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)
}
}
-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];
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;
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;
}
}
-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;
}
}
-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;
}
}
-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;
}
}
-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;
// 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;
}
}
-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;
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;
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;
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;
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];
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];
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];
vec_t radius;
vec3_t nudge;
vec_t bestdist;
- dp_model_t *model;
+ model_t *model;
}
findnonsolidlocationinfo_t;
}
}
-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;
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;
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);
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;
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;
}
// 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;
//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;
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)
{
//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);
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;
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)
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];
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:
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;
}
}
-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];
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;
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;
}
}
-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;
}
}
-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;
}
}
-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))
{
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;
}
}
-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;
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
#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;
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;
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++)
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)
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");
}
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;
// 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;
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++)
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[] =
{
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);
{
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();
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++)
{
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++)
{
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();
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);
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;
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));
//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;
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;
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;
{
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;
}
{
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);
==================
*/
-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 = "";
// 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;
}
// 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);
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)
{
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);
{
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);
Mem_Free(mesh);
}
-void Mod_CreateCollisionMesh(dp_model_t *mod)
+void Mod_CreateCollisionMesh(model_t *mod)
{
int k, numcollisionmeshtriangles;
qbool usesinglecollisionmesh = false;
#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];
// 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);
*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;
}
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;
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);
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;
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];
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;
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;
}
}
-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;
Mem_Free(nodes);
}
-static void Mod_GenerateLightmaps_CreateLights(dp_model_t *model)
+static void Mod_GenerateLightmaps_CreateLights(model_t *model)
{
int index;
int result;
}
}
-static void Mod_GenerateLightmaps_DestroyLights(dp_model_t *model)
+static void Mod_GenerateLightmaps_DestroyLights(model_t *model)
{
int i;
if (mod_generatelightmaps_lightinfo)
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];
}
}
-static void Mod_GenerateLightmaps_DestroyLightmaps(dp_model_t *model)
+static void Mod_GenerateLightmaps_DestroyLightmaps(model_t *model)
{
msurface_t *surface;
int surfaceindex;
}
}
-static void Mod_GenerateLightmaps_UnweldTriangles(dp_model_t *model)
+static void Mod_GenerateLightmaps_UnweldTriangles(model_t *model)
{
msurface_t *surface;
int surfaceindex;
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;
}
}
-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);
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;
}
}
-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;
}
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);
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));
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;
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;
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
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;
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)
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;
}
}
-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;
}
}
-void Mod_Mesh_Validate(dp_model_t *mod)
+void Mod_Mesh_Validate(model_t *mod)
{
int i;
qbool warned = false;
}
}
-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;
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);
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
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
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);
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
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);
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);
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
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;
}
-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;
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;
}\
}
-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)
unsigned char *leafpvs;
unsigned char *shadowtrispvs;
unsigned char *lighttrispvs;
- dp_model_t *model;
+ model_t *model;
vec3_t eye;
float *updateleafsmins;
float *updateleafsmaxs;
}
}
-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;
#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
// 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)
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);
// 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;
}
}
-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)
{
// 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);
struct animatemodel_cache
{
- dp_model_t *model;
+ model_t *model;
frameblend_t frameblend[MAX_FRAMEBLENDS];
skeleton_t *skeleton_p;
skeleton_t skeleton;
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;
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;
}
}
-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;
//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
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;
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;
//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;
//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;
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);
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);
//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
{
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);
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;
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)
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
static void R_Shadow_DrawEntityLight(entity_render_t *ent)
{
- dp_model_t *model = ent->model;
+ model_t *model = ent->model;
if (!model->DrawLight)
return;
// 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))
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;
}
}
-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++)
entity_render_t *worldentity;
// same as worldentity->model
- dp_model_t *worldmodel;
+ model_t *worldmodel;
// renderable entities (excluding world)
entity_render_t **entities;
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);
}
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)
{
prvm_prog_t *prog = SVVM_prog;
prvm_edict_t *e;
- dp_model_t *m;
+ model_t *m;
if (!sv.active)
return;
prvm_prog_t *prog = SVVM_prog;
prvm_edict_t *e;
int f;
- dp_model_t *m;
+ model_t *m;
if (!sv.active)
return;
}
}
-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);
{
prvm_prog_t *prog = SVVM_prog;
prvm_edict_t *e;
- dp_model_t *m;
+ model_t *m;
if (!sv.active)
return;
{
prvm_prog_t *prog = SVVM_prog;
prvm_edict_t *e;
- dp_model_t *m;
+ model_t *m;
if (!sv.active)
return;
}
// 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;
{
prvm_prog_t *prog = SVVM_prog;
unsigned int bits = 0;
- //dp_model_t *model;
+ //model_t *model;
if (s->active != ACTIVE_NETWORK)
{
}
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);
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;
prvm_edict_t *ent;
int i;
char *entities;
- dp_model_t *worldmodel;
+ model_t *worldmodel;
char modelname[sizeof(sv.worldname)];
char vabuf[1024];
int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent)
{
- dp_model_t *model;
+ model_t *model;
if (
(model = SV_GetModelFromEdict(ent))
?
// 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];
// 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];
// 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];
// 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;
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;
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];
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
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;
{
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;
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);
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);
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;
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);
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
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);
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);
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;
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;
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;
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)
dMass mass;
const dReal *ovelocity, *ospinvelocity;
void *dataID;
- dp_model_t *model;
+ model_t *model;
float *ov;
int *oe;
int axisindex;