From ab454d3574e2c123c8315f434b419bf2466f45ca Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 28 Dec 2007 16:36:48 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 2 +- r_sprites.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.2