Ejemplo n.º 1
0
 public static LightStyle.Mod Lerp(LightStyle.Mod a, LightStyle.Mod b, float t, LightStyle.Mod.Mask mask)
 {
     b.mask = b.mask & mask;
     if ((int)b.mask == 0)
     {
         return a;
     }
     a.mask = a.mask & mask;
     if ((int)a.mask == 0)
     {
         return b;
     }
     LightStyle.Mod.Mask mask1 = a.mask & b.mask;
     if ((int)mask1 != 0)
     {
         float single = 1f - t;
         if ((int)mask != 0)
         {
             for (LightStyle.Mod.Element i = LightStyle.Mod.Element.Red; i < (LightStyle.Mod.Element.Green | LightStyle.Mod.Element.Blue | LightStyle.Mod.Element.Alpha | LightStyle.Mod.Element.Intensity | LightStyle.Mod.Element.Range | LightStyle.Mod.Element.SpotAngle); i = (LightStyle.Mod.Element)((int)i + (int)LightStyle.Mod.Element.Green))
             {
                 if ((mask1 & LightStyle.Mod.ElementToMask(i)) == LightStyle.Mod.ElementToMask(i))
                 {
                     float faceValue = a.GetFaceValue(i);
                     float faceValue1 = b.GetFaceValue(i);
                     float single1 = faceValue * single + faceValue1 * t;
                     a.SetFaceValue(i, single1);
                 }
             }
         }
     }
     if (mask1 != a.mask)
     {
         a = a | b;
     }
     return a;
 }