renamed model_t to qmodel_t in order to avoid conflicts on solaris.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@676 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-05-30 08:56:06 +00:00
parent 614270110e
commit dbdd675552
21 changed files with 70 additions and 71 deletions

View file

@ -405,7 +405,7 @@ relinked. Other attributes can change without relinking.
void CL_ParseUpdate (int bits)
{
int i;
model_t *model;
qmodel_t *model;
int modnum;
qboolean forcelink;
entity_t *ent;

View file

@ -55,7 +55,7 @@ void CL_InitTEnts (void)
CL_ParseBeam
=================
*/
void CL_ParseBeam (model_t *m)
void CL_ParseBeam (qmodel_t *m)
{
int ent;
vec3_t start, end;

View file

@ -79,7 +79,7 @@ typedef struct
typedef struct
{
int entity;
struct model_s *model;
struct qmodel_s *model;
float endtime;
vec3_t start, end;
} beam_t;
@ -197,7 +197,7 @@ typedef struct
//
// information that is static for the entire time connected to a server
//
struct model_s *model_precache[MAX_MODELS];
struct qmodel_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS];
char mapname[128];
@ -207,7 +207,7 @@ typedef struct
int gametype;
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct qmodel_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_entities; // held in cl_entities array
int num_statics; // held in cl_staticentities array

View file

@ -33,7 +33,7 @@ ALIAS MODEL DISPLAY LIST GENERATION
=================================================================
*/
model_t *aliasmodel;
qmodel_t *aliasmodel;
aliashdr_t *paliashdr;
int used[8192]; // qboolean
@ -294,7 +294,7 @@ void BuildTris (void)
GL_MakeAliasModelDisplayLists
================
*/
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
void GL_MakeAliasModelDisplayLists (qmodel_t *m, aliashdr_t *hdr)
{
int i, j;
int *cmds;
@ -312,7 +312,6 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m);
//johnfitz -- generate meshes
Con_DPrintf ("meshing %s...\n",m->name);
BuildTris ();

View file

@ -26,20 +26,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
model_t *loadmodel;
qmodel_t *loadmodel;
char loadname[32]; // for hunk tags
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
void Mod_LoadBrushModel (model_t *mod, void *buffer);
void Mod_LoadAliasModel (model_t *mod, void *buffer);
model_t *Mod_LoadModel (model_t *mod, qboolean crash);
void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer);
void Mod_LoadBrushModel (qmodel_t *mod, void *buffer);
void Mod_LoadAliasModel (qmodel_t *mod, void *buffer);
qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash);
cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE};
byte mod_novis[MAX_MAP_LEAFS/8];
#define MAX_MOD_KNOWN 2048 //johnfitz -- was 512
model_t mod_known[MAX_MOD_KNOWN];
#define MAX_MOD_KNOWN 2048 /*johnfitz -- was 512 */
qmodel_t mod_known[MAX_MOD_KNOWN];
int mod_numknown;
texture_t *r_notexture_mip; //johnfitz -- moved here from r_main.c
@ -75,7 +75,7 @@ Mod_Extradata
Caches the data if needed
===============
*/
void *Mod_Extradata (model_t *mod)
void *Mod_Extradata (qmodel_t *mod)
{
void *r;
@ -95,7 +95,7 @@ void *Mod_Extradata (model_t *mod)
Mod_PointInLeaf
===============
*/
mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
mleaf_t *Mod_PointInLeaf (vec3_t p, qmodel_t *model)
{
mnode_t *node;
float d;
@ -126,7 +126,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
Mod_DecompressVis
===================
*/
byte *Mod_DecompressVis (byte *in, model_t *model)
byte *Mod_DecompressVis (byte *in, qmodel_t *model)
{
static byte decompressed[MAX_MAP_LEAFS/8];
int c;
@ -170,7 +170,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
return decompressed;
}
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model)
byte *Mod_LeafPVS (mleaf_t *leaf, qmodel_t *model)
{
if (leaf == model->leafs)
return mod_novis;
@ -185,7 +185,7 @@ Mod_ClearAll
void Mod_ClearAll (void)
{
int i;
model_t *mod;
qmodel_t *mod;
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
if (mod->type != mod_alias)
@ -201,10 +201,10 @@ Mod_FindName
==================
*/
model_t *Mod_FindName (const char *name)
qmodel_t *Mod_FindName (const char *name)
{
int i;
model_t *mod;
qmodel_t *mod;
if (!name[0])
Sys_Error ("Mod_FindName: NULL name"); //johnfitz -- was "Mod_ForName"
@ -236,7 +236,7 @@ Mod_TouchModel
*/
void Mod_TouchModel (const char *name)
{
model_t *mod;
qmodel_t *mod;
mod = Mod_FindName (name);
@ -254,7 +254,7 @@ Mod_LoadModel
Loads a model into the cache
==================
*/
model_t *Mod_LoadModel (model_t *mod, qboolean crash)
qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash)
{
byte *buf;
byte stackbuf[1024]; // avoid dirtying the cache heap
@ -330,9 +330,9 @@ Mod_ForName
Loads in a model for the given name
==================
*/
model_t *Mod_ForName (const char *name, qboolean crash)
qmodel_t *Mod_ForName (const char *name, qboolean crash)
{
model_t *mod;
qmodel_t *mod;
mod = Mod_FindName (name);
@ -1519,7 +1519,7 @@ Therefore, the bounding box of the hull can be constructed entirely
from axial planes found in the clipnodes for that hull.
=================
*/
void Mod_BoundsFromClipNode (model_t *mod, int hull, int nodenum)
void Mod_BoundsFromClipNode (qmodel_t *mod, int hull, int nodenum)
{
mplane_t *plane;
mclipnode_t *node;
@ -1564,7 +1564,7 @@ void Mod_BoundsFromClipNode (model_t *mod, int hull, int nodenum)
Mod_LoadBrushModel
=================
*/
void Mod_LoadBrushModel (model_t *mod, void *buffer)
void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
{
int i, j;
dheader_t *header;
@ -2013,7 +2013,7 @@ void Mod_CalcAliasBounds (aliashdr_t *a)
Mod_SetExtraFlags -- johnfitz -- set up extra flags that aren't in the mdl
=================
*/
void Mod_SetExtraFlags (model_t *mod)
void Mod_SetExtraFlags (qmodel_t *mod)
{
extern cvar_t r_nolerp_list;
const char *s;
@ -2070,7 +2070,7 @@ void Mod_SetExtraFlags (model_t *mod)
Mod_LoadAliasModel
=================
*/
void Mod_LoadAliasModel (model_t *mod, void *buffer)
void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
{
int i, j;
mdl_t *pinmodel;
@ -2328,7 +2328,7 @@ void * Mod_LoadSpriteGroup (void * pin, mspriteframe_t **ppframe, int framenum)
Mod_LoadSpriteModel
=================
*/
void Mod_LoadSpriteModel (model_t *mod, void *buffer)
void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer)
{
int i;
int version;
@ -2408,7 +2408,7 @@ Mod_Print
void Mod_Print (void)
{
int i;
model_t *mod;
qmodel_t *mod;
Con_SafePrintf ("Cached models:\n"); //johnfitz -- safeprint instead of print
for (i=0, mod=mod_known ; i < mod_numknown ; i++, mod++)

View file

@ -361,7 +361,7 @@ typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
#define MOD_FBRIGHTHACK 1024 //when fullbrights are disabled, use a hack to render this model brighter
//johnfitz
typedef struct model_s
typedef struct qmodel_s
{
char name[MAX_QPATH];
unsigned int path_id; // path id of the game directory
@ -440,19 +440,19 @@ typedef struct model_s
//
cache_user_t cache; // only access through Mod_Extradata
} model_t;
} qmodel_t;
//============================================================================
void Mod_Init (void);
void Mod_ClearAll (void);
model_t *Mod_ForName (const char *name, qboolean crash);
void *Mod_Extradata (model_t *mod); // handles caching
qmodel_t *Mod_ForName (const char *name, qboolean crash);
void *Mod_Extradata (qmodel_t *mod); // handles caching
void Mod_TouchModel (const char *name);
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
mleaf_t *Mod_PointInLeaf (float *p, qmodel_t *model);
byte *Mod_LeafPVS (mleaf_t *leaf, qmodel_t *model);
void Mod_SetExtraFlags (model_t *mod);
void Mod_SetExtraFlags (qmodel_t *mod);
#endif // __MODEL__

View file

@ -190,7 +190,7 @@ R_AddEfrags
*/
void R_AddEfrags (entity_t *ent)
{
model_t *entmodel;
qmodel_t *entmodel;
int i;
if (!ent->model)

View file

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
float Fog_GetDensity(void);
float *Fog_GetColor(void);
extern model_t *loadmodel;
extern qmodel_t *loadmodel;
extern int rs_skypolys; //for r_speeds readout
extern int rs_skypasses; //for r_speeds readout
float skyflatcolor[3];

View file

@ -300,7 +300,7 @@ float TexMgr_FrameUsage (void)
TexMgr_FindTexture
================
*/
gltexture_t *TexMgr_FindTexture (model_t *owner, const char *name)
gltexture_t *TexMgr_FindTexture (qmodel_t *owner, const char *name)
{
gltexture_t *glt;
@ -405,7 +405,7 @@ void TexMgr_FreeTextures (unsigned int flags, unsigned int mask)
TexMgr_FreeTexturesForOwner
================
*/
void TexMgr_FreeTexturesForOwner (model_t *owner)
void TexMgr_FreeTexturesForOwner (qmodel_t *owner)
{
gltexture_t *glt, *next;
@ -1147,7 +1147,7 @@ static void TexMgr_LoadLightmap (gltexture_t *glt, byte *data)
TexMgr_LoadImage -- the one entry point for loading all textures
================
*/
gltexture_t *TexMgr_LoadImage (model_t *owner, const char *name, int width, int height, enum srcformat format,
gltexture_t *TexMgr_LoadImage (qmodel_t *owner, const char *name, int width, int height, enum srcformat format,
byte *data, const char *source_file, src_offset_t source_offset, unsigned flags)
{
unsigned short crc;

View file

@ -46,7 +46,7 @@ typedef struct gltexture_s {
//managed by texture manager
GLuint texnum;
struct gltexture_s *next;
model_t *owner;
qmodel_t *owner;
//managed by image loading
char name[64];
unsigned int width; //size of image as it exists in opengl
@ -77,16 +77,16 @@ extern unsigned int d_8to24table_pants[256];
// TEXTURE MANAGER
float TexMgr_FrameUsage (void);
gltexture_t *TexMgr_FindTexture (model_t *owner, const char *name);
gltexture_t *TexMgr_FindTexture (qmodel_t *owner, const char *name);
gltexture_t *TexMgr_NewTexture (void);
void TexMgr_FreeTexture (gltexture_t *kill);
void TexMgr_FreeTextures (unsigned int flags, unsigned int mask);
void TexMgr_FreeTexturesForOwner (model_t *owner);
void TexMgr_FreeTexturesForOwner (qmodel_t *owner);
void TexMgr_NewGame (void);
void TexMgr_Init (void);
// IMAGE LOADING
gltexture_t *TexMgr_LoadImage (model_t *owner, const char *name, int width, int height, enum srcformat format,
gltexture_t *TexMgr_LoadImage (qmodel_t *owner, const char *name, int width, int height, enum srcformat format,
byte *data, const char *source_file, src_offset_t source_offset, unsigned flags);
void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants);
void TexMgr_ReloadImages (void);

View file

@ -45,7 +45,7 @@ float turbsin[] =
//
//==============================================================================
extern model_t *loadmodel;
extern qmodel_t *loadmodel;
msurface_t *warpface;

View file

@ -297,7 +297,7 @@ void GL_DrawAliasShadow (entity_t *e);
void DrawGLTriangleFan (glpoly_t *p);
void DrawGLPoly (glpoly_t *p);
void DrawWaterPoly (glpoly_t *p);
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr);
void GL_MakeAliasModelDisplayLists (qmodel_t *m, aliashdr_t *hdr);
void Sky_Init (void);
void Sky_DrawSky (void);

View file

@ -2068,7 +2068,7 @@ Host_Viewmodel_f
void Host_Viewmodel_f (void)
{
edict_t *e;
model_t *m;
qmodel_t *m;
e = FindViewthing ();
if (!e)
@ -2094,7 +2094,7 @@ void Host_Viewframe_f (void)
{
edict_t *e;
int f;
model_t *m;
qmodel_t *m;
e = FindViewthing ();
if (!e)
@ -2109,7 +2109,7 @@ void Host_Viewframe_f (void)
}
void PrintFrameName (model_t *m, int frame)
void PrintFrameName (qmodel_t *m, int frame)
{
aliashdr_t *hdr;
maliasframedesc_t *pframedesc;
@ -2130,7 +2130,7 @@ Host_Viewnext_f
void Host_Viewnext_f (void)
{
edict_t *e;
model_t *m;
qmodel_t *m;
e = FindViewthing ();
if (!e)
@ -2152,7 +2152,7 @@ Host_Viewprev_f
void Host_Viewprev_f (void)
{
edict_t *e;
model_t *m;
qmodel_t *m;
e = FindViewthing ();
if (!e)

View file

@ -265,7 +265,7 @@ static void PF_setmodel (void)
{
int i;
const char *m, **check;
model_t *mod;
qmodel_t *mod;
edict_t *e;
e = G_EDICT(OFS_PARM0);

View file

@ -505,7 +505,7 @@ void R_DrawBrushModel (entity_t *e)
msurface_t *psurf;
float dot;
mplane_t *pplane;
model_t *clmodel;
qmodel_t *clmodel;
if (R_CullModelForEntity(e))
return;
@ -598,7 +598,7 @@ void R_DrawBrushModel_ShowTris (entity_t *e)
msurface_t *psurf;
float dot;
mplane_t *pplane;
model_t *clmodel;
qmodel_t *clmodel;
glpoly_t *p;
if (R_CullModelForEntity(e))
@ -761,7 +761,7 @@ int AllocBlock (int w, int h, int *x, int *y)
mvertex_t *r_pcurrentvertbase;
model_t *currentmodel;
qmodel_t *currentmodel;
int nColinElim;
@ -873,7 +873,7 @@ void GL_BuildLightmaps (void)
char name[16];
byte *data;
int i, j;
model_t *m;
qmodel_t *m;
memset (allocated, 0, sizeof(allocated));
@ -1156,7 +1156,7 @@ R_RebuildAllLightmaps -- johnfitz -- called when gl_overbright gets toggled
void R_RebuildAllLightmaps (void)
{
int i, j;
model_t *mod;
qmodel_t *mod;
msurface_t *fa;
byte *base;

View file

@ -27,7 +27,7 @@ extern cvar_t gl_fullbrights, r_drawflat, gl_overbright, r_oldwater, r_oldskylea
extern glpoly_t *lightmap_polys[MAX_LIGHTMAPS];
byte *SV_FatPVS (vec3_t org, model_t *worldmodel);
byte *SV_FatPVS (vec3_t org, qmodel_t *worldmodel);
extern byte mod_novis[MAX_MAP_LEAFS/8];
int vis_changed; //if true, force pvs to be refreshed

View file

@ -60,7 +60,7 @@ typedef struct entity_s
vec3_t origin;
vec3_t msg_angles[2]; // last two updates (0 is newest)
vec3_t angles;
struct model_s *model; // NULL = no model
struct qmodel_s *model; // NULL = no model
struct efrag_s *efrag; // linked list of efrags
int frame;
float syncbase; // for client-side animations

View file

@ -51,9 +51,9 @@ typedef struct
char name[64]; // map name
char modelname[64]; // maps/<name>.bsp, for model_precache[0]
struct model_s *worldmodel;
struct qmodel_s *worldmodel;
const char *model_precache[MAX_MODELS]; // NULL terminated
struct model_s *models[MAX_MODELS];
struct qmodel_s *models[MAX_MODELS];
const char *sound_precache[MAX_SOUNDS]; // NULL terminated
const char *lightstyles[MAX_LIGHTSTYLES];
int num_edicts;

View file

@ -432,7 +432,7 @@ crosses a waterline.
int fatbytes;
byte fatpvs[MAX_MAP_LEAFS/8];
void SV_AddToFatPVS (vec3_t org, mnode_t *node, model_t *worldmodel) //johnfitz -- added worldmodel as a parameter
void SV_AddToFatPVS (vec3_t org, mnode_t *node, qmodel_t *worldmodel) //johnfitz -- added worldmodel as a parameter
{
int i;
byte *pvs;
@ -475,7 +475,7 @@ Calculates a PVS that is the inclusive or of all leafs within 8 pixels of the
given point.
=============
*/
byte *SV_FatPVS (vec3_t org, model_t *worldmodel) //johnfitz -- added worldmodel as a parameter
byte *SV_FatPVS (vec3_t org, qmodel_t *worldmodel) //johnfitz -- added worldmodel as a parameter
{
fatbytes = (worldmodel->numleafs+31)>>3;
Q_memset (fatpvs, 0, fatbytes);
@ -490,7 +490,7 @@ SV_VisibleToClient -- johnfitz
PVS test encapsulated in a nice function
=============
*/
qboolean SV_VisibleToClient (edict_t *client, edict_t *test, model_t *worldmodel)
qboolean SV_VisibleToClient (edict_t *client, edict_t *test, qmodel_t *worldmodel)
{
byte *pvs;
vec3_t org;

View file

@ -130,7 +130,7 @@ testing object's origin to get a point to use with the returned hull.
*/
hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
{
model_t *model;
qmodel_t *model;
vec3_t size;
vec3_t hullmins, hullmaxs;
hull_t *hull;

View file

@ -874,10 +874,10 @@ void Cache_Free (cache_user_t *c, qboolean freetextures) //johnfitz -- added sec
Cache_UnlinkLRU (cs);
//johnfitz -- if a model becomes uncached, free the gltextures. This only works
//becuase the cache_user_t is the last component of the model_t struct. Should
//becuase the cache_user_t is the last component of the qmodel_t struct. Should
//fail harmlessly if *c is actually part of an sfx_t struct. I FEEL DIRTY
if (freetextures)
TexMgr_FreeTexturesForOwner ((model_t *)(c + 1) - 1);
TexMgr_FreeTexturesForOwner ((qmodel_t *)(c + 1) - 1);
}