[opengtl-commits] [728] more stdlib function use

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 728
Author:   cyrille
Date:     2009-04-16 19:43:37 +0200 (Thu, 16 Apr 2009)

Log Message:
-----------
more stdlib function use

Modified Paths:
--------------
    trunk/shiva-collections/filters/MirrorImpose.shiva
    trunk/shiva-collections/generators/SuperNova.shiva


Modified: trunk/shiva-collections/filters/MirrorImpose.shiva
===================================================================
--- trunk/shiva-collections/filters/MirrorImpose.shiva	2009-04-16 17:29:19 UTC (rev 727)
+++ trunk/shiva-collections/filters/MirrorImpose.shiva	2009-04-16 17:43:37 UTC (rev 728)
@@ -5,17 +5,6 @@
   {
     return a * c + b * (1 - c);
   }
-  float max(float a, float b)
-  {
-    if( a < b) return b;
-    return a;
-  }
-  float clamp(float a, float min, float max)
-  {
-    if( a < min ) return min;
-    if( a > max ) return max;
-    return a;
-  }
   void evaluatePixel(image img, out pixel result)
   {
     float ax = result.coord.x / IMAGE_WIDTH;

Modified: trunk/shiva-collections/generators/SuperNova.shiva
===================================================================
--- trunk/shiva-collections/generators/SuperNova.shiva	2009-04-16 17:29:19 UTC (rev 727)
+++ trunk/shiva-collections/generators/SuperNova.shiva	2009-04-16 17:43:37 UTC (rev 728)
@@ -63,19 +63,19 @@
     {
       if( vec_length < adjRadius )
       {
-	coef = pow((radius - vec_length) / adjRadius , 1.0 ) * ( 1.0 - coef) + coef;
+        coef = pow((radius - vec_length) / adjRadius , 1.0 ) * ( 1.0 - coef) + coef;
       }
       float coef2 = 1.0;
       if( vec_length < color2radius * radius )
       {
-	coef2 = (vec_length - radius) / ( (color2radius - 1.0) * radius );
+        coef2 = (vec_length - radius) / ( (color2radius - 1.0) * radius );
       }
       result = ( 1 - coef ) * (  coef2 * color1 + (1 - coef2) *  color2) + coef * colorCenter;
       
       for( int i = 0; i < 3; ++i)
       {
-	if(result[i] < 0) result[i] = 0.0;
-	else if(result[i] > 1) result[i] = 1.0;
+        if(result[i] < 0) result[i] = 0.0;
+        else if(result[i] > 1) result[i] = 1.0;
       }
       result[3] = 1.0;
     } else {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/