made q3bsp alphafunc shaders render as transparent (quick hack)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 10 Nov 2004 06:02:18 +0000 (06:02 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 10 Nov 2004 06:02:18 +0000 (06:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4736 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c
model_shared.h

index 90b16e7..fe008d1 100644 (file)
@@ -3741,6 +3741,8 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l)
                                                                                else if (numparameters >= 3 && !strcasecmp(parameter[0], "animmap"))
                                                                                        strlcpy(firstpasstexturename, parameter[2], sizeof(firstpasstexturename));
                                                                        }
+                                                                       if (!strcasecmp(parameter[0], "alphafunc"))
+                                                                               flags2 |= Q3TEXTUREFLAG_ALPHATEST;
                                                                        // break out a level if it was }
                                                                        if (!strcasecmp(com_token, "}"))
                                                                                break;
@@ -3854,7 +3856,7 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l)
                                                // force transparent render path for a number of odd
                                                // shader effects to avoid bogging down the normal
                                                // render path unnecessarily
-                                               if (flags2 & (Q3TEXTUREFLAG_ADDITIVE | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2))
+                                               if (flags2 & (Q3TEXTUREFLAG_ADDITIVE | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2 | Q3TEXTUREFLAG_ALPHATEST))
                                                        flags |= Q3SURFACEPARM_TRANS;
                                                // add shader to list (shadername and flags)
                                                // actually here we just poke into the texture settings
index ddf9dce..b5ac7bb 100644 (file)
@@ -337,6 +337,7 @@ model_brushq2_t;
 #define Q3TEXTUREFLAG_NOPICMIP 8
 #define Q3TEXTUREFLAG_AUTOSPRITE 16
 #define Q3TEXTUREFLAG_AUTOSPRITE2 32
+#define Q3TEXTUREFLAG_ALPHATEST 64
 
 struct q3msurface_s;
 typedef struct q3mtexture_s