Esempio n. 1
0
        public static int ReadInt(this byte[] bytes, ref int offset)
        {
            var value = Little.ToInt32(bytes, offset);

            offset += 4;
            return(value);
        }
Esempio n. 2
0
        public static int[] ReadInts(this byte[] bytes, ref int offset)
        {
            var length = Little.ToInt32(bytes, offset);

            offset += 4;

            var ints = new int[length];

            for (var i = 0; i < ints.Length; i++)
            {
                ints[i] = Little.ToInt32(bytes, offset);
                offset += 4;
            }

            return(ints);
        }
Esempio n. 3
0
        public static Color[] ReadColors(this byte[] bytes, ref int offset)
        {
            var length = Little.ToInt32(bytes, offset);

            offset += 4;

            var colors = new Color[length];

            for (var i = 0; i < colors.Length; i++)
            {
                colors[i] = BytesToColor(bytes, offset);
                offset   += 4;
            }

            return(colors);
        }
Esempio n. 4
0
        public static Vector2[] ReadVector2s(this byte[] bytes, ref int offset)
        {
            var length = Little.ToInt32(bytes, offset);

            offset += 4;

            var vector2s = new Vector2[length];

            for (var i = 0; i < vector2s.Length; i++)
            {
                var x = Little.ToSingle(bytes, offset);
                offset += 4;
                var y = Little.ToSingle(bytes, offset);
                offset     += 4;
                vector2s[i] = new Vector2(x, y);
            }

            return(vector2s);
        }