TRANSPARENTSORT_HUD,
}dptransparentsortcategory_t;
-typedef struct q3shaderinfo_s
+typedef struct shader_s
{
char name[Q3PATHLENGTH];
#define Q3SHADERINFO_COMPARE_START surfaceparms
float rtlightambient;
#define Q3SHADERINFO_COMPARE_END rtlightambient
}
-q3shaderinfo_t;
+shader_t;
typedef struct texture_shaderpass_s
{
// MATERIALFLAG_MODELLIGHT uses these parameters
float render_modellight_ambient[3];
float render_modellight_diffuse[3];
- float render_modellight_lightdir[3];
+ float render_modellight_lightdir_world[3];
+ float render_modellight_lightdir_local[3];
float render_modellight_specular[3];
// lightmap rendering (not MATERIALFLAG_MODELLIGHT)
float render_lightmap_ambient[3];
// if set, the model contains light information (lightmap, or vertexlight)
qboolean lit;
float lightmapscale;
+
+ qboolean nolerp;
}
dp_model_t;
// model loading
extern dp_model_t *loadmodel;
extern unsigned char *mod_base;
+
+typedef struct modloader_s
+{
+ char *extension;
+ char *header;
+ size_t headersize; // The header might not be NULL terminated
+ void (*Load)(dp_model_t *, void *, void *);
+} modloader_t;
+
// sky/water subdivision
//extern cvar_t gl_subdivide_size;
// texture fullbrights
extern cvar_t mod_q3bsp_lightgrid_world_surfaces;
extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces;
-void Mod_Init_Commands (void);
void Mod_Init (void);
void Mod_Reload (void);
dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk);
void Mod_FreeQ3Shaders(void);
void Mod_LoadQ3Shaders(void);
-q3shaderinfo_t *Mod_LookupQ3Shader(const char *name);
+shader_t *Mod_LookupQ3Shader(const char *name);
qboolean Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags, int defaultmaterialflags);
texture_shaderpass_t *Mod_CreateShaderPass(mempool_t *mempool, skinframe_t *skinframe);
texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(mempool_t *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename);
// a lot of model formats use the Q1BSP code, so here are the prototypes...
struct entity_render_s;
-void R_Q1BSP_DrawAddWaterPlanes(struct entity_render_s *ent);
-void R_Q1BSP_DrawSky(struct entity_render_s *ent);
-void R_Q1BSP_Draw(struct entity_render_s *ent);
-void R_Q1BSP_DrawDepth(struct entity_render_s *ent);
-void R_Q1BSP_DrawDebug(struct entity_render_s *ent);
-void R_Q1BSP_DrawPrepass(struct entity_render_s *ent);
-void R_Q1BSP_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion);
-void R_Q1BSP_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
-void R_Q1BSP_DrawShadowMap(int side, struct entity_render_s *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);
-void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
+void R_Mod_DrawAddWaterPlanes(struct entity_render_s *ent);
+void R_Mod_DrawSky(struct entity_render_s *ent);
+void R_Mod_Draw(struct entity_render_s *ent);
+void R_Mod_DrawDepth(struct entity_render_s *ent);
+void R_Mod_DrawDebug(struct entity_render_s *ent);
+void R_Mod_DrawPrepass(struct entity_render_s *ent);
+void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion);
+void R_Mod_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
+void R_Mod_DrawShadowMap(int side, struct entity_render_s *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);
+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_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);