make SPR_LABEL use neither depth test nor fog; make R_Draw_Sprite not fog nodepthtest...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 28 Dec 2007 16:36:48 +0000 (16:36 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 28 Dec 2007 16:36:48 +0000 (16:36 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7876 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
r_sprites.c

index 65d3375..380c7be 100644 (file)
@@ -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);
index 6bfe473..649bf2b 100644 (file)
@@ -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