]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
actually USE surfaceparms parsed from the shaders (when on models)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Nov 2011 14:14:27 +0000 (14:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Nov 2011 14:14:27 +0000 (14:14 +0000)
the old code loaded them but never converted them from "parms" to "flags", which is the only ones the engine uses

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11560 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.h
model_shared.c
model_shared.h

index 906594ad4c893db4dc623ca2e12c10151c435070..f1b60e0e7dc15b79a80eb01f1a99e4259316345b 100644 (file)
@@ -638,17 +638,17 @@ q3dpvs_t;
 #define Q3SURFACEFLAG_NODAMAGE 1
 #define Q3SURFACEFLAG_SLICK 2
 #define Q3SURFACEFLAG_SKY 4
-#define Q3SURFACEFLAG_LADDER 8
+#define Q3SURFACEFLAG_LADDER 8 // has no surfaceparm
 #define Q3SURFACEFLAG_NOIMPACT 16
 #define Q3SURFACEFLAG_NOMARKS 32
-#define Q3SURFACEFLAG_FLESH 64
+#define Q3SURFACEFLAG_FLESH 64 // has no surfaceparm
 #define Q3SURFACEFLAG_NODRAW 128
 #define Q3SURFACEFLAG_HINT 256
-#define Q3SURFACEFLAG_SKIP 512
+#define Q3SURFACEFLAG_SKIP 512 // has no surfaceparm
 #define Q3SURFACEFLAG_NOLIGHTMAP 1024
 #define Q3SURFACEFLAG_POINTLIGHT 2048
 #define Q3SURFACEFLAG_METALSTEPS 4096
-#define Q3SURFACEFLAG_NOSTEPS 8192
+#define Q3SURFACEFLAG_NOSTEPS 8192 // has no surfaceparm
 #define Q3SURFACEFLAG_NONSOLID 16384
 #define Q3SURFACEFLAG_LIGHTFILTER 32768
 #define Q3SURFACEFLAG_ALPHASHADOW 65536
index 1ebd90cd7308093cdca2a3f9db0521aa9761cd02..2afe928b13d5daee77c506d932ce7f34550f1ea3 100644 (file)
@@ -2442,7 +2442,6 @@ qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qbool
        {
                if (developer_loading.integer)
                        Con_Printf("%s: loaded shader for %s\n", loadmodel->name, name);
-               texture->surfaceparms = shader->surfaceparms;
 
                // allow disabling of picmip or compression by defaulttexflags
                texture->textureflags = (shader->textureflags & texflagsmask) | texflagsor;
@@ -2631,6 +2630,40 @@ nothing                GL_ZERO GL_ONE
        //      if (shader->surfaceparms & Q3SURFACEPARM_LIGHTGRID    ) texture->supercontents |= SUPERCONTENTS_LIGHTGRID    ;
        //      if (shader->surfaceparms & Q3SURFACEPARM_ANTIPORTAL   ) texture->supercontents |= SUPERCONTENTS_ANTIPORTAL   ;
 
+               texture->surfaceflags = 0;
+               if (shader->surfaceparms & Q3SURFACEPARM_ALPHASHADOW  ) texture->surfaceflags |= Q3SURFACEFLAG_ALPHASHADOW  ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_AREAPORTAL   ) texture->surfaceflags |= Q3SURFACEFLAG_AREAPORTAL   ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_CLUSTERPORTAL) texture->surfaceflags |= Q3SURFACEFLAG_CLUSTERPORTAL;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_DETAIL       ) texture->surfaceflags |= Q3SURFACEFLAG_DETAIL       ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_DONOTENTER   ) texture->surfaceflags |= Q3SURFACEFLAG_DONOTENTER   ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_FOG          ) texture->surfaceflags |= Q3SURFACEFLAG_FOG          ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_LAVA         ) texture->surfaceflags |= Q3SURFACEFLAG_LAVA         ;
+               if (shader->surfaceparms & Q3SURFACEPARM_LIGHTFILTER  ) texture->surfaceflags |= Q3SURFACEFLAG_LIGHTFILTER  ;
+               if (shader->surfaceparms & Q3SURFACEPARM_METALSTEPS   ) texture->surfaceflags |= Q3SURFACEFLAG_METALSTEPS   ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NODAMAGE     ) texture->surfaceflags |= Q3SURFACEFLAG_NODAMAGE     ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NODLIGHT     ) texture->surfaceflags |= Q3SURFACEFLAG_NODLIGHT     ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NODRAW       ) texture->surfaceflags |= Q3SURFACEFLAG_NODRAW       ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_NODROP       ) texture->surfaceflags |= Q3SURFACEFLAG_NODROP       ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NOIMPACT     ) texture->surfaceflags |= Q3SURFACEFLAG_NOIMPACT     ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NOLIGHTMAP   ) texture->surfaceflags |= Q3SURFACEFLAG_NOLIGHTMAP   ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NOMARKS      ) texture->surfaceflags |= Q3SURFACEFLAG_NOMARKS      ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_NOMIPMAPS    ) texture->surfaceflags |= Q3SURFACEFLAG_NOMIPMAPS    ;
+               if (shader->surfaceparms & Q3SURFACEPARM_NONSOLID     ) texture->surfaceflags |= Q3SURFACEFLAG_NONSOLID     ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_ORIGIN       ) texture->surfaceflags |= Q3SURFACEFLAG_ORIGIN       ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_PLAYERCLIP   ) texture->surfaceflags |= Q3SURFACEFLAG_PLAYERCLIP   ;
+               if (shader->surfaceparms & Q3SURFACEPARM_SKY          ) texture->surfaceflags |= Q3SURFACEFLAG_SKY          ;
+               if (shader->surfaceparms & Q3SURFACEPARM_SLICK        ) texture->surfaceflags |= Q3SURFACEFLAG_SLICK        ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_SLIME        ) texture->surfaceflags |= Q3SURFACEFLAG_SLIME        ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_STRUCTURAL   ) texture->surfaceflags |= Q3SURFACEFLAG_STRUCTURAL   ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_TRANS        ) texture->surfaceflags |= Q3SURFACEFLAG_TRANS        ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_WATER        ) texture->surfaceflags |= Q3SURFACEFLAG_WATER        ;
+               if (shader->surfaceparms & Q3SURFACEPARM_POINTLIGHT   ) texture->surfaceflags |= Q3SURFACEFLAG_POINTLIGHT   ;
+               if (shader->surfaceparms & Q3SURFACEPARM_HINT         ) texture->surfaceflags |= Q3SURFACEFLAG_HINT         ;
+               if (shader->surfaceparms & Q3SURFACEPARM_DUST         ) texture->surfaceflags |= Q3SURFACEFLAG_DUST         ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_BOTCLIP      ) texture->surfaceflags |= Q3SURFACEFLAG_BOTCLIP      ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_LIGHTGRID    ) texture->surfaceflags |= Q3SURFACEFLAG_LIGHTGRID    ;
+       //      if (shader->surfaceparms & Q3SURFACEPARM_ANTIPORTAL   ) texture->surfaceflags |= Q3SURFACEFLAG_ANTIPORTAL   ;
+
                if (shader->dpmeshcollisions)
                        texture->basematerialflags |= MATERIALFLAG_MESHCOLLISIONS;
                if (shader->dpshaderkill && developer_extra.integer)
@@ -2640,14 +2673,12 @@ nothing                GL_ZERO GL_ONE
        {
                if (developer_extra.integer)
                        Con_DPrintf("^1%s:^7 using fallback noshader material for ^3\"%s\"\n", loadmodel->name, name);
-               texture->surfaceparms = 0;
                texture->supercontents = SUPERCONTENTS_SOLID | SUPERCONTENTS_OPAQUE;
        }
        else if (!strcmp(texture->name, "common/nodraw") || !strcmp(texture->name, "textures/common/nodraw"))
        {
                if (developer_extra.integer)
                        Con_DPrintf("^1%s:^7 using fallback nodraw material for ^3\"%s\"\n", loadmodel->name, name);
-               texture->surfaceparms = 0;
                texture->basematerialflags = MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
                texture->supercontents = SUPERCONTENTS_SOLID;
        }
@@ -2655,7 +2686,6 @@ nothing                GL_ZERO GL_ONE
        {
                if (developer_extra.integer)
                        Con_DPrintf("^1%s:^7 No shader found for texture ^3\"%s\"\n", loadmodel->name, texture->name);
-               texture->surfaceparms = 0;
                if (texture->surfaceflags & Q3SURFACEFLAG_NODRAW)
                {
                        texture->basematerialflags |= MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
index 64b4050817abd5ff3594fcac030f7d9de6319b67..747bec0cfb32b39b703156937e1b638ff1aba4c9 100644 (file)
@@ -599,7 +599,6 @@ typedef struct texture_s
        char name[64];
        int surfaceflags;
        int supercontents;
-       int surfaceparms;
        int textureflags;
 
        // reflection