Esempio n. 1
0
 public override void SerializeImpl(SerializerObject s)
 {
     PaletteCount  = s.Serialize <byte>(PaletteCount, name: nameof(PaletteCount));
     PaletteLength = s.Serialize <byte>(PaletteLength, name: nameof(PaletteLength));
     if (Palettes == null)
     {
         Palettes = new BaseColor[PaletteCount][];
     }
     if (ColorFormat == 0x5515)                   // 1555
     {
         for (int i = 0; i < Palettes.Length; i++)
         {
             Palettes[i] = s.SerializeObjectArray <BGRA5551Color>((BGRA5551Color[])Palettes[i], PaletteLength == 0 ? 256 : PaletteLength, name: $"{nameof(Palettes)}[{i}]");
         }
     }
     else if (ColorFormat == 0x8888)                     // 8888
     {
         for (int i = 0; i < Palettes.Length; i++)
         {
             Palettes[i] = s.SerializeObjectArray <BGRA8888Color>((BGRA8888Color[])Palettes[i], PaletteLength == 0 ? 256 : PaletteLength, name: $"{nameof(Palettes)}[{i}]");
         }
     }
     else if (ColorFormat == 0x4444)
     {
         for (int i = 0; i < Palettes.Length; i++)
         {
             Palettes[i] = s.SerializeObjectArray <BGRA4444Color>((BGRA4444Color[])Palettes[i], PaletteLength == 0 ? 256 : PaletteLength, name: $"{nameof(Palettes)}[{i}]");
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Serializes the data
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            // Serialize header values
            Unknown1 = s.Serialize <ushort>(Unknown1, name: nameof(Unknown1));
            Width    = s.Serialize <ushort>(Width, name: nameof(Width));
            Height   = s.Serialize <ushort>(Height, name: nameof(Height));
            Unknown2 = s.Serialize <ushort>(Unknown2, name: nameof(Unknown2));

            // Get the block width
            var blockWidth = GetBlockWidth(s.GameSettings.EngineVersion);

            // Create block array
            if (ImageBlocks == null)
            {
                // Get the size of each block
                var blockSize = Height * blockWidth;

                ImageBlocks = new ARGB1555Color[BlockGroupSize / blockSize][];
            }

            // Serialize blocks
            for (int i = 0; i < ImageBlocks.Length; i++)
            {
                ImageBlocks[i] = s.SerializeObjectArray <ARGB1555Color>(ImageBlocks[i], blockWidth * Height, name: nameof(ImageBlocks) + "[" + i + "]");
            }
        }
Esempio n. 3
0
 public override void SerializeImpl(SerializerObject s)
 {
     DrawIndex = s.Serialize <byte>(DrawIndex, name: nameof(DrawIndex));
     Tile      = s.SerializeObject <TileGraphicsInfo>(Tile, name: nameof(Tile));
     XPos      = s.Serialize <sbyte>(XPos, name: nameof(XPos));
     YPos      = s.Serialize <sbyte>(YPos, name: nameof(YPos));
 }
Esempio n. 4
0
 public override void SerializeImpl(SerializerObject s)
 {
     XPosition = s.Serialize <sbyte>(XPosition, name: nameof(XPosition));
     YPosition = s.Serialize <sbyte>(YPosition, name: nameof(YPosition));
     Width     = s.Serialize <byte>(Width, name: nameof(Width));
     Height    = s.Serialize <byte>(Height, name: nameof(Height));
 }
Esempio n. 5
0
 public override void SerializeImpl(SerializerObject s)
 {
     Alpha = s.Serialize <byte>(Alpha, name: nameof(Alpha));
     Red   = s.Serialize <byte>(Red, name: nameof(Red));
     Green = s.Serialize <byte>(Green, name: nameof(Green));
     Blue  = s.Serialize <byte>(Blue, name: nameof(Blue));
 }
Esempio n. 6
0
 /// <summary>
 /// Handles the data serialization
 /// </summary>
 /// <param name="s">The serializer object</param>
 public override void SerializeImpl(SerializerObject s)
 {
     Flags = s.Serialize <byte>(Flags, name: nameof(Flags));
     if (BitHelpers.ExtractBits(Flags, 1, 7) == 1)
     {
         if (BitHelpers.ExtractBits(Flags, 1, 0) == 1)
         {
             Note = s.Serialize <byte>(Note, name: nameof(Note));
         }
         if (BitHelpers.ExtractBits(Flags, 1, 1) == 1)
         {
             Instrument = s.Serialize <byte>(Instrument, name: nameof(Instrument));
         }
         if (BitHelpers.ExtractBits(Flags, 1, 2) == 1)
         {
             VolumeColumnByte = s.Serialize <byte>(VolumeColumnByte, name: nameof(VolumeColumnByte));
         }
         if (BitHelpers.ExtractBits(Flags, 1, 3) == 1)
         {
             EffectType = s.Serialize <byte>(EffectType, name: nameof(EffectType));
         }
         if (BitHelpers.ExtractBits(Flags, 1, 4) == 1)
         {
             EffectParameter = s.Serialize <byte>(EffectParameter, name: nameof(EffectParameter));
         }
     }
     else
     {
         Note             = Flags;
         Instrument       = s.Serialize <byte>(Instrument, name: nameof(Instrument));
         VolumeColumnByte = s.Serialize <byte>(VolumeColumnByte, name: nameof(VolumeColumnByte));
         EffectType       = s.Serialize <byte>(EffectType, name: nameof(EffectType));
         EffectParameter  = s.Serialize <byte>(EffectParameter, name: nameof(EffectParameter));
     }
 }
Esempio n. 7
0
        }                                                     // References to some of the states in the normal state array

        public override void SerializeImpl(SerializerObject s)
        {
            UnknownStatesPointer    = s.SerializeObject <SNES_Pointer>(UnknownStatesPointer, onPreSerialize: x => x.MemoryBankOverride = 4, name: nameof(UnknownStatesPointer));
            ImageDescriptorsPointer = s.SerializeObject <SNES_Pointer>(ImageDescriptorsPointer, onPreSerialize: x => x.MemoryBankOverride = 4, name: nameof(ImageDescriptorsPointer));

            Ushort_04 = s.Serialize <ushort>(Ushort_04, name: nameof(Ushort_04));

            XPosition = s.Serialize <short>(XPosition, name: nameof(XPosition));
            YPosition = s.Serialize <short>(YPosition, name: nameof(YPosition));

            Bytes_0A = s.SerializeArray <byte>(Bytes_0A, 6, name: nameof(Bytes_0A));

            StatesPointer = s.SerializeObject <SNES_Pointer>(StatesPointer, onPreSerialize: x => x.MemoryBankOverride = 4, name: nameof(StatesPointer));

            if (!s.FullSerialize)
            {
                return;
            }

            // Serialize data from pointers
            States           = s.DoAt(StatesPointer.GetPointer(), () => s.SerializeObjectArray <SNES_Proto_State>(States, 5 * 0x15, name: nameof(States)));
            ImageDescriptors = s.DoAt(ImageDescriptorsPointer.GetPointer(), () => s.SerializeObjectArray <SNES_Proto_ImageDescriptor>(ImageDescriptors, States.Max(state => state.Animation?.Layers.Max(layer => layer.ImageIndex + 1) ?? 0), name: nameof(ImageDescriptors)));

            UnknownStatesPointers = s.DoAt(UnknownStatesPointer.GetPointer(), () => s.SerializeObjectArray <SNES_Pointer>(UnknownStatesPointers, 16, onPreSerialize: x => x.MemoryBankOverride = 4, name: nameof(UnknownStatesPointers)));

            if (UnknownStates == null)
            {
                UnknownStates = new SNES_Proto_State[UnknownStatesPointers.Length];
            }

            for (int i = 0; i < UnknownStates.Length; i++)
            {
                UnknownStates[i] = s.DoAt(UnknownStatesPointers[i].GetPointer(), () => s.SerializeObject <SNES_Proto_State>(UnknownStates[i], name: $"{nameof(UnknownStates)}[{i}]"));
            }
        }
Esempio n. 8
0
        public override void SerializeBlock(SerializerObject s)
        {
            if (DependencyTable.DependenciesCount > 0)
            {
                if (Vignettes == null)
                {
                    Vignettes = new GBC_Vignette[DependencyTable.DependenciesCount];
                }

                for (int i = 0; i < Vignettes.Length; i++)
                {
                    Vignettes[i] = s.DoAt(DependencyTable.GetPointer(i), () => s.SerializeObject <GBC_Vignette>(Vignettes[i], name: $"{nameof(Vignettes)}[{i}]"));
                }
            }
            else
            {
                // Serialize data
                Width      = s.Serialize <byte>(Width, name: nameof(Width));
                Height     = s.Serialize <byte>(Height, name: nameof(Height));
                UnkData    = s.SerializeArray <byte>(UnkData, 14, name: nameof(UnkData));
                Palette    = s.SerializeObjectArray <RGBA5551Color>(Palette, 4 * 8, name: nameof(Palette));
                TileSet    = s.SerializeArray <byte>(TileSet, Width * Height * 0x10, name: nameof(TileSet));
                PalIndices = s.SerializeArray <byte>(PalIndices, Width * Height, name: nameof(PalIndices));
            }
        }
Esempio n. 9
0
 public override void SerializeImpl(SerializerObject s)
 {
     X         = s.Serialize <ushort>(X, name: nameof(X));
     UShort_02 = s.Serialize <ushort>(UShort_02, name: nameof(UShort_02));
     Y         = s.Serialize <ushort>(Y, name: nameof(Y));
     UShort_06 = s.Serialize <ushort>(UShort_06, name: nameof(UShort_06));
 }
Esempio n. 10
0
        public override void SerializeImpl(SerializerObject s)
        {
            PointersPointer = s.SerializePointer <GBAIsometric_LevelDataLayerDataPointers>(PointersPointer, resolve: true, name: nameof(PointersPointer));
            StructType      = s.Serialize <MapLayerType>(StructType, name: nameof(StructType));
            Width           = s.Serialize <ushort>(Width, name: nameof(Width));
            Height          = s.Serialize <ushort>(Height, name: nameof(Height));
            Ushort_0A       = s.Serialize <ushort>(Ushort_0A, name: nameof(Ushort_0A));
            MapDataPointer  = s.SerializePointer(MapDataPointer, name: nameof(MapDataPointer));
            Pointer_20      = s.SerializePointer(Pointer_20, name: nameof(Pointer_20));

            if (StructType == MapLayerType.Map)
            {
                Palette       = s.SerializeObjectArray <ARGB1555Color>(Palette, 256, name: nameof(Palette));
                RemainingData = s.SerializeArray <byte>(RemainingData, 44, name: nameof(RemainingData));
            }

            // TODO: Remove try/catch
            try
            {
                s.DoAt(MapDataPointer, () =>
                {
                    s.DoEncoded(new RHREncoder(), () =>
                    {
                        MapData = s.SerializeArray <ushort>(MapData, Width * Height, name: nameof(MapData));
                    });
                });
            }
            catch (Exception ex)
            {
                Debug.LogWarning($"Failed to decompress {MapDataPointer}: {ex.Message}\n{ex.InnerException?.StackTrace}");
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            // Serialize header
            EventsPointer = s.SerializePointer(EventsPointer, name: nameof(EventsPointer));
            EventCount    = s.Serialize <byte>(EventCount, name: nameof(EventCount));
            s.SerializeArray <byte>(new byte[3], 3, name: "Padding");
            EventLinksPointer = s.SerializePointer(EventLinksPointer, name: nameof(EventLinksPointer));
            EventLinkCount    = s.Serialize <byte>(EventLinkCount, name: nameof(EventLinkCount));
            s.SerializeArray <byte>(new byte[3], 3, name: "Padding");

            if (EventCount != EventLinkCount)
            {
                Debug.LogError("Event counts don't match");
            }

            s.DoAt(EventsPointer, (() =>
            {
                // Serialize every event
                Events = s.SerializeObjectArray <R1_EventData>(Events, EventCount, name: nameof(Events));
            }));

            s.DoAt(EventLinksPointer, (() =>
            {
                // Serialize the event linking table
                EventLinkingTable = s.SerializeArray <byte>(EventLinkingTable, EventLinkCount, name: nameof(EventLinkingTable));
            }));
        }
Esempio n. 12
0
 public override void SerializeImpl(SerializerObject s)
 {
     Struct4Index = s.Serialize <byte>(Struct4Index, name: nameof(Struct4Index));
     Min          = s.Serialize <byte>(Min, name: nameof(Min));
     Max          = s.Serialize <byte>(Max, name: nameof(Max));
     Byte3        = s.Serialize <byte>(Byte3, name: nameof(Byte3));
 }
        public override void SerializeImpl(SerializerObject s)
        {
            TileSetPointer    = s.SerializePointer <GBAIsometric_RHR_TileSet>(TileSetPointer, resolve: true, name: nameof(TileSetPointer));
            StructType        = s.Serialize <MapLayerType>(StructType, name: nameof(StructType));
            Width             = s.Serialize <ushort>(Width, name: nameof(Width));
            Height            = s.Serialize <ushort>(Height, name: nameof(Height));
            Ushort_0A         = s.Serialize <ushort>(Ushort_0A, name: nameof(Ushort_0A));
            MapDataPointer    = s.SerializePointer(MapDataPointer, name: nameof(MapDataPointer));
            MapPalettePointer = s.SerializePointer(MapPalettePointer, name: nameof(MapPalettePointer));
            MapPalette        = s.DoAt(MapPalettePointer, () => s.SerializeObjectArray <RGBA5551Color>(MapPalette, 256, name: nameof(MapPalette)));

            s.DoAt(MapDataPointer, () =>
            {
                s.DoEncoded(new RHREncoder(), () => MapData = s.SerializeArray <ushort>(MapData, Width * Height, name: nameof(MapData)));
            });

            // Debug tilemaps
            //ushort[] fullMap = CreateFullMap(MapData);
            //string logString = $"{Offset}: Max Tilemap Value - {fullMap.Max()}";
            //UnityEngine.Debug.Log(logString);
            //s.Log(logString);
            //byte[] result = new byte[fullMap.Length * sizeof(ushort)];
            //Buffer.BlockCopy(fullMap, 0, result, 0, result.Length);
            //Util.ByteArrayToFile(s.Context.BasePath + "full_tilemap/" + Offset.StringAbsoluteOffset + ".bin", result);
        }
Esempio n. 14
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            InstrumentTable = s.SerializePointer <MusyX_InstrumentTable>(InstrumentTable, anchor: Offset, name: nameof(InstrumentTable));
            Unknown2List1   = s.SerializePointer <MusyX_UnknownTable>(Unknown2List1, anchor: Offset, resolve: true, name: nameof(Unknown2List1));
            Unknown2List2   = s.SerializePointer <MusyX_UnknownTable>(Unknown2List2, anchor: Offset, resolve: true, name: nameof(Unknown2List2));
            Unknown2List3   = s.SerializePointer <MusyX_UnknownTable>(Unknown2List3, anchor: Offset, resolve: true, name: nameof(Unknown2List3));
            UInt_10         = s.Serialize <uint>(UInt_10, name: nameof(UInt_10));
            UInt_14         = s.Serialize <uint>(UInt_14, name: nameof(UInt_14));
            SongTable       = s.SerializePointer <MusyX_SongTable>(SongTable, anchor: Offset, name: nameof(SongTable));
            SampleTable     = s.SerializePointer <MusyX_SampleTable>(SampleTable, anchor: Offset, name: nameof(SampleTable));


            // Read instrument table
            InstrumentTable.Resolve(s, onPreSerialize: st => {
                st.BaseOffset = Offset;
                st.EndOffset  = Unknown2List1.pointer;
            });

            // Read song table
            SongTable.Resolve(s, onPreSerialize: st => {
                st.BaseOffset = Offset;
                st.EndOffset  = SampleTable.pointer;
            });

            // Read sample table
            SampleTable.Resolve(s, onPreSerialize: st => {
                st.BaseOffset = Offset;
                //st.EndOffset = SampleTable.pointer;
            });
        }
Esempio n. 15
0
 public override void SerializeImpl(SerializerObject s)
 {
     ImageIndex = s.Serialize <byte>(ImageIndex, name: nameof(ImageIndex));
     XPosition  = s.Serialize <sbyte>(XPosition, name: nameof(XPosition));
     YPosition  = s.Serialize <sbyte>(YPosition, name: nameof(YPosition));
     Flags      = s.Serialize <Flag>(Flags, name: nameof(Flags));
 }
Esempio n. 16
0
        public override void SerializeBlock(SerializerObject s)
        {
            UShort_00            = s.Serialize <ushort>(UShort_00, name: nameof(UShort_00));
            PatternOffsetsOffset = s.Serialize <ushort>(PatternOffsetsOffset, name: nameof(PatternOffsetsOffset));
            Byte_04      = s.Serialize <byte>(Byte_04, name: nameof(Byte_04));
            PatternCount = s.Serialize <byte>(PatternCount, name: nameof(PatternCount));
            UInt_06      = s.Serialize <uint>(UInt_06, name: nameof(UInt_06));

            s.DoAt(BlockStartPointer + PatternOffsetsOffset, () => {
                PatternOffsets = s.SerializeArray <ushort>(PatternOffsets, PatternCount, name: nameof(PatternOffsets));
            });
            if (Patterns == null)
            {
                Patterns = new Pattern[PatternCount];
            }
            for (int i = 0; i < PatternCount; i++)
            {
                Patterns[i] = s.DoAt(BlockStartPointer + PatternOffsets[i], () => {
                    return(s.SerializeObject <Pattern>(Patterns[i], name: $"{nameof(Patterns)}[{i}]"));
                });
            }
            if (Patterns.Length > 0)
            {
                s.Goto(Patterns[Patterns.Length - 1].Offset + Patterns[Patterns.Length - 1].Size);
            }
        }
Esempio n. 17
0
        public override void SerializeBlock(SerializerObject s)
        {
            if (s.GameSettings.GBA_IsMilan && s.GameSettings.EngineVersion != EngineVersion.GBA_TomClancysRainbowSixRogueSpear)
            {
                // Copied from function at 0x080087e4 in The Mummy (US)

                // Serialize header
                s.DoAt(ShanghaiOffsetTable.GetPointer(0), () =>
                {
                    Milan_Ushort_00 = s.Serialize <ushort>(Milan_Ushort_00, name: nameof(Milan_Ushort_00));
                    Milan_Ushort_02 = s.Serialize <ushort>(Milan_Ushort_02, name: nameof(Milan_Ushort_02));
                });

                // Go to palette data
                s.Goto(ShanghaiOffsetTable.GetPointer(1));

                if (Milan_Palettes == null)
                {
                    Milan_Palettes = new Dictionary <int, RGBA5551Color[]>();

                    if (Milan_Ushort_00 == 0)
                    {
                        var palIndex = 0;

                        do
                        {
                            if (BitHelpers.ExtractBits(Milan_Ushort_02, 1, palIndex) == 1)
                            {
                                var pal = s.SerializeObjectArray <RGBA5551Color>(default, 0x10, name: $"Palette[{palIndex}]");
Esempio n. 18
0
 public override void SerializeImpl(SerializerObject s)
 {
     Pa = s.Serialize <short>(Pa, name: nameof(Pa));
     Pb = s.Serialize <short>(Pb, name: nameof(Pb));
     Pc = s.Serialize <short>(Pc, name: nameof(Pc));
     Pd = s.Serialize <short>(Pd, name: nameof(Pd));
 }
Esempio n. 19
0
 public override void SerializeImpl(SerializerObject s)
 {
     LayerGroupIndex = s.Serialize <byte>(LayerGroupIndex, name: nameof(LayerGroupIndex));
     Duration        = s.Serialize <byte>(Duration, name: nameof(Duration));
     XPosition       = s.Serialize <sbyte>(XPosition, name: nameof(XPosition));
     YPosition       = s.Serialize <sbyte>(YPosition, name: nameof(YPosition));
     Flags           = s.Serialize <Flag>(Flags, name: nameof(Flags));
 }
Esempio n. 20
0
 public override void SerializeImpl(SerializerObject s)
 {
     ImageResourceIndex = s.Serialize <byte>(ImageResourceIndex, name: nameof(ImageResourceIndex));
     Short1             = s.Serialize <short>(Short1, name: nameof(Short1));
     Byte3  = s.Serialize <byte>(Byte3, name: nameof(Byte3));
     Short4 = s.Serialize <short>(Short4, name: nameof(Short4));
     Short6 = s.Serialize <short>(Short6, name: nameof(Short6));
 }
Esempio n. 21
0
 public override void SerializeImpl(SerializerObject s)
 {
     XPosition = s.Serialize <short>(XPosition, name: nameof(XPosition));
     YPosition = s.Serialize <short>(YPosition, name: nameof(YPosition));
     Byte2     = s.Serialize <byte>(Byte2, name: nameof(Byte2));
     Count     = s.Serialize <byte>(Count, name: nameof(Count));
     Unknown   = s.SerializeArray <short>(Unknown, Count, name: nameof(Unknown));
 }
Esempio n. 22
0
 public override void SerializeImpl(SerializerObject s)
 {
     NumPoints = s.Serialize <byte>(NumPoints, name: nameof(NumPoints));
     NumPointsWithUShort_02 = s.Serialize <byte>(NumPointsWithUShort_02, name: nameof(NumPointsWithUShort_02));
     Byte_02 = s.Serialize <byte>(Byte_02, name: nameof(Byte_02));
     Byte_03 = s.Serialize <byte>(Byte_03, name: nameof(Byte_03));
     Points  = s.SerializeObjectArray <Point>(Points, NumPoints, name: nameof(Points));
 }
Esempio n. 23
0
        public override void SerializeImpl(SerializerObject s)
        {
            Width  = s.Serialize <byte>(Width, name: nameof(Width));
            Height = s.Serialize <byte>(Height, name: nameof(Height));
            Flags  = s.Serialize <FrameFlags>(Flags, name: nameof(Flags));

            s.DoEncodedIf(new FrameTileSetEncoder(Width * Height * (Flags.HasFlag(FrameFlags.Is8bit) ? 0x40 : 0x20)), Flags.HasFlag(FrameFlags.IsCompressed), () => TileSet = s.SerializeArray <byte>(TileSet, Width * Height * 0x20, name: nameof(TileSet)));
        }
Esempio n. 24
0
 public override void SerializeImpl(SerializerObject s)
 {
     DeltaRotation = s.Serialize <sbyte>(DeltaRotation, name: nameof(DeltaRotation));
     DeltaHeight   = s.Serialize <sbyte>(DeltaHeight, name: nameof(DeltaHeight));
     Type          = s.Serialize <byte>(Type, name: nameof(Type));
     Flags         = s.Serialize <TurnFlags>(Flags, name: nameof(Flags));
     Unknown       = s.Serialize <short>(Unknown, name: nameof(Unknown));
 }
 public override void SerializeImpl(SerializerObject s)
 {
     Byte_00    = s.Serialize <byte>(Byte_00, name: nameof(Byte_00));
     LayerCount = s.Serialize <byte>(LayerCount, name: nameof(LayerCount));
     Byte_02    = s.Serialize <byte>(Byte_02, name: nameof(Byte_02));
     Byte_03    = s.Serialize <byte>(Byte_03, name: nameof(Byte_03));
     Layers     = s.SerializeObjectArray <GBA_BatmanVengeance_AnimationChannel>(Layers, LayerCount, name: nameof(Layers));
 }
Esempio n. 26
0
 public override void SerializeImpl(SerializerObject s)
 {
     if (HasPalette)
     {
         Palette = s.Serialize <byte>(Palette, name: nameof(Palette));
     }
     Width  = s.Serialize <byte>(Width, name: nameof(Width));
     Height = s.Serialize <byte>(Height, name: nameof(Height));
 }
Esempio n. 27
0
 public override void SerializeImpl(SerializerObject s)
 {
     Length = s.Serialize <byte>(Length, name: nameof(Length));
     if (s.GameSettings.EngineVersion >= EngineVersion.Gameloft_RK)
     {
         AnimationUnusedByte = s.Serialize <byte>(AnimationUnusedByte, name: nameof(AnimationUnusedByte));
     }
     FrameIndex = s.Serialize <ushort>(FrameIndex, name: nameof(FrameIndex));
 }
Esempio n. 28
0
        /// <summary>
        /// Serializes the data
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            // Serialize map size
            Width  = s.Serialize <ushort>(Width, name: nameof(Width));
            Height = s.Serialize <ushort>(Height, name: nameof(Height));

            // Serialize tiles
            Tiles = s.SerializeObjectArray <MapTile>(Tiles, Width * Height, name: nameof(Tiles));
        }
Esempio n. 29
0
 /// <summary>
 /// Handles the data serialization
 /// </summary>
 /// <param name="s">The serializer object</param>
 public override void SerializeImpl(SerializerObject s)
 {
     Length     = s.Serialize <uint>(Length, name: nameof(Length));
     Int_04     = s.Serialize <int>(Int_04, name: nameof(Int_04));
     SampleRate = s.Serialize <ushort>(SampleRate, name: nameof(SampleRate));
     UShort_0A  = s.Serialize <ushort>(UShort_0A, name: nameof(UShort_0A));
     UInt_0C    = s.Serialize <uint>(UInt_0C, name: nameof(UInt_0C));
     SampleData = s.SerializeArray <sbyte>(SampleData, Length, name: nameof(SampleData));
 }
Esempio n. 30
0
 public override void SerializeImpl(SerializerObject s)
 {
     LinkedObjectsPointer  = s.SerializePointer(LinkedObjectsPointer, name: nameof(LinkedObjectsPointer));
     TriggerObjectsPointer = s.SerializePointer(TriggerObjectsPointer, name: nameof(TriggerObjectsPointer));
     LinkedObjectsCount    = s.Serialize <ushort>(LinkedObjectsCount, name: nameof(LinkedObjectsCount));
     TriggerObjectsCount   = s.Serialize <ushort>(TriggerObjectsCount, name: nameof(TriggerObjectsCount));
     Flags_0             = s.Serialize <GendoorFlags>(Flags_0, name: nameof(Flags_0));
     Flags_1             = s.Serialize <GendoorFlags>(Flags_1, name: nameof(Flags_1));
     RuntimeHasTriggered = s.Serialize <byte>(RuntimeHasTriggered, name: nameof(RuntimeHasTriggered));
     s.Serialize <byte>(default, name: "Padding"); // Not referenced by the code