summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-12 11:50:32 -0700
committerBrian Paul <[email protected]>2011-11-15 07:49:26 -0700
commit546f76d58f619e3d7e016b3eb04254d5c5c3f39f (patch)
tree7550dd18a5864300189b15117de22a5759581b92 /src/mesa/main/image.c
parentb098e1af1cdaea8767b8f1416469cdd02a9c39a9 (diff)
mesa: new BYTE/SHORT_TO_FLOATZ() macros
Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new ones with different names. These macros preserve zero when converting. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 3a6f01c57c2..fdb4b31ba35 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -39,22 +39,6 @@
#include "mtypes.h"
-/**
- * NOTE:
- * Normally, BYTE_TO_FLOAT(0) returns 0.00392 That causes problems when
- * we later convert the float to a packed integer value (such as for
- * GL_RGB5_A1) because we'll wind up with a non-zero value.
- *
- * We redefine the macros here so zero is handled correctly.
- */
-#undef BYTE_TO_FLOAT
-#define BYTE_TO_FLOAT(B) ((B) == 0 ? 0.0F : ((2.0F * (B) + 1.0F) * (1.0F/255.0F)))
-
-#undef SHORT_TO_FLOAT
-#define SHORT_TO_FLOAT(S) ((S) == 0 ? 0.0F : ((2.0F * (S) + 1.0F) * (1.0F/65535.0F)))
-
-
-
/**
* \return GL_TRUE if type is packed pixel type, GL_FALSE otherwise.