From: divverent Date: Fri, 28 Dec 2007 16:36:48 +0000 (+0000) Subject: make SPR_LABEL use neither depth test nor fog; make R_Draw_Sprite not fog nodepthtest... X-Git-Tag: xonotic-v0.1.0preview~2618 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ab454d3574e2c123c8315f434b419bf2466f45ca;p=xonotic%2Fdarkplaces.git make SPR_LABEL use neither depth test nor fog; make R_Draw_Sprite not fog nodepthtest sprites at all because they can be treated as HUD items git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7876 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 65d33757..380c7bec 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3843,7 +3843,7 @@ void R_DrawSprite(int blendfunc1, int blendfunc2, rtexture_t *texture, rtexture_ float fog = 1.0f; float vertex3f[12]; - if (r_refdef.fogenabled) + if (r_refdef.fogenabled && !depthdisable) // TODO maybe make the unfog effect a separate flag? fog = FogPoint_World(origin); R_Mesh_Matrix(&identitymatrix); diff --git a/r_sprites.c b/r_sprites.c index 6bfe4737..649bf2b7 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -330,6 +330,12 @@ void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const r vec3_t o, l, u; #endif R_UpdateTextureInfo(ent, texture); + + // SPR_LABEL should not use depth test AT ALL + if(model->sprite.sprnum_type == SPR_LABEL || model->sprite.sprnum_type == SPR_LABEL_SCALE) + if(texture->currentmaterialflags & MATERIALFLAG_SHORTDEPTHRANGE) + texture->currentmaterialflags = (texture->currentmaterialflags & ~MATERIALFLAG_SHORTDEPTHRANGE) | MATERIALFLAG_NODEPTHTEST; + if(edge) { // FIXME:: save vectors/origin and re-rotate? necessary if the hotspot can change per frame