cl.worldmodel->brush.FindNonSolidLocation(cl.worldmodel, in, out, radius);
}
-model_t *CL_GetModelByIndex(int modelindex)
+dp_model_t *CL_GetModelByIndex(int modelindex)
{
if(!modelindex)
return NULL;
return NULL;
}
-model_t *CL_GetModelFromEdict(prvm_edict_t *ed)
+dp_model_t *CL_GetModelFromEdict(prvm_edict_t *ed)
{
if (!ed || ed->priv.server->free)
return NULL;
if (ent->fields.client->solid == SOLID_BSP)
{
- model_t *model = CL_GetModelByIndex( (int)ent->fields.client->modelindex );
+ dp_model_t *model = CL_GetModelByIndex( (int)ent->fields.client->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
- model_t *model;
+ dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
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);
-model_t *CL_GetModelByIndex(int modelindex);
-model_t *CL_GetModelFromEdict(prvm_edict_t *ed);
+dp_model_t *CL_GetModelByIndex(int modelindex);
+dp_model_t *CL_GetModelFromEdict(prvm_edict_t *ed);
void CL_LinkEdict(prvm_edict_t *ent);
int CL_GenericHitSuperContentsMask(const prvm_edict_t *edict);
{
vec3_t org;
vec_t scale;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
// update the inverse matrix for the renderer
Matrix4x4_Invert_Simple(&ent->inversematrix, &ent->matrix);
// update the animation blend state
int j, k, l, frame;
float origin[3], angles[3], delta[3], lerp, d;
entity_t *t;
- model_t *model;
+ dp_model_t *model;
//entity_persistent_t *p = &e->persistent;
//entity_render_t *r = &e->render;
// skip inactive entities and world
void CL_ValidateState(entity_state_t *s)
{
- model_t *model;
+ dp_model_t *model;
if (!s->active)
return;
CL_Effect(org, modelindex, startframe, framecount, framerate);
}
-void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
+void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning)
{
int i;
beam_t *b = NULL;
Con_Print("beam list overflow!\n");
}
-void CL_ParseBeam (model_t *m, int lightning)
+void CL_ParseBeam (dp_model_t *m, int lightning)
{
int ent;
vec3_t start, end;
{
if (i >= 1 && i < MAX_MODELS)
{
- model_t *model = Mod_ForName(s, false, false, i == 1);
+ dp_model_t *model = Mod_ForName(s, false, false, i == 1);
if (!model)
Con_DPrintf("svc_precache: Mod_ForName(\"%s\") failed\n", s);
cl.model_precache[i] = model;
float scale;
// NULL = no model
- model_t *model;
+ dp_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
// fields not used by rendering: (36 bytes in 32bit, 40 bytes in 64bit)
float time2; // used for decal fade
unsigned int owner; // decal stuck to this entity
- model_t *ownermodel; // model the decal is stuck to (used to make sure the entity is still alive)
+ dp_model_t *ownermodel; // model the decal is stuck to (used to make sure the entity is still alive)
vec3_t relativeorigin; // decal at this location in entity's coordinate space
vec3_t relativenormal; // decal oriented this way relative to entity's coordinate space
}
int gametype;
// models and sounds used by engine code (particularly cl_parse.c)
- model_t *model_bolt;
- model_t *model_bolt2;
- model_t *model_bolt3;
- model_t *model_beam;
+ dp_model_t *model_bolt;
+ dp_model_t *model_bolt2;
+ dp_model_t *model_bolt3;
+ dp_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, model_t *m, int lightning);
+void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_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);
entity_render_t *worldentity;
// same as worldentity->model
- model_t *worldmodel;
+ dp_model_t *worldmodel;
// renderable entities (excluding world)
entity_render_t **entities;
{
prvm_edict_t *e;
const char *m;
- model_t *mod;
+ dp_model_t *mod;
int i;
VM_SAFEPARMCOUNT(2, VM_CL_setmodel);
{
const char *name;
int i;
- model_t *m;
+ dp_model_t *m;
VM_SAFEPARMCOUNT(1, VM_CL_precache_model);
{
if (!cl.csqc_model_precache[i])
{
- cl.csqc_model_precache[i] = (model_t*)m;
+ cl.csqc_model_precache[i] = (dp_model_t*)m;
PRVM_G_FLOAT(OFS_RETURN) = -(i+1);
return;
}
//#334 string(float mdlindex) modelnameforindex (EXT_CSQC)
static void VM_CL_modelnameforindex (void)
{
- model_t *model;
+ dp_model_t *model;
VM_SAFEPARMCOUNT(1, VM_CL_modelnameforindex);
//====================================================================
//DP_QC_GETSURFACE
-extern void clippointtosurface(model_t *model, msurface_t *surface, vec3_t p, vec3_t out);
+extern void clippointtosurface(dp_model_t *model, msurface_t *surface, vec3_t p, vec3_t out);
-static msurface_t *cl_getsurface(model_t *model, int surfacenum)
+static msurface_t *cl_getsurface(dp_model_t *model, int surfacenum)
{
if (surfacenum < 0 || surfacenum >= model->nummodelsurfaces)
return NULL;
// #434 float(entity e, float s) getsurfacenumpoints
static void VM_CL_getsurfacenumpoints(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenumpoints);
// return 0 if no such surface
static void VM_CL_getsurfacepoint(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
int pointnum;
VM_SAFEPARMCOUNT(3, VM_CL_getsurfacenumpoints);
static void VM_CL_getsurfacepointattribute(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
int pointnum;
int attributetype;
// #436 vector(entity e, float s) getsurfacenormal
static void VM_CL_getsurfacenormal(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
vec3_t normal;
VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenormal);
// #437 string(entity e, float s) getsurfacetexture
static void VM_CL_getsurfacetexture(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
VM_SAFEPARMCOUNT(2, VM_CL_getsurfacetexture);
PRVM_G_INT(OFS_RETURN) = OFS_NULL;
vec3_t clipped, p;
vec_t dist, bestdist;
prvm_edict_t *ed;
- model_t *model = NULL;
+ dp_model_t *model = NULL;
msurface_t *surface;
vec_t *point;
VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenearpoint);
static void VM_CL_getsurfaceclippedpoint(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
vec3_t p, out;
VM_SAFEPARMCOUNT(3, VM_CL_getsurfaceclippedpoint);
const char *tagname;
prvm_eval_t *v;
int modelindex;
- model_t *model;
+ dp_model_t *model;
VM_SAFEPARMCOUNT(3, VM_CL_setattachment);
e = PRVM_G_EDICT(OFS_PARM0);
int CL_GetTagIndex (prvm_edict_t *e, const char *tagname)
{
- model_t *model = CL_GetModelFromEdict(e);
+ dp_model_t *model = CL_GetModelFromEdict(e);
if (model)
return Mod_Alias_GetTagIndexForName(model, (int)e->fields.client->skin, tagname);
else
int reqframe, attachloop;
matrix4x4_t entitymatrix, tagmatrix, attachmatrix;
prvm_edict_t *attachent;
- model_t *model;
+ dp_model_t *model;
float scale;
*out = identitymatrix; // warnings and errors return identical matrix
//===========================================
-void Collision_ClipToGenericEntity(trace_t *trace, model_t *model, int frame, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask)
+void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, int frame, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask)
{
float tempnormal[3], starttransformed[3], endtransformed[3];
}
}
-void Collision_ClipToWorld(trace_t *trace, model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontents)
+void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontents)
{
memset(trace, 0, sizeof(*trace));
trace->fraction = trace->realfraction = 1;
// entities, only colliding with SOLID_BSP entities (doors, lifts)
//
// passedict is excluded from clipping checks
-void Collision_ClipToGenericEntity(trace_t *trace, model_t *model, int frame, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask);
+void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, int frame, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask);
// like above but does not do a transform and does nothing if model is NULL
-void Collision_ClipToWorld(trace_t *trace, model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontents);
+void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontents);
// combines data from two traces:
// merges contents flags, startsolid, allsolid, inwater
// updates fraction, endpos, plane and surface info if new fraction is shorter
#ifdef SUNOS
#include <sys/file.h> // Needed for FNDELAY
-# define model_t dp_model_t // Workaround conflict with /usr/include/sys/model.h
#endif
//============================================================================
float scale;
prvm_eval_t *val;
entity_render_t *entrender;
- model_t *model;
+ dp_model_t *model;
matrix4x4_t tagmatrix, matrix2;
model = CL_GetModelFromEdict(ed);
void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t)
{
int i;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
float f;
float tcmat[12];
q3shaderinfo_layer_tcmod_t *tcmod;
void RSurf_ActiveWorldEntity(void)
{
- model_t *model = r_refdef.scene.worldmodel;
+ dp_model_t *model = r_refdef.scene.worldmodel;
if (rsurface.array_size < model->surfmesh.num_vertices)
R_Mesh_ResizeArrays(model->surfmesh.num_vertices);
rsurface.matrix = identitymatrix;
void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
if (rsurface.array_size < model->surfmesh.num_vertices)
R_Mesh_ResizeArrays(model->surfmesh.num_vertices);
rsurface.matrix = ent->matrix;
const int *elements;
q3mbrush_t *brush;
msurface_t *surface;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
vec3_t v;
flagsmask = MATERIALFLAG_SKY | MATERIALFLAG_WALL;
int i, j, endj, f, flagsmask;
msurface_t *surface;
texture_t *t;
- model_t *model = r_refdef.scene.worldmodel;
+ dp_model_t *model = r_refdef.scene.worldmodel;
const int maxsurfacelist = 1024;
int numsurfacelist = 0;
msurface_t *surfacelist[1024];
int i, j, f, flagsmask;
msurface_t *surface, *endsurface;
texture_t *t;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
const int maxsurfacelist = 1024;
int numsurfacelist = 0;
msurface_t *surfacelist[1024];
int smax, tmax, i, size, size3, maps, l;
int *bl, scale;
unsigned char *lightmap, *out, *stain;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
int *intblocklights;
unsigned char *templight;
}
}
-void R_StainNode (mnode_t *node, model_t *model, const vec3_t origin, float radius, const float fcolor[8])
+void R_StainNode (mnode_t *node, dp_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;
- model_t *model;
+ dp_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;
- model_t *model = r_refdef.scene.worldmodel;
+ dp_model_t *model = r_refdef.scene.worldmodel;
if (model == NULL)
return;
for (leafnum = 0;leafnum < r_refdef.scene.worldmodel->brush.num_leafs;leafnum++)
int i, j, *mark;
mleaf_t *leaf;
mleaf_t *viewleaf;
- model_t *model = r_refdef.scene.worldmodel;
+ dp_model_t *model = r_refdef.scene.worldmodel;
if (!model)
return;
void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
if (model == NULL)
return;
if (ent == r_refdef.scene.worldentity)
void R_Q1BSP_Draw(entity_render_t *ent)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
if (model == NULL)
return;
if (ent == r_refdef.scene.worldentity)
void R_Q1BSP_DrawDepth(entity_render_t *ent)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
if (model == NULL)
return;
GL_ColorMask(0,0,0,0);
typedef struct r_q1bsp_getlightinfo_s
{
- model_t *model;
+ dp_model_t *model;
vec3_t relativelightorigin;
float lightradius;
int *outleaflist;
void R_Q1BSP_CompileShadowVolume(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
msurface_t *surface;
int surfacelistindex;
float projectdistance = relativelightdirection ? lightradius : lightradius + model->radius*2 + r_shadow_projectdistance.value;
extern cvar_t r_polygonoffset_submodel_offset;
void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const vec3_t lightmins, const vec3_t lightmaxs)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
msurface_t *surface;
int modelsurfacelistindex;
float projectdistance = relativelightdirection ? lightradius : lightradius + model->radius*2 + r_shadow_projectdistance.value;
void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
msurface_t *surface;
int i, k, kend, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex, batchfirsttriangle;
qboolean usebufferobject, culltriangles;
//Made by [515]
void R_ReplaceWorldTexture (void)
{
- model_t *m;
+ dp_model_t *m;
texture_t *t;
int i;
const char *r, *newt;
//Made by [515]
void R_ListWorldTextures (void)
{
- model_t *m;
+ dp_model_t *m;
texture_t *t;
int i;
if (!r_refdef.scene.worldmodel)
void Host_Viewmodel_f (void)
{
prvm_edict_t *e;
- model_t *m;
+ dp_model_t *m;
if (!sv.active)
return;
{
prvm_edict_t *e;
int f;
- model_t *m;
+ dp_model_t *m;
if (!sv.active)
return;
}
-void PrintFrameName (model_t *m, int frame)
+void PrintFrameName (dp_model_t *m, int frame)
{
if (m->animscenes)
Con_Printf("frame %i: %s\n", frame, m->animscenes[frame].name);
void Host_Viewnext_f (void)
{
prvm_edict_t *e;
- model_t *m;
+ dp_model_t *m;
if (!sv.active)
return;
void Host_Viewprev_f (void)
{
prvm_edict_t *e;
- model_t *m;
+ dp_model_t *m;
if (!sv.active)
return;
mod_md3_sin[i] = sin(i * M_PI * 2.0f / 256.0);
}
-void Mod_Skeletal_AnimateVertices(const model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
+void Mod_Skeletal_AnimateVertices(const dp_model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
{
#define MAX_BONES 256
// vertex weighted skeletal
}
}
-void Mod_MD3_AnimateVertices(const model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
+void Mod_MD3_AnimateVertices(const dp_model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
{
// vertex morph
int i, numblends, blendnum;
}
}
-void Mod_MDL_AnimateVertices(const model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
+void Mod_MDL_AnimateVertices(const dp_model_t *model, const frameblend_t *frameblend, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f)
{
// vertex morph
int i, numblends, blendnum;
}
}
-int Mod_Alias_GetTagMatrix(const model_t *model, int poseframe, int tagindex, matrix4x4_t *outmatrix)
+int Mod_Alias_GetTagMatrix(const dp_model_t *model, int poseframe, int tagindex, matrix4x4_t *outmatrix)
{
const float *boneframe;
float tempbonematrix[12], bonematrix[12];
return 0;
}
-int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname)
+int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname)
{
int i;
if(skin >= (unsigned int)model->numskins)
}
}
-static void Mod_MDLMD2MD3_TraceBox(model_t *model, int frame, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask)
+static void Mod_MDLMD2MD3_TraceBox(dp_model_t *model, int frame, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask)
{
int i;
float segmentmins[3], segmentmaxs[3];
#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(model_t *mod, void *buffer, void *bufferend)
+void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, j, version, totalskins, skinwidth, skinheight, groupframes, groupskins, numverts;
float scales, scalet, interval;
loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || loadmodel->animscenes[0].framecount > 1;
}
-void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, j, hashindex, numxyz, numst, xyz, st, skinwidth, skinheight, *vertremap, version, end;
float iskinwidth, iskinheight;
loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || loadmodel->animscenes[0].framecount > 1;
}
-void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, j, k, version, meshvertices, meshtriangles;
unsigned char *data;
|| (loadmodel->animscenes && loadmodel->animscenes[0].framecount > 1);
}
-void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
zymtype1header_t *pinmodel, *pheader;
unsigned char *pbase;
loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || loadmodel->animscenes[0].framecount > 1;
}
-void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
dpmheader_t *pheader;
dpmframe_t *frame;
// no idea why PSK/PSA files contain weird quaternions but they do...
#define PSKQUATNEGATIONS
-void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_PSKMODEL_Load(dp_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;
mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
}
-static mleaf_t *Mod_Q1BSP_PointInLeaf(model_t *model, const vec3_t p)
+static mleaf_t *Mod_Q1BSP_PointInLeaf(dp_model_t *model, const vec3_t p)
{
mnode_t *node;
return (mleaf_t *)node;
}
-static void Mod_Q1BSP_AmbientSoundLevelsForPoint(model_t *model, const vec3_t p, unsigned char *out, int outsize)
+static void Mod_Q1BSP_AmbientSoundLevelsForPoint(dp_model_t *model, const vec3_t p, unsigned char *out, int outsize)
{
int i;
mleaf_t *leaf;
memset(out, 0, outsize);
}
-static int Mod_Q1BSP_FindBoxClusters(model_t *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist)
+static int Mod_Q1BSP_FindBoxClusters(dp_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_Q1BSP_BoxTouchingPVS(model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs)
+static int Mod_Q1BSP_BoxTouchingPVS(dp_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_Q1BSP_BoxTouchingLeafPVS(model_t *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs)
+static int Mod_Q1BSP_BoxTouchingLeafPVS(dp_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_Q1BSP_BoxTouchingVisibleLeafs(model_t *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs)
+static int Mod_Q1BSP_BoxTouchingVisibleLeafs(dp_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;
- model_t *model;
+ dp_model_t *model;
}
findnonsolidlocationinfo_t;
}
}
-static void Mod_Q1BSP_FindNonSolidLocation(model_t *model, const vec3_t in, vec3_t out, float radius)
+static void Mod_Q1BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, vec3_t out, float radius)
{
int i;
findnonsolidlocationinfo_t info;
VectorCopy(info.center, out);
}
-int Mod_Q1BSP_SuperContentsFromNativeContents(model_t *model, int nativecontents)
+int Mod_Q1BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
{
switch(nativecontents)
{
return 0;
}
-int Mod_Q1BSP_NativeContentsFromSuperContents(model_t *model, int supercontents)
+int Mod_Q1BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents)
{
if (supercontents & (SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY))
return CONTENTS_SOLID;
return Mod_Q1BSP_TraceLineOfSight_RecursiveNodeCheck(model->brush.data_nodes, tracestart, traceend) != 2;
}
-static int Mod_Q1BSP_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)
+static int Mod_Q1BSP_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)
{
int side;
float front, back;
}
}
-void Mod_Q1BSP_LightPoint(model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal)
+void Mod_Q1BSP_LightPoint(dp_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);
//Returns PVS data for a given point
//(note: can return NULL)
-static unsigned char *Mod_Q1BSP_GetPVS(model_t *model, const vec3_t p)
+static unsigned char *Mod_Q1BSP_GetPVS(dp_model_t *model, const vec3_t p)
{
mnode_t *node;
node = model->brush.data_nodes;
return NULL;
}
-static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbytes, mnode_t *node)
+static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(dp_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_Q1BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge)
+static int Mod_Q1BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge)
{
int bytes = model->brush.num_pvsclusterbytes;
bytes = min(bytes, pvsbufferlength);
return bytes;
}
-static void Mod_Q1BSP_RoundUpToHullSize(model_t *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs)
+static void Mod_Q1BSP_RoundUpToHullSize(dp_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_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, j, k;
dheader_t *header;
Mod_BuildTriangleNeighbors(loadmodel->brush.shadowmesh->neighbor3i, loadmodel->brush.shadowmesh->element3i, loadmodel->brush.shadowmesh->numtriangles);
if (loadmodel->brush.numsubmodels)
- loadmodel->brush.submodels = (model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(model_t *));
+ loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *));
// LordHavoc: to clear the fog around the original quake submodel code, I
// will explain:
*/
}
-void static Mod_Q2BSP_Load(model_t *mod, void *buffer, void *bufferend)
+void static Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i;
q2dheader_t *header;
Mod_Q2BSP_LoadModels(&header->lumps[Q2LUMP_MODELS]);
}
-static int Mod_Q3BSP_SuperContentsFromNativeContents(model_t *model, int nativecontents);
-static int Mod_Q3BSP_NativeContentsFromSuperContents(model_t *model, int supercontents);
+static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents);
+static int Mod_Q3BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents);
static void Mod_Q3BSP_LoadEntities(lump_t *l)
{
memcpy(loadmodel->brush.data_pvsclusters, (unsigned char *)(in + 1), totalchains);
}
-static void Mod_Q3BSP_LightPoint(model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal)
+static void Mod_Q3BSP_LightPoint(dp_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;
//Con_Printf("result: ambient %f %f %f diffuse %f %f %f diffusenormal %f %f %f\n", ambientcolor[0], ambientcolor[1], ambientcolor[2], diffusecolor[0], diffusecolor[1], diffusecolor[2], diffusenormal[0], diffusenormal[1], diffusenormal[2]);
}
-static void Mod_Q3BSP_TracePoint_RecursiveBSPNode(trace_t *trace, model_t *model, mnode_t *node, const vec3_t point, int markframe)
+static void Mod_Q3BSP_TracePoint_RecursiveBSPNode(trace_t *trace, dp_model_t *model, mnode_t *node, const vec3_t point, int markframe)
{
int i;
mleaf_t *leaf;
// can't do point traces on curves (they have no thickness)
}
-static void Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace_t *trace, model_t *model, mnode_t *node, const vec3_t start, const vec3_t end, vec_t startfrac, vec_t endfrac, const vec3_t linestart, const vec3_t lineend, int markframe, const vec3_t segmentmins, const vec3_t segmentmaxs)
+static void Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace_t *trace, dp_model_t *model, mnode_t *node, const vec3_t start, const vec3_t end, vec_t startfrac, vec_t endfrac, const vec3_t linestart, const vec3_t lineend, int markframe, const vec3_t segmentmins, const vec3_t segmentmaxs)
{
int i, startside, endside;
float dist1, dist2, midfrac, mid[3], nodesegmentmins[3], nodesegmentmaxs[3];
}
}
-static void Mod_Q3BSP_TraceBrush_RecursiveBSPNode(trace_t *trace, model_t *model, mnode_t *node, const colbrushf_t *thisbrush_start, const colbrushf_t *thisbrush_end, int markframe, const vec3_t segmentmins, const vec3_t segmentmaxs)
+static void Mod_Q3BSP_TraceBrush_RecursiveBSPNode(trace_t *trace, dp_model_t *model, mnode_t *node, const colbrushf_t *thisbrush_start, const colbrushf_t *thisbrush_end, int markframe, const vec3_t segmentmins, const vec3_t segmentmaxs)
{
int i;
int sides;
}
}
-static void Mod_Q3BSP_TraceBox(model_t *model, int frame, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask)
+static void Mod_Q3BSP_TraceBox(dp_model_t *model, int frame, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask)
{
int i;
float segmentmins[3], segmentmaxs[3];
return supercontents;
}
-static int Mod_Q3BSP_SuperContentsFromNativeContents(model_t *model, int nativecontents)
+static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
{
int supercontents = 0;
if (nativecontents & CONTENTSQ3_SOLID)
return supercontents;
}
-static int Mod_Q3BSP_NativeContentsFromSuperContents(model_t *model, int supercontents)
+static int Mod_Q3BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents)
{
int nativecontents = 0;
if (supercontents & SUPERCONTENTS_SOLID)
loadmodel->brush.num_leafs = numleafs;
}
-void Mod_Q3BSP_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, j, numshadowmeshtriangles;
q3dheader_t *header;
}
}
-void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i = LittleLong(((int *)buffer)[1]);
if (i == Q3BSPVERSION)
Host_Error("Mod_IBSP_Load: unknown/unsupported version %i", i);
}
-void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_MAP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
Host_Error("Mod_MAP_Load: not yet implemented");
}
-qboolean Mod_CanSeeBox_Trace(int numsamples, float t, model_t *model, vec3_t eye, vec3_t minsX, vec3_t maxsX)
+qboolean Mod_CanSeeBox_Trace(int numsamples, float t, dp_model_t *model, vec3_t eye, vec3_t minsX, vec3_t maxsX)
{
// we already have done PVS culling at this point...
// so we don't need to do it again.
cvar_t r_mipskins = {CVAR_SAVE, "r_mipskins", "0", "mipmaps model skins so they render faster in the distance and do not display noise artifacts, can cause discoloration of skins if they contain undesirable border colors"};
-model_t *loadmodel;
+dp_model_t *loadmodel;
static mempool_t *mod_mempool;
static memexpandablearray_t models;
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
// parse the Q3 shader files
Mod_LoadQ3Shaders();
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
for (i = 0;i < nummodels;i++)
if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && (mod->loaded || mod->mempool))
msurface_t *surface;
int i, j, k, surfacenum, ssize, tsize;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
R_SkinFrame_PrepareForPurge();
for (i = 0;i < nummodels;i++)
void Mod_Init (void)
{
mod_mempool = Mem_AllocPool("modelinfo", 0, NULL);
- Mem_ExpandableArray_NewArray(&models, mod_mempool, sizeof(model_t), 16);
+ Mem_ExpandableArray_NewArray(&models, mod_mempool, sizeof(dp_model_t), 16);
Mod_BrushInit();
Mod_AliasInit();
R_RegisterModule("Models", mod_start, mod_shutdown, mod_newmap);
}
-void Mod_UnloadModel (model_t *mod)
+void Mod_UnloadModel (dp_model_t *mod)
{
char name[MAX_QPATH];
qboolean isworldmodel;
R_FreeTexturePool(&mod->texturepool);
Mem_FreePool(&mod->mempool);
// clear the struct to make it available
- memset(mod, 0, sizeof(model_t));
+ memset(mod, 0, sizeof(dp_model_t));
// restore the fields we want to preserve
strlcpy(mod->name, name, sizeof(mod->name));
mod->isworldmodel = isworldmodel;
Loads a model
==================
*/
-model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel)
+dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel)
{
int num;
unsigned int crc;
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
for (i = 0;i < nummodels;i++)
if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0])
mod->used = false;
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
for (i = 0;i < nummodels;i++)
{
if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !mod->used)
}
// only used during loading!
-void Mod_RemoveStaleWorldModels(model_t *skip)
+void Mod_RemoveStaleWorldModels(dp_model_t *skip)
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
for (i = 0;i < nummodels;i++)
{
if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->isworldmodel && mod->loaded && skip != mod)
==================
*/
-model_t *Mod_FindName(const char *name)
+dp_model_t *Mod_FindName(const char *name)
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
if (!name[0])
Host_Error ("Mod_ForName: NULL name");
Loads in a model for the given name
==================
*/
-model_t *Mod_ForName(const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel)
+dp_model_t *Mod_ForName(const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel)
{
- model_t *model;
+ dp_model_t *model;
model = Mod_FindName(name);
if (model->name[0] != '*' && (!model->loaded || checkdisk))
Mod_LoadModel(model, crash, checkdisk, isworldmodel);
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
for (i = 0;i < nummodels;i++)
if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
Mod_LoadModel(mod, true, true, mod->isworldmodel);
{
int i;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
- model_t *mod;
+ dp_model_t *mod;
Con_Print("Loaded models:\n");
for (i = 0;i < nummodels;i++)
// flags this model for offseting sounds to the model center (used by brush models)
int soundfromcenter;
}
-model_t;
+dp_model_t;
//============================================================================
// model loading
-extern model_t *loadmodel;
+extern dp_model_t *loadmodel;
extern unsigned char *mod_base;
// sky/water subdivision
//extern cvar_t gl_subdivide_size;
void Mod_Init (void);
void Mod_Reload (void);
-model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
-model_t *Mod_FindName (const char *name);
-model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
-void Mod_UnloadModel (model_t *mod);
+dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
+dp_model_t *Mod_FindName (const char *name);
+dp_model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
+void Mod_UnloadModel (dp_model_t *mod);
void Mod_ClearUsed(void);
void Mod_PurgeUnused(void);
-void Mod_RemoveStaleWorldModels(model_t *skip); // only used during loading!
+void Mod_RemoveStaleWorldModels(dp_model_t *skip); // only used during loading!
-extern model_t *loadmodel;
+extern dp_model_t *loadmodel;
extern char loadname[32]; // for hunk tags
int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices);
// alias models
struct frameblend_s;
void Mod_AliasInit(void);
-int Mod_Alias_GetTagMatrix(const model_t *model, int poseframe, int tagindex, matrix4x4_t *outmatrix);
-int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname);
+int Mod_Alias_GetTagMatrix(const dp_model_t *model, int poseframe, int tagindex, matrix4x4_t *outmatrix);
+int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname);
// sprite models
void Mod_SpriteInit(void);
// loaders
-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_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_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_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);
// utility
-qboolean Mod_CanSeeBox_Trace(int numsamples, float t, model_t *model, vec3_t eye, vec3_t minsX, vec3_t maxsX);
+qboolean Mod_CanSeeBox_Trace(int numsamples, float t, dp_model_t *model, vec3_t eye, vec3_t minsX, vec3_t maxsX);
#endif // MODEL_SHARED_H
}
extern void R_Model_Sprite_Draw(entity_render_t *ent);
-void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int version;
const unsigned char *datapointer;
}
-void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend)
+void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, version, fullbright;
const dsprite2_t *pinqsprite;
goto loc0;
}
-int Portal_CheckPolygon(model_t *model, vec3_t eye, float *polypoints, int numpoints)
+int Portal_CheckPolygon(dp_model_t *model, vec3_t eye, float *polypoints, int numpoints)
{
int i, prev, returnvalue;
mleaf_t *eyeleaf;
}\
}
-int Portal_CheckBox(model_t *model, vec3_t eye, vec3_t a, vec3_t b)
+int Portal_CheckBox(dp_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;
- model_t *model;
+ dp_model_t *model;
vec3_t eye;
float *updateleafsmins;
float *updateleafsmaxs;
}
}
-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)
+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)
{
int i;
portalrecursioninfo_t info;
#ifndef PORTALS_H
#define PORTALS_H
-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);
+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);
#endif
double sublerp, lerp, d;
animscene_t *scene;
frameblend_t *blend;
- model_t *model = r->model;
+ dp_model_t *model = r->model;
blend = r->frameblend;
blend[0].frame = blend[1].frame = blend[2].frame = blend[3].frame = 0;
int numsurfaces, numleafs, numleafpvsbytes, numshadowtrispvsbytes, numlighttrispvsbytes;
int lighttris, shadowtris, shadowmeshes, shadowmeshtris;
entity_render_t *ent = r_refdef.scene.worldentity;
- model_t *model = r_refdef.scene.worldmodel;
+ dp_model_t *model = r_refdef.scene.worldmodel;
unsigned char *data;
// compile the light
void R_Shadow_DrawEntityLight(entity_render_t *ent)
{
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
if (!model->DrawLight)
return;
{
for (i = 0;i < r_refdef.scene.numentities;i++)
{
- model_t *model;
+ dp_model_t *model;
entity_render_t *ent = r_refdef.scene.entities[i];
vec3_t org;
if (!BoxesOverlap(ent->mins, ent->maxs, rsurface.rtlight_cullmins, rsurface.rtlight_cullmaxs))
void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
{
int i;
- model_t *model = ent->model;
+ dp_model_t *model = ent->model;
vec3_t left, up, org, mforward, mleft, mup, middle;
float scale, dx, dy, hud_vs_screen;
int edge = 0;
unsigned int customizeentityforclient;
float f;
vec3_t cullmins, cullmaxs;
- model_t *model;
+ dp_model_t *model;
prvm_eval_t *val;
// this 2 billion unit check is actually to detect NAN origins
void SV_MarkWriteEntityStateToClient(entity_state_t *s)
{
int isbmodel;
- model_t *model;
+ dp_model_t *model;
prvm_edict_t *ed;
if (sv.sententitiesconsideration[s->number] == sv.sententitiesmark)
return;
prvm_edict_t *ent;
int i;
char *entities;
- model_t *worldmodel;
+ dp_model_t *worldmodel;
char modelname[sizeof(sv.modelname)];
Con_DPrintf("SpawnServer: %s\n", server);
// matrices to transform into/out of other entity's space
matrix4x4_t matrix, imatrix;
// model of other entity
- model_t *model;
+ dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
prvm_edict_t *touchedicts[MAX_EDICTS];
// matrices to transform into/out of other entity's space
matrix4x4_t matrix, imatrix;
// model of other entity
- model_t *model;
+ dp_model_t *model;
unsigned int modelindex;
int frame;
// list of entities to test for collisions
*/
void SV_LinkEdict (prvm_edict_t *ent, qboolean touch_triggers)
{
- model_t *model;
+ dp_model_t *model;
vec3_t mins, maxs;
if (ent == prog->edicts)
int num_moved;
int numcheckentities;
static prvm_edict_t *checkentities[MAX_EDICTS];
- model_t *pushermodel;
+ dp_model_t *pushermodel;
trace_t trace;
matrix4x4_t pusherfinalmatrix, pusherfinalimatrix;
unsigned short moved_edicts[MAX_EDICTS];
static void VM_SV_setmodel (void)
{
prvm_edict_t *e;
- model_t *mod;
+ dp_model_t *mod;
int i;
VM_SAFEPARMCOUNT(2, VM_setmodel);
SV_FlushBroadcastMessages();
}
-void clippointtosurface(model_t *model, msurface_t *surface, vec3_t p, vec3_t out)
+void clippointtosurface(dp_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 model_t *getmodel(prvm_edict_t *ed)
+static dp_model_t *getmodel(prvm_edict_t *ed)
{
int modelindex;
if (!ed || ed->priv.server->free)
return sv.models[modelindex];
}
-static msurface_t *getsurface(model_t *model, int surfacenum)
+static msurface_t *getsurface(dp_model_t *model, int surfacenum)
{
if (surfacenum < 0 || surfacenum >= model->nummodelsurfaces)
return NULL;
//PF_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints = #434;
static void VM_SV_getsurfacenumpoints(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
VM_SAFEPARMCOUNT(2, VM_SV_getsurfacenumpoints);
// return 0 if no such surface
static void VM_SV_getsurfacepoint(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
int pointnum;
VM_SAFEPARMCOUNT(3, VM_SV_getsurfacepoint);
static void VM_SV_getsurfacepointattribute(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
int pointnum;
int attributetype;
//PF_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal = #436;
static void VM_SV_getsurfacenormal(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
vec3_t normal;
VM_SAFEPARMCOUNT(2, VM_SV_getsurfacenormal);
//PF_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture = #437;
static void VM_SV_getsurfacetexture(void)
{
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
VM_SAFEPARMCOUNT(2, VM_SV_getsurfacetexture);
PRVM_G_INT(OFS_RETURN) = OFS_NULL;
vec3_t clipped, p;
vec_t dist, bestdist;
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
vec_t *point;
VM_SAFEPARMCOUNT(2, VM_SV_getsurfacenearpoint);
static void VM_SV_getsurfaceclippedpoint(void)
{
prvm_edict_t *ed;
- model_t *model;
+ dp_model_t *model;
msurface_t *surface;
vec3_t p, out;
VM_SAFEPARMCOUNT(3, VM_SV_te_getsurfaceclippedpoint);
const char *tagname = PRVM_G_STRING(OFS_PARM2);
prvm_eval_t *v;
int modelindex;
- model_t *model;
+ dp_model_t *model;
VM_SAFEPARMCOUNT(3, VM_SV_setattachment);
if (e == prog->edicts)
int SV_GetTagIndex (prvm_edict_t *e, const char *tagname)
{
int i;
- model_t *model;
+ dp_model_t *model;
i = (int)e->fields.server->modelindex;
if (i < 1 || i >= MAX_MODELS)
{
int modelindex;
int frame;
- model_t *model;
+ dp_model_t *model;
if (tagindex >= 0
&& (modelindex = (int)ent->fields.server->modelindex) >= 1 && modelindex < MAX_MODELS
&& (model = sv.models[(int)ent->fields.server->modelindex])
prvm_eval_t *val;
int modelindex, attachloop;
matrix4x4_t entitymatrix, tagmatrix, attachmatrix;
- model_t *model;
+ dp_model_t *model;
*out = identitymatrix; // warnings and errors return identical matrix
static void VM_SV_setmodelindex (void)
{
prvm_edict_t *e;
- model_t *mod;
+ dp_model_t *mod;
int i;
VM_SAFEPARMCOUNT(2, VM_SV_setmodelindex);