]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix q1bsp dedicated server collisions, a simplification of the q1bsp
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Jun 2011 04:50:41 +0000 (04:50 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Sun, 26 Jun 2011 05:49:36 +0000 (07:49 +0200)
loading code was breaking the material information and thus water was
made solid

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11214 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=4e41d58386ed371c0ce5eeea75df702b490372df

model_brush.c

index e0153bb655a9adefa2d99588ceb5c950749410dd..ace67cea02b5c6a6411846fa859e6a8c4f100206 100644 (file)
@@ -1816,8 +1816,6 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
                                if (skinframe)
                                        tx->skinframes[0] = skinframe;
                        }
-
-                       tx->basematerialflags = MATERIALFLAG_WALL;
                        if (tx->name[0] == '*')
                        {
                                // LordHavoc: some turbulent textures should not be affected by wateralpha
@@ -1825,34 +1823,48 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
                                {
                                        // replace the texture with transparent black
                                        tx->skinframes[0] = R_SkinFrame_LoadInternalBGRA(tx->name, TEXF_MIPMAP | TEXF_ALPHA, zerotrans, 1, 1, false);
-                                       tx->basematerialflags |= MATERIALFLAG_NOSHADOW | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_REFLECTION;
                                }
-                               else if (!strncmp(tx->name,"*lava",5)
-                                || !strncmp(tx->name,"*teleport",9)
-                                || !strncmp(tx->name,"*rift",5)) // Scourge of Armagon texture
-                                       tx->basematerialflags |= MATERIALFLAG_WATERSCROLL | MATERIALFLAG_LIGHTBOTHSIDES | MATERIALFLAG_NOSHADOW;
-                               else
-                                       tx->basematerialflags |= MATERIALFLAG_WATERSCROLL | MATERIALFLAG_LIGHTBOTHSIDES | MATERIALFLAG_NOSHADOW | MATERIALFLAG_WATERALPHA | MATERIALFLAG_WATERSHADER;
-                               if (tx->skinframes[0] && tx->skinframes[0]->hasalpha)
-                                       tx->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
                        }
                        else if (!strncmp(tx->name, "mirror", 6)) // Tenebrae
                        {
                                // replace the texture with black
                                tx->skinframes[0] = R_SkinFrame_LoadInternalBGRA(tx->name, 0, zeroopaque, 1, 1, false);
-                               tx->basematerialflags |= MATERIALFLAG_REFLECTION;
                        }
-                       else if (!strncmp(tx->name, "sky", 3))
-                               tx->basematerialflags = MATERIALFLAG_SKY | MATERIALFLAG_NOSHADOW;
-                       else if (!strcmp(tx->name, "caulk"))
-                               tx->basematerialflags = MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
-                       else if (tx->skinframes[0] && tx->skinframes[0]->hasalpha)
-                               tx->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
+               }
 
-                       // start out with no animation
-                       tx->currentframe = tx;
-                       tx->currentskinframe = tx->skinframes[0];
+               tx->basematerialflags = MATERIALFLAG_WALL;
+               if (tx->name[0] == '*')
+               {
+                       // LordHavoc: some turbulent textures should not be affected by wateralpha
+                       if (!strncmp(tx->name, "*glassmirror", 12)) // Tenebrae
+                       {
+                               // replace the texture with transparent black
+                               tx->basematerialflags |= MATERIALFLAG_NOSHADOW | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_REFLECTION;
+                       }
+                       else if (!strncmp(tx->name,"*lava",5)
+                        || !strncmp(tx->name,"*teleport",9)
+                        || !strncmp(tx->name,"*rift",5)) // Scourge of Armagon texture
+                               tx->basematerialflags |= MATERIALFLAG_WATERSCROLL | MATERIALFLAG_LIGHTBOTHSIDES | MATERIALFLAG_NOSHADOW;
+                       else
+                               tx->basematerialflags |= MATERIALFLAG_WATERSCROLL | MATERIALFLAG_LIGHTBOTHSIDES | MATERIALFLAG_NOSHADOW | MATERIALFLAG_WATERALPHA | MATERIALFLAG_WATERSHADER;
+                       if (tx->skinframes[0] && tx->skinframes[0]->hasalpha)
+                               tx->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
+               }
+               else if (!strncmp(tx->name, "mirror", 6)) // Tenebrae
+               {
+                       // replace the texture with black
+                       tx->basematerialflags |= MATERIALFLAG_REFLECTION;
                }
+               else if (!strncmp(tx->name, "sky", 3))
+                       tx->basematerialflags = MATERIALFLAG_SKY | MATERIALFLAG_NOSHADOW;
+               else if (!strcmp(tx->name, "caulk"))
+                       tx->basematerialflags = MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
+               else if (tx->skinframes[0] && tx->skinframes[0]->hasalpha)
+                       tx->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
+
+               // start out with no animation
+               tx->currentframe = tx;
+               tx->currentskinframe = tx->skinframes[0];
        }
 
        // sequence the animations