From e01d671668a2f618de689e72cce5caf21f57d4a0 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Fri, 12 Dec 2003 08:19:20 +0000 Subject: small bug wrt culling --- src/mesa/drivers/glide/fxtris.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/glide') diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index 9be2e1a88f..56563fc412 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -389,9 +389,17 @@ static struct { #define VERT_X(_v) _v->x #define VERT_Y(_v) _v->y #define VERT_Z(_v) _v->ooz -#define AREA_IS_CCW( a ) IS_NEGATIVE(a) /*(a < 0)*/ #define GET_VERTEX(e) (fxMesa->verts + e) +#ifdef USE_IEEE +/* type-punning, keep -fstrict-aliasing happy */ +typedef union { GLfloat f; GLuint u; } fu_type; +/* 0/1 value, to allow XOR'ing with other booleans */ +#define AREA_IS_CCW( a ) (((fu_type *)&(a))->u >> 31) +#else +#define AREA_IS_CCW( a ) (a < 0) +#endif + #define VERT_SET_RGBA( dst, f ) \ do { \ UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[2], f[0]);\ -- cgit v1.2.3