replace color table FloatTable boolean with Type enum
[mesa.git] / src / mesa / main / mtypes.h
index 5ed79424d535c5c23483b2fa413a4e8bc2061295..18e1563102194e8ccb793b492299e7e9fe5439ed 100644 (file)
@@ -108,22 +108,20 @@ typedef int GLfixed;
 /*
  * Fixed point arithmetic macros
  */
-#ifdef FIXED_14
-#define FIXED_ONE       0x00004000
-#define FIXED_HALF      0x00002000
-#define FIXED_FRAC_MASK 0x00003FFF
-#define FIXED_SCALE     16384.0f
-#define FIXED_SHIFT     14
-#else
-#define FIXED_ONE       0x00000800
-#define FIXED_HALF      0x00000400
-#define FIXED_FRAC_MASK 0x000007FF
-#define FIXED_SCALE     2048.0f
-#define FIXED_SHIFT     11
+#ifndef FIXED_FRAC_BITS
+#define FIXED_FRAC_BITS 11
 #endif
+
+#define FIXED_SHIFT     FIXED_FRAC_BITS
+#define FIXED_ONE       (1 << FIXED_SHIFT)
+#define FIXED_HALF      (1 << (FIXED_SHIFT-1))
+#define FIXED_FRAC_MASK (FIXED_ONE - 1)
 #define FIXED_INT_MASK  (~FIXED_FRAC_MASK)
 #define FIXED_EPSILON   1
+#define FIXED_SCALE     ((float) FIXED_ONE)
+#define FIXED_DBL_SCALE ((double) FIXED_ONE)
 #define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
+#define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))
 #define IntToFixed(I)   ((I) << FIXED_SHIFT)
 #define FixedToInt(X)   ((X) >> FIXED_SHIFT)
 #define FixedToUns(X)   (((unsigned int)(X)) >> FIXED_SHIFT)
@@ -254,8 +252,8 @@ struct gl_color_table {
    GLenum Format;         /**< GL_ALPHA, GL_RGB, GL_RGB, etc */
    GLenum IntFormat;
    GLuint Size;           /**< number of entries (rows) in table */
-   GLvoid *Table;         /**< either GLfloat * or GLchan * */
-   GLboolean FloatTable;  /**< are entries stored as floats? */
+   GLvoid *Table;         /**< points to data of <Type> */
+   GLenum Type;           /**< GL_UNSIGNED_BYTE or GL_FLOAT */
    GLubyte RedSize;
    GLubyte GreenSize;
    GLubyte BlueSize;
@@ -1573,6 +1571,7 @@ struct fragment_program
    GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
    GLuint NumTexInstructions;
    GLuint NumTexIndirections;
+   GLenum FogOption;
    struct program_parameter_list *Parameters; /**< array [NumParameters] */
 };
 
@@ -2107,7 +2106,7 @@ struct gl_tnl_module {
    /**
     * Vertex format to be lazily swapped into current dispatch.
     */
-   GLvertexformat *Current;
+   const GLvertexformat *Current;
 
    /**
     * \name Record of functions swapped out.