diff src/video/SDL_gamma.c @ 3012:7e30c2dc7783

Fixed Visual C++ release build for Visual C++ 2005 * Some math functions become intrinsic in release mode, so we need to convert all the math functions into SDL math functions, like we did with the stdlib functions. * Constant initializers of 8-bit values become calls to memset() in release mode, but memset() itself is an intrinsic when explicitly called. So we'll just explicitly call memset() in those cases.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Jan 2009 18:32:24 +0000
parents 99210400e8b9
children 62d4992e5a92
line wrap: on
line diff
--- a/src/video/SDL_gamma.c	Fri Jan 09 20:43:30 2009 +0000
+++ b/src/video/SDL_gamma.c	Sat Jan 10 18:32:24 2009 +0000
@@ -23,8 +23,6 @@
 
 /* Gamma correction support */
 
-#include "../libm/math.h"
-
 #include "SDL_sysvideo.h"
 
 
@@ -52,7 +50,7 @@
         int value;
         gamma = 1.0f / gamma;
         for (i = 0; i < 256; ++i) {
-            value = (int) (pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
+            value = (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
             if (value > 65535) {
                 value = 65535;
             }
@@ -75,7 +73,7 @@
         if ((ramp[i] != 0) && (ramp[i] != 65535)) {
             double B = (double) i / 256.0;
             double A = ramp[i] / 65535.0;
-            sum += (float) (log(A) / log(B));
+			sum += (float) (SDL_log(A) / SDL_log(B));
             count++;
         }
     }