-/* $Id: config.h,v 1.30 2001/05/14 16:25:18 brianp Exp $ */
+/* $Id: config.h,v 1.31 2001/05/14 23:11:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
#define ACOMP 3
-
-/*
- * Language/compiler stuff
- */
-
-/* Some compilers don't like some of Mesa's const usage */
-#ifdef NO_CONST
-# define CONST
-#else
-# define CONST const
-#endif
-
-
-/* Function inlining */
-#if defined(__GNUC__)
-# define INLINE __inline__
-#elif defined(__MSC__)
-# define INLINE __inline
-#else
-# define INLINE
-#endif
-
-
-#ifdef DEBUG
-# define ASSERT(X) assert(X)
-#else
-# define ASSERT(X)
-#endif
-
-
-#endif
+#endif /* CONFIG_H */
-/* $Id: glheader.h,v 1.19 2001/03/29 16:50:32 brianp Exp $ */
+/* $Id: glheader.h,v 1.20 2001/05/14 23:11:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
+/* Function inlining */
+#if defined(__GNUC__)
+# define INLINE __inline__
+#elif defined(__MSC__)
+# define INLINE __inline
+#else
+# define INLINE
+#endif
+
+
+/* Some compilers don't like some of Mesa's const usage */
+#ifdef NO_CONST
+# define CONST
+#else
+# define CONST const
+#endif
+
+
+#ifdef DEBUG
+# define ASSERT(X) assert(X)
+#else
+# define ASSERT(X)
+#endif
+
+
#endif /* GLHEADER_H */
-/* $Id: s_texture.c,v 1.28 2001/05/03 14:11:53 brianp Exp $ */
+/* $Id: s_texture.c,v 1.29 2001/05/14 23:11:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Note, the FRAC macro has to work perfectly. Otherwise you'll sometimes
- * see 1-pixel bands of improperly weighted linear-sampled texels.
- * In particular, #define FRAC(f) ((f) - IFLOOR(f)) doesn't work.
+ * see 1-pixel bands of improperly weighted linear-sampled texels. The
+ * tests/texwrap.c demo is a good test.
* Also note, FRAC(x) doesn't truly return the fractional part of x for x < 0.
* Instead, if x < 0 then FRAC(x) = 1 - true_frac(x).
*/
-#define FRAC(f) ((f) - floor(f))
+#define FRAC(f) ((f) - IFLOOR(f))
+
/*
}
{
- const GLfloat a = FRAC(u + 1.0F);
+ const GLfloat a = FRAC(u);
/* compute sample weights in fixed point in [0,WEIGHT_SCALE] */
const GLint w0 = IROUND_POS((1.0F-a) * WEIGHT_SCALE);
const GLint w1 = IROUND_POS( a * WEIGHT_SCALE);
}
{
- const GLfloat a = FRAC(u - 1.0);
- const GLfloat b = FRAC(v - 1.0);
+ const GLfloat a = FRAC(u);
+ const GLfloat b = FRAC(v);
/* compute sample weights in fixed point in [0,WEIGHT_SCALE] */
const GLint w00 = IROUND_POS((1.0F-a) * (1.0F-b) * WEIGHT_SCALE);
const GLint w10 = IROUND_POS( a * (1.0F-b) * WEIGHT_SCALE);
}
{
- const GLfloat a = FRAC(u + 1.0F);
- const GLfloat b = FRAC(v + 1.0F);
- const GLfloat c = FRAC(w + 1.0F);
+ const GLfloat a = FRAC(u);
+ const GLfloat b = FRAC(v);
+ const GLfloat c = FRAC(w);
/* compute sample weights in fixed point in [0,WEIGHT_SCALE] */
GLint w000 = IROUND_POS((1.0F-a) * (1.0F-b) * (1.0F-c) * WEIGHT_SCALE);
GLint w100 = IROUND_POS( a * (1.0F-b) * (1.0F-c) * WEIGHT_SCALE);