#define MAX_SKINS 256
+typedef struct overridetagname_s
+{
+ char name[MAX_QPATH];
+}
+overridetagname_t;
+
+// a replacement set of tag names, per skin
+typedef struct overridetagnameset_s
+{
+ int num_overridetagnames;
+ overridetagname_t *data_overridetagnames;
+}
+overridetagnameset_t;
+
#define SHADOWMESHVERTEXHASH 1024
typedef struct shadowmeshvertexhash_s
{
shadowmesh_t;
+#include "matrixlib.h"
+
#include "model_brush.h"
#include "model_sprite.h"
#include "model_alias.h"
-#include "matrixlib.h"
-
typedef struct model_alias_s
{
// LordHavoc: Q2/ZYM model support
int aliasnum_meshes;
aliasmesh_t *aliasdata_meshes;
+ int aliasnum_tags;
+ int aliasnum_tagframes;
+ aliastag_t *aliasdata_tags;
+
// for Zymotic models
int zymnum_verts;
int zymnum_tris;
}
model_sprite_t;
+struct trace_s;
+
typedef struct model_brush_s
{
+ // true if this model is a HalfLife .bsp file
+ qboolean ishlbsp;
+ // string of entity definitions (.map format)
char *entities;
+ // number of submodels in this map (just used by server to know how many
+ // submodels to load)
+ int numsubmodels;
+ // common functions
+ void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, qbyte *out, int outsize);
+ int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, qbyte *pvsbuffer, int pvsbufferlength);
+ int (*BoxTouchingPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
+ void (*LightPoint)(struct model_s *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal);
void (*FindNonSolidLocation)(struct model_s *model, const vec3_t in, vec3_t out, vec_t radius);
- int (*PointContents)(struct model_s *model, const float *p);
- void (*TraceBox)(struct model_s *model, const vec3_t corigin, const vec3_t cangles, void *trace, const void *cent, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end);
+ void (*TraceBox)(struct model_s *model, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs);
+ // this is actually only found on brushq1, but NULL is handled gracefully
+ void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
}
model_brush_t;
typedef struct model_brushq1_s
{
- // true if this model is a HalfLife .bsp file
- qboolean ishlbsp;
-
int firstmodelsurface, nummodelsurfaces;
// lightmap format, set to r_lightmaprgba when model is loaded
int lightmaprgba;
- int numsubmodels;
dmodel_t *submodels;
int numplanes;
mplane_t *planes;
- // number of visible leafs, not counting 0 (solid)
+ // number of actual leafs (including 0 which is solid)
int numleafs;
+ // visible leafs, not counting 0 (solid)
+ int visleafs;
mleaf_t *leafs;
int numvertexes;
int numtextures;
texture_t *textures;
- qbyte *visdata;
+ int num_compressedpvs;
+ qbyte *data_compressedpvs;
+ qbyte *data_decompressedpvs;
+
+ int num_lightdata;
qbyte *lightdata;
int numportals;
float light_ambient;
mleaf_t *(*PointInLeaf)(struct model_s *model, const float *p);
- qbyte *(*LeafPVS)(struct model_s *model, mleaf_t *leaf);
void (*BuildPVSTextureChains)(struct model_s *model);
}
model_brushq1_t;
typedef struct q3mbrush_s
{
+ struct colbrushf_s *colbrushf;
int numbrushsides;
struct q3mbrushside_s *firstbrushside;
struct q3mtexture_s *texture;
int patchsize[2];
float *data_vertex3f;
- float *data_texturetexcoord2f;
- float *data_lightmaptexcoord2f;
+ float *data_texcoordtexture2f;
+ float *data_texcoordlightmap2f;
float *data_svector3f;
float *data_tvector3f;
float *data_normal3f;
int num_models;
q3mmodel_t *data_models;
// each submodel gets its own model struct so this is different for each.
- q3mmodel_t data_thismodel;
+ q3mmodel_t *data_thismodel;
int num_brushes;
q3mbrush_t *data_brushes;
int num_vertices;
float *data_vertex3f;
- float *data_texturetexcoord2f;
- float *data_lightmaptexcoord2f;
+ float *data_texcoordtexture2f;
+ float *data_texcoordlightmap2f;
float *data_svector3f;
float *data_tvector3f;
float *data_normal3f;
float radius2;
// skin animation info
animscene_t *skinscenes; // [numskins]
- // skin frame info
- skinframe_t *skinframes;
// skin animation info
animscene_t *animscenes; // [numframes]
// draw the model's sky polygons (only used by brush models)
model_brushq2_t brushq2;
*/
model_brushq3_t brushq3;
+ // skin files can have different tags for each skin
+ overridetagnameset_t *data_overridetagnamesforskin;
}
model_t;
int Mod_LoadSkinFrame(skinframe_t *skinframe, char *basename, int textureflags, int loadpantsandshirt, int usedetailtexture, int loadglowtexture);
int Mod_LoadSkinFrame_Internal(skinframe_t *skinframe, char *basename, int textureflags, int loadpantsandshirt, int usedetailtexture, int loadglowtexture, qbyte *skindata, int width, int height);
+extern cvar_t r_mipskins;
+
+typedef struct skinfileitem_s
+{
+ struct skinfileitem_s *next;
+ char name[MAX_QPATH];
+ char replacement[MAX_QPATH];
+}
+skinfileitem_t;
+
+typedef struct skinfile_s
+{
+ struct skinfile_s *next;
+ skinfileitem_t *items;
+}
+skinfile_t;
+
+skinfile_t *Mod_LoadSkinFiles(void);
+void Mod_FreeSkinFiles(skinfile_t *skinfile);
+int Mod_CountSkinFiles(skinfile_t *skinfile);
+
#endif // __MODEL__