]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
changed several DPrint's and developer cvar checks to higher developer cvar levels...
[xonotic/darkplaces.git] / model_shared.h
index 4af1f029767c35be4ab9b21504f3bb416e5a9d0f..85c6d970f7dbb066a3b08c164e863ccb1e26ac1b 100644 (file)
@@ -144,7 +144,6 @@ shadowmesh_t;
 typedef enum texturelayertype_e
 {
        TEXTURELAYERTYPE_INVALID,
-       TEXTURELAYERTYPE_SKY,
        TEXTURELAYERTYPE_LITTEXTURE_COMBINE,
        TEXTURELAYERTYPE_LITTEXTURE_MULTIPASS,
        TEXTURELAYERTYPE_LITTEXTURE_VERTEX,
@@ -203,11 +202,19 @@ typedef struct texture_s
        // (this is an optimization in the renderer)
        int animated;
 
+       // the current alpha of this texture (may be affected by r_wateralpha)
+       float currentalpha;
        // the current texture frame in animation
        struct texture_s *currentframe;
        // current texture transform matrix (used for water scrolling)
        matrix4x4_t currenttexmatrix;
 
+       qboolean colormapping;
+       rtexture_t *basetexture;
+       rtexture_t *glosstexture;
+       float specularscale;
+       float specularpower;
+
        int currentnumlayers;
        texturelayer_t currentlayers[16];
 
@@ -241,10 +248,9 @@ typedef struct msurface_lightmapinfo_s
        unsigned char *samples; // q1bsp
        // stain to apply on lightmap (soot/dirt/blood/whatever)
        unsigned char *stainsamples; // q1bsp
-       // the stride when building lightmaps to comply with fragment update
-       int lightmaptexturestride; // q1bsp
        int texturemins[2]; // q1bsp
        int extents[2]; // q1bsp
+       int lightmaporigin[2]; // q1bsp
 }
 msurface_lightmapinfo_t;
 
@@ -258,6 +264,8 @@ typedef struct msurface_s
        texture_t *texture;
        // the lightmap texture fragment to use on the rendering mesh
        rtexture_t *lightmaptexture;
+       // the lighting direction texture fragment to use on the rendering mesh
+       rtexture_t *deluxemaptexture;
 
        // this surface is part of this mesh
        surfmesh_t *groupmesh;
@@ -375,10 +383,14 @@ typedef struct model_brush_s
        void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, unsigned char *out, int outsize);
        void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
 
-       char skybox[64];
+       char skybox[MAX_QPATH];
 
        rtexture_t *solidskytexture;
        rtexture_t *alphaskytexture;
+
+       // QuakeWorld
+       int qw_md4sum;
+       int qw_md4sum2;
 }
 model_brush_t;
 
@@ -412,9 +424,6 @@ typedef struct model_brushq1_s
        int                             num_lightdata;
        unsigned char                   *lightdata;
 
-       int                             numlights;
-       mlight_t                *lights;
-
        // lightmap update chains for light styles
        int                             light_styles;
        unsigned char                   *light_style;
@@ -469,6 +478,14 @@ typedef struct model_brushq3_s
        int num_lightgrid_dimensions[3];
        // transform modelspace coordinates to lightgrid index
        matrix4x4_t num_lightgrid_indexfromworld;
+
+       // true if this q3bsp file has been detected as using deluxemapping
+       // (lightmap texture pairs, every odd one is never directly refernced,
+       //  and contains lighting normals, not colors)
+       qboolean deluxemapping;
+       // true if the detected deluxemaps are the modelspace kind, rather than
+       // the faster tangentspace kind
+       qboolean deluxemapping_modelspace;
 }
 model_brushq3_t;
 
@@ -555,9 +572,9 @@ typedef struct model_s
        // 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, vec3_t lightcolorbase, vec3_t lightcolorpants, vec3_t lightcolorshirt, int numsurfaces, const int *surfacelist);
+       void(*DrawLight)(struct entity_render_s *ent, 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);
+       void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask);
        // fields belonging to some types of model
        model_sprite_t  sprite;
        model_brush_t   brush;
@@ -585,7 +602,6 @@ extern cvar_t r_fullbrights;
 
 void Mod_Init (void);
 model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
-void Mod_ClearAll (void);
 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);
@@ -615,8 +631,8 @@ shadowmesh_t *Mod_ShadowMesh_Finish(mempool_t *mempool, shadowmesh_t *firstmesh,
 void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius);
 void Mod_ShadowMesh_Free(shadowmesh_t *mesh);
 
-int Mod_LoadSkinFrame(skinframe_t *skinframe, char *basename, int textureflags, int loadpantsandshirt, int loadglowtexture);
-int Mod_LoadSkinFrame_Internal(skinframe_t *skinframe, char *basename, int textureflags, int loadpantsandshirt, int loadglowtexture, unsigned char *skindata, int width, int height);
+int Mod_LoadSkinFrame(skinframe_t *skinframe, const char *basename, int textureflags, int loadpantsandshirt, int loadglowtexture);
+int Mod_LoadSkinFrame_Internal(skinframe_t *skinframe, const char *basename, int textureflags, int loadpantsandshirt, int loadglowtexture, const unsigned char *skindata, int width, int height, int bitsperpixel, const unsigned int *palette, const unsigned int *alphapalette);
 
 extern cvar_t r_mipskins;
 
@@ -655,7 +671,7 @@ void R_Q1BSP_Draw(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);
 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, vec3_t lightcolorbase, vec3_t lightcolorpants, vec3_t lightcolorshirt, int numsurfaces, const int *surfacelist);
+void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist);
 
 // alias models
 struct frameblend_s;