X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscreen%2Fcolors.hxx;h=c3ea8e7e27e3a9f62e079470a3ea68b9650cbab6;hb=201cb61f842ef50a19438e3872ba22e588fa1afc;hp=40ce19e6945ecd71ad716fd640daf7f1b5199dff;hpb=44551dad2d636e1edb508b730f7a691a5ef4f33b;p=simgear.git diff --git a/simgear/screen/colors.hxx b/simgear/screen/colors.hxx index 40ce19e6..c3ea8e7e 100644 --- a/simgear/screen/colors.hxx +++ b/simgear/screen/colors.hxx @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ @@ -26,11 +26,8 @@ #include -#if defined( macintosh ) -const float system_gamma = 1.4; - -#elif defined (sgi) -const float system_gamma = 1.7; +#if defined (sgi) +const float system_gamma = 2.0/1.7; #else // others const float system_gamma = 2.5; @@ -47,13 +44,6 @@ inline void gamma_correct_rgb(float *color, color[0] = pow(color[0], tmp); color[1] = pow(color[1], tmp); color[2] = pow(color[2], tmp); - - if ( color[0] < 0.0 ) { color[0] = 0.0; } - if ( color[1] < 0.0 ) { color[1] = 0.0; } - if ( color[2] < 0.0 ) { color[2] = 0.0; } - if ( color[0] > 1.0 ) { color[0] = 1.0; } - if ( color[1] > 1.0 ) { color[1] = 1.0; } - if ( color[2] > 1.0 ) { color[2] = 1.0; } }; inline void gamma_correct_c(float *color, @@ -63,8 +53,6 @@ inline void gamma_correct_c(float *color, return; *color = pow(*color, reff/system); - if ( *color < 0.0 ) { *color = 0.0; } - if ( *color > 1.0 ) { *color = 1.0; } }; inline void gamma_restore_rgb(float *color, @@ -77,13 +65,6 @@ inline void gamma_restore_rgb(float *color, color[0] = pow(color[0], tmp); color[1] = pow(color[1], tmp); color[2] = pow(color[2], tmp); - - if ( color[0] < 0.0 ) { color[0] = 0.0; } - if ( color[1] < 0.0 ) { color[1] = 0.0; } - if ( color[2] < 0.0 ) { color[2] = 0.0; } - if ( color[0] > 1.0 ) { color[0] = 1.0; } - if ( color[1] > 1.0 ) { color[1] = 1.0; } - if ( color[2] > 1.0 ) { color[2] = 1.0; } }; inline void gamma_restore_c(float *color, @@ -93,8 +74,6 @@ inline void gamma_restore_c(float *color, return; *color = pow(*color, system/reff); - if ( *color < 0.0 ) { *color = 0.0; } - if ( *color > 1.0 ) { *color = 1.0; } };