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 78b6f5c..08af798 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 c742c10..4fa418f 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 454d6a0..aa8d21e 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;