#ifndef MODEL_SHARED_H
#define MODEL_SHARED_H
-typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
+typedef enum synctype_e {ST_SYNC=0, ST_RAND } synctype_t;
/*
*/
-typedef enum {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3} modtype_t;
+typedef enum modtype_e {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3} modtype_t;
typedef struct animscene_s
{
{
TEXTURELAYERTYPE_INVALID,
TEXTURELAYERTYPE_SKY,
- TEXTURELAYERTYPE_LIGHTMAP_DOUBLEMODULATE_TEXTURE,
- TEXTURELAYERTYPE_LIGHTMAP,
+ TEXTURELAYERTYPE_LITTEXTURE_COMBINE,
+ TEXTURELAYERTYPE_LITTEXTURE_MULTIPASS,
+ TEXTURELAYERTYPE_LITTEXTURE_VERTEX,
TEXTURELAYERTYPE_TEXTURE,
- TEXTURELAYERTYPE_VERTEXTEXTURE,
TEXTURELAYERTYPE_FOG,
}
texturelayertype_t;
+typedef enum texturelayerflag_e
+{
+ // indicates that the pass should apply fog darkening; used on
+ // transparent surfaces where simply blending an alpha fog as a final
+ // pass would not behave properly, so all the surfaces must be darkened,
+ // and the fog color added as a separate pass
+ TEXTURELAYERFLAG_FOGDARKEN = 1,
+}
+texturelayerflag_t;
+
typedef struct texturelayer_s
{
texturelayertype_t type;
rtexture_t *texture;
matrix4x4_t texmatrix;
vec4_t color;
- int texrgbscale;
+ int flags;
}
texturelayer_t;
// current texture transform matrix (used for water scrolling)
matrix4x4_t currenttexmatrix;
- // this is either texture->skin.merged or texture->skin.base depending on colormapping
- rtexture_t *currentbasetexture;
- // color to use on the base layer (use instead of ent->colormod and ent->alpha)
- vec4_t currentcolorbase;
- // color to use on the pants layer
- vec4_t currentcolorpants;
- // color to use on the shirt layer
- vec4_t currentcolorshirt;
- // render pants layer
- qboolean currentdopants;
- // render shirt layer
- qboolean currentdoshirt;
- // render pants as fullbright
- qboolean currentdofullbrightpants;
- // render shirt as fullbright
- qboolean currentdofullbrightshirt;
- // indicates that all passes should apply fog darkening; used on
- // transparent surfaces where simply blending an alpha fog as a final
- // pass would not behave properly
- qboolean currentfogallpasses;
-
int currentnumlayers;
texturelayer_t currentlayers[16];
}
texture_t;
-typedef struct
+typedef struct mtexinfo_s
{
float vecs[2][4];
texture_t *texture;
{
// texture mapping properties used by this surface
mtexinfo_t *texinfo; // q1bsp
- // index into d_lightstylevalue array, 255 means not used (black)
+ // index into r_refdef.lightstylevalue array, 255 means not used (black)
qbyte styles[MAXLIGHTMAPS]; // q1bsp
// RGB lighting data [numstyles][height][width][3]
qbyte *samples; // q1bsp
int (*BoxTouchingPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
int (*BoxTouchingLeafPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
int (*BoxTouchingVisibleLeafs)(struct model_s *model, const qbyte *visibleleafs, const vec3_t mins, const vec3_t maxs);
+ int (*FindBoxClusters)(struct model_s *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist);
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);
mleaf_t *(*PointInLeaf)(struct model_s *model, const float *p);
// draw a shadow volume for the model based on light source
void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
// draw the lighting on a model (through stencil)
- void(*DrawLight)(struct entity_render_s *ent, float *lightcolor, int numsurfaces, const int *surfacelist);
+ void(*DrawLight)(struct entity_render_s *ent, vec3_t lightcolorbase, vec3_t lightcolorpants, vec3_t lightcolorshirt, int numsurfaces, const int *surfacelist);
// trace a box against this model
void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask);
// fields belonging to some types of model
extern cvar_t r_fullbrights;
void Mod_Init (void);
-#define Mod_CheckLoaded(mod) (mod ? (mod->loaded ? (mod->used = true) : (Mod_LoadModel(mod, true, true, mod->isworldmodel), true)) : false)
model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
void Mod_ClearAll (void);
model_t *Mod_FindName (const char *name);
void Mod_ClearUsed(void);
void Mod_PurgeUnused(void);
void Mod_RemoveStaleWorldModels(model_t *skip); // only used during loading!
-void Mod_LoadModels(void);
extern model_t *loadmodel;
extern char loadname[32]; // for hunk tags
void R_Q1BSP_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, qbyte *outleafpvs, int *outnumleafspointer, int *outsurfacelist, qbyte *outsurfacepvs, int *outnumsurfacespointer);
void R_Q1BSP_CompileShadowVolume(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist);
void R_Q1BSP_DrawShadowVolume(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
-void R_Q1BSP_DrawLight(struct entity_render_s *ent, float *lightcolor, int numsurfaces, const int *surfacelist);
+void R_Q1BSP_DrawLight(struct entity_render_s *ent, vec3_t lightcolorbase, vec3_t lightcolorpants, vec3_t lightcolorshirt, int numsurfaces, const int *surfacelist);
// alias models
struct frameblend_s;