From: lordhavoc Date: Wed, 23 Aug 2000 01:40:45 +0000 (+0000) Subject: Fix for HalfLife texture transparency and renderamt (originally misunderstood). X-Git-Tag: RELEASE_0_2_0_RC1~1012 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b6b649cfcb8f6ae9c4ec293cd5c78e3167194fed;p=xonotic%2Fdarkplaces.git Fix for HalfLife texture transparency and renderamt (originally misunderstood). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_poly.c b/gl_poly.c index 78b6f5c8..08af798d 100644 --- 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); diff --git a/model_brush.c b/model_brush.c index c742c109..4fa418f3 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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 diff --git a/sv_main.c b/sv_main.c index 454d6a03..aa8d21ef 100644 --- 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;