Пример #1
0
 public CollisionTriangleList(int ID)
 {
     id      = ID;
     texture = TextureFormats.ColorTexture(
         Color4b.HSV(60 + ID * 39, (14 - (3 + ((ID >> 3) & 7))) / 14.0, (4 - ((ID >> 6) & 3)) / 4.0)
         );
 }
Пример #2
0
 private static byte[] ColorToPixel(Color4b color)
 {
     byte[] o = new byte[4];
     o[A] = color.A;
     o[R] = color.R;
     o[G] = color.G;
     o[B] = color.B;
     return(o);
 }
Пример #3
0
 // would rather not expose b32.
 internal static void RGBA5551(out Color4b color, ushort value)
 {
     color = new Color4b
     {
         R = b32[(value >> 11) & 0x1F],
         G = b32[(value >> 6) & 0x1F],
         B = b32[(value >> 1) & 0x1F],
         A = 0 == (value & 1) ? (byte)0 : (byte)255,
     };
 }
Пример #4
0
 public static Raw ColorTexture(Color4b color)
 {
     return((color.R == 255 && color.G == 255 && color.B == 255 && (color.A == 255 || color.A == 0)) ?
            color.A == 0?ClearWhite:White:new Raw(ColorToPixel(color), ColorFormatWidth, ColorFormatHeight, ColorFormat, color));
 }