]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix for HalfLife texture transparency and renderamt (originally misunderstood).
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 01:40:45 +0000 (01:40 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 01:40:45 +0000 (01:40 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8 d7cf8633-e32d-0410-b094-e92efae38249

gl_poly.c
model_brush.c
sv_main.c

index 78b6f5c85ed16139e5184cd29bd1e7d2b6254e83..08af798dc1bee321910c9be667e8b65b70c9d673 100644 (file)
--- a/gl_poly.c
+++ b/gl_poly.c
@@ -470,6 +470,7 @@ void wallpolyrender()
        if (!gl_mtexable)
                gl_multitexture.value = 0;
        glDisable(GL_BLEND);
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glShadeModel(GL_FLAT);
        // make sure zbuffer is enabled
        glEnable(GL_DEPTH_TEST);
index c742c1092dc75f5c495eb51cd9b9b5cb757222c9..4fa418f3710256877a559e7c94bebccab59ac885 100644 (file)
@@ -228,12 +228,12 @@ void Mod_LoadTextures (lump_t *l)
                                data2 = malloc(tx->width*tx->height);
                                for (j = 0;j < tx->width*tx->height;j++)
                                        data2[j] = data[j] >= 224 ? 0 : data[j]; // no fullbrights
-                               tx->gl_texturenum = GL_LoadTexture (tx->name, tx->width, tx->height, data2, true, 0, 1);
+                               tx->gl_texturenum = GL_LoadTexture (tx->name, tx->width, tx->height, data2, true, transparent, 1);
                                strcpy(name, tx->name);
                                strcat(name, "_glow");
                                for (j = 0;j < tx->width*tx->height;j++)
                                        data2[j] = data[j] >= 224 ? data[j] : 0; // only fullbrights
-                               tx->gl_glowtexturenum = GL_LoadTexture (name, tx->width, tx->height, data2, true, 0, 1);
+                               tx->gl_glowtexturenum = GL_LoadTexture (name, tx->width, tx->height, data2, true, transparent, 1);
                                free(data2);
                        }
                        else
index 454d6a038309792a50ec5e7bdcdac6eaf32473db..aa8d21ef8d89a9daa2ebe867943e587a24a63821 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -485,8 +485,8 @@ void SV_WriteEntitiesToClient (edict_t      *clent, sizebuf_t *msg)
                if (val = GETEDICTFIELDVALUE(ent, eval_alpha))
                if ((alpha = (int) (val->_float * 255.0)) == 0)
                        alpha = 255;
-               if (val = GETEDICTFIELDVALUE(ent, eval_renderamt)) // HalfLife support
-                       alpha -= (int) val->_float;
+               if ((val = GETEDICTFIELDVALUE(ent, eval_renderamt)) && val->_float != 0) // HalfLife support
+                       alpha = (int) val->_float;
                if (alpha < 0) alpha = 0;
                if (alpha > 255) alpha = 255;