Exemplo n.º 1
0
        public override byte[] Serialize(Game game, Endianness endianness)
        {
            using (var writer = new EndianBinaryWriter(endianness))
            {
                writer.WriteMagic("MINF");
                writer.Write(MinfReferences.Length);
                writer.Write(ATBL_AssetID);

                if (game != Game.Scooby)
                {
                    writer.Write(CombatID);
                    writer.Write(BrainID);
                }

                foreach (var r in MinfReferences)
                {
                    writer.Write(r.Serialize(game, endianness));
                }
                foreach (var b in MinfParams)
                {
                    writer.Write(b.Serialize(endianness));
                }

                return(writer.ToArray());
            }
        }
Exemplo n.º 2
0
        public override byte[] Serialize(Game game, Endianness endianness)
        {
            using (var writer = new EndianBinaryWriter(endianness))
            {
                writer.WriteMagic("SKB1");
                writer.Write(Flags.FlagValueInt);

                if (Offsets.Length > 0)
                {
                    writer.Write((ushort)Offsets[0].Length);
                }
                else
                {
                    writer.Write((ushort)0);
                }

                writer.Write((ushort)Times.Length);
                writer.Write(KeyFrames.Length);
                writer.Write(ScaleX);
                writer.Write(ScaleY);
                writer.Write(ScaleZ);

                foreach (var k in KeyFrames)
                {
                    k.Serialize(writer);
                }
                foreach (var t in Times)
                {
                    writer.Write(t);
                }
                foreach (var o in Offsets)
                {
                    foreach (var of in o)
                    {
                        writer.Write(of);
                    }
                }

                while (writer.BaseStream.Length % 4 != 0)
                {
                    writer.Write((byte)0xCD);
                }

                return(writer.ToArray());
            }
        }
Exemplo n.º 3
0
        public override byte[] Serialize(Game game, Endianness endianness)
        {
            if (Lights == null)
            {
                return(new byte[0]);
            }

            using (var writer = new EndianBinaryWriter(endianness))
            {
                writer.WriteMagic("LKIT");

                writer.Write(Group_AssetID);
                writer.Write(Lights.Length);
                writer.Write(0);

                foreach (var l in Lights)
                {
                    writer.Write(l.Serialize(endianness));
                }

                return(writer.ToArray());
            }
        }