public override void Write(Library.Collections.BitStream stream, ref Half value, MySerializeInfo info)
 {
     if (info.IsNormalized && info.IsFixed8)
     {
         stream.WriteByte((byte)(value * 255.0f));
     }
     else
     {
         stream.WriteHalf(value);
     }
 }
Esempio n. 2
0
 public override void Write(Library.Collections.BitStream stream, ref float value, MySerializeInfo info)
 {
     if (info.IsNormalized && info.IsFixed8)
     {
         stream.WriteByte((byte)(value * 255.0f));
     }
     else if (info.IsNormalized && info.IsFixed16)
     {
         stream.WriteUInt16((ushort)(value * 65535.0f));
     }
     else
     {
         stream.WriteFloat(value);
     }
 }
Esempio n. 3
0
 public override void Write(Library.Collections.BitStream stream, ref Byte value, MySerializeInfo info)
 {
     stream.WriteByte(value);
 }