]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
Fix most Q3 & QL glow maps
[xonotic/darkplaces.git] / model_shared.h
index b21bbf4b65eaf7ac692e40802d9e9ce160e49a19..62bbd7dc878406b0f638382cff969949be94ec65 100644 (file)
@@ -485,27 +485,6 @@ typedef struct texture_shaderpass_s
 }
 texture_shaderpass_t;
 
-typedef enum texturelayertype_e
-{
-       TEXTURELAYERTYPE_INVALID,
-       TEXTURELAYERTYPE_LITTEXTURE,
-       TEXTURELAYERTYPE_TEXTURE,
-       TEXTURELAYERTYPE_FOG
-}
-texturelayertype_t;
-
-typedef struct texturelayer_s
-{
-       texturelayertype_t type;
-       qboolean depthmask;
-       int blendfunc1;
-       int blendfunc2;
-       rtexture_t *texture;
-       matrix4x4_t texmatrix;
-       vec4_t color;
-}
-texturelayer_t;
-
 typedef struct texture_s
 {
        // q1bsp
@@ -547,6 +526,12 @@ typedef struct texture_s
        void *update_lastrenderentity;
        // the current alpha of this texture (may be affected by r_wateralpha, also basealpha, and ent->alpha)
        float currentalpha;
+       // current value of blendfunc - one of:
+       // {GL_SRC_ALPHA, GL_ONE}
+       // {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}
+       // {customblendfunc[0], customblendfunc[1]}
+       // {GL_ONE, GL_ZERO}
+       int currentblendfunc[2];
        // the current texture frame in animation
        struct texture_s *currentframe;
        // current texture transform matrix (used for water scrolling)
@@ -604,9 +589,6 @@ typedef struct texture_s
        // from q3 shaders
        int customblendfunc[2];
 
-       int currentnumlayers;
-       texturelayer_t currentlayers[16];
-
        // q3bsp
        char name[64];
        int surfaceflags;
@@ -649,6 +631,11 @@ typedef struct texture_s
 
        // diffuse and ambient
        float rtlightambient;
+
+       // used by Mod_Mesh_GetTexture for drawflag and materialflag overrides, to disambiguate the same texture with different hints
+       int mesh_drawflag;
+       int mesh_defaulttexflags;
+       int mesh_defaultmaterialflags;
 }
  texture_t;
 
@@ -1228,7 +1215,7 @@ void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *
 void Mod_Mesh_Create(dp_model_t *mod, const char *name);
 void Mod_Mesh_Destroy(dp_model_t *mod);
 void Mod_Mesh_Reset(dp_model_t *mod);
-texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int addmaterialflags);
+texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags);
 msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qboolean batchwithprevioussurface);
 int Mod_Mesh_IndexForVertex(dp_model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a);
 void Mod_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int e2);