Пример #1
0
        public override void SerializeImpl(SerializerObject s)
        {
            MapLayersPointers    = s.SerializePointerArray(MapLayersPointers, 4, name: nameof(MapLayersPointers));
            CollisionDataPointer = s.SerializePointer(CollisionDataPointer, name: nameof(CollisionDataPointer));
            LayersBlockPointer   = s.SerializePointer(LayersBlockPointer, name: nameof(LayersBlockPointer));
            HasDataBlockHeader   = s.Serialize <bool>(HasDataBlockHeader, name: nameof(HasDataBlockHeader));
            s.SerializeArray <byte>(new byte[3], 3, name: "Padding");
            ObjDataPointer         = s.SerializePointer(ObjDataPointer, name: nameof(ObjDataPointer));
            ObjDataUnkTablePointer = s.SerializePointer(ObjDataUnkTablePointer, name: nameof(ObjDataUnkTablePointer));
            s.SerializeArray <byte>(new byte[12], 12, name: "Padding"); // Always 0, but still part of the same struct

            if (MapLayers == null)
            {
                MapLayers = new GBAVV_Map2D_MapLayer[MapLayersPointers.Length];
            }

            for (int i = 0; i < MapLayers.Length; i++)
            {
                MapLayers[i] = s.DoAt(MapLayersPointers[i], () => s.SerializeObject <GBAVV_Map2D_MapLayer>(MapLayers[i], name: $"{nameof(MapLayers)}[{i}]"));
            }

            CollisionLayer = s.DoAt(CollisionDataPointer, () => s.SerializeObject <GBAVV_Map2D_MapLayer>(CollisionLayer, name: nameof(CollisionLayer)));

            LayersBlock = s.DoAt(LayersBlockPointer, () => s.SerializeObject <GBAVV_Map2D_LayersBlock>(LayersBlock, x =>
            {
                x.HasHeader = HasDataBlockHeader;
                x.MapData   = this;
            }, name: nameof(LayersBlock)));

            ObjData         = s.DoAt(ObjDataPointer, () => s.SerializeObject <GBAVV_Map2D_ObjData>(ObjData, name: nameof(ObjData)));
            ObjDataUnkTable = s.DoAt(ObjDataUnkTablePointer, () => s.SerializeObject <GBAVV_Map2D_ObjDataUnkTable>(ObjDataUnkTable, name: nameof(ObjDataUnkTable)));
        }
Пример #2
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            // Serialize font data
            FontData = s.SerializeObject <R1_PS1_FontData>(FontData, name: nameof(FontData));

            // Serialize fixed Rayman event
            RaymanEvent = s.SerializeObject <R1_EventData>(RaymanEvent, name: nameof(RaymanEvent));

            // Serialize event information
            EventsPointer = s.SerializePointer(EventsPointer, name: nameof(EventsPointer));

            if (s.GameSettings.EngineVersion == EngineVersion.R1_PS1_JPDemoVol3)
            {
                UnknownEventTablePointer = s.SerializePointer(UnknownEventTablePointer, name: nameof(UnknownEventTablePointer));
            }
            EventCount            = s.Serialize <uint>(EventCount, name: nameof(EventCount));
            EventLinkTablePointer = s.SerializePointer(EventLinkTablePointer, name: nameof(EventLinkTablePointer));
            EvenLinkCount         = s.Serialize <uint>(EvenLinkCount, name: nameof(EvenLinkCount));

            // Serialize data from pointers
            s.DoAt(EventsPointer, () => Events = s.SerializeObjectArray <R1_EventData>(Events, EventCount, name: nameof(Events)));

            if (UnknownEventTablePointer != null)
            {
                s.DoAt(UnknownEventTablePointer, () => UnknownEventTable = s.SerializeObjectArray <R1_PS1JPDemoVol3_UnknownEventTableItem>(UnknownEventTable, EventCount, name: nameof(UnknownEventTable)));
            }

            s.DoAt(EventLinkTablePointer, () => EventLinkTable = s.SerializeArray <byte>(EventLinkTable, EvenLinkCount, name: nameof(EventLinkTable)));
        }
Пример #3
0
        public override void SerializeImpl(SerializerObject s)
        {
            MapLayers = s.SerializeObjectArray <Layer>(MapLayers, 4, name: nameof(MapLayers));

            ObjectsCount    = s.Serialize <int>(ObjectsCount, name: nameof(ObjectsCount));
            WaypointsCount  = s.Serialize <int>(WaypointsCount, name: nameof(WaypointsCount));
            CollisionWidth  = s.Serialize <int>(CollisionWidth, name: nameof(CollisionWidth));
            CollisionHeight = s.Serialize <int>(CollisionHeight, name: nameof(CollisionHeight));

            ObjectsPointer   = s.SerializePointer(ObjectsPointer, name: nameof(ObjectsPointer));
            WaypointsPointer = s.SerializePointer(WaypointsPointer, name: nameof(WaypointsPointer));
            CollisionPointer = s.SerializePointer(CollisionPointer, name: nameof(CollisionPointer));

            Byte_6C = s.Serialize <byte>(Byte_6C, name: nameof(Byte_6C));
            Byte_6D = s.Serialize <byte>(Byte_6D, name: nameof(Byte_6D));
            Byte_6E = s.Serialize <byte>(Byte_6E, name: nameof(Byte_6E));
            Byte_6F = s.Serialize <byte>(Byte_6F, name: nameof(Byte_6F));

            LevelNameLocIndex = s.SerializeObject <GBAIsometric_LocIndex>(LevelNameLocIndex, name: nameof(LevelNameLocIndex));

            // Parse from pointers
            Objects   = s.DoAt(ObjectsPointer, () => s.SerializeObjectArray <GBAIsometric_Object>(Objects, ObjectsCount, name: nameof(Objects)));
            Waypoints = s.DoAt(WaypointsPointer, () => s.SerializeObjectArray <GBAIsometric_RHR_Waypoint>(Waypoints, WaypointsCount, name: nameof(Waypoints)));

            s.DoAt(CollisionPointer, () =>
            {
                s.DoEncoded(new RHREncoder(), () => CollisionData = s.SerializeObjectArray <GBAIsometric_TileCollision>(CollisionData, CollisionWidth * CollisionHeight, name: nameof(CollisionData)));
            });
        }
Пример #4
0
        public override void SerializeImpl(SerializerObject s)
        {
            MapsCount           = s.Serialize <uint>(MapsCount, name: nameof(MapsCount));
            MapsPointer         = s.SerializePointer(MapsPointer, name: nameof(MapsPointer));
            BonusMapPointer     = s.SerializePointer(BonusMapPointer, name: nameof(BonusMapPointer));
            ChallengeMapPointer = s.SerializePointer(ChallengeMapPointer, name: nameof(ChallengeMapPointer));

            MapsPointers = s.DoAt(MapsPointer, () => s.SerializePointerArray(MapsPointers, MapsCount, name: nameof(MapsPointers)));

            if (Maps == null)
            {
                Maps = new GBAVV_MapInfo[MapsCount];
            }

            for (int i = 0; i < Maps.Length; i++)
            {
                if (SerializeAll || (LevInfo?.MapIndex == i && LevInfo?.MapType == GBAVV_BaseManager.LevInfo.Type.Normal))
                {
                    Maps[i] = s.DoAt(MapsPointers[i], () => s.SerializeObject <GBAVV_MapInfo>(Maps[i], name: $"{nameof(Maps)}[{i}]"));
                }
            }

            if (SerializeAll || LevInfo?.MapType == GBAVV_BaseManager.LevInfo.Type.Bonus)
            {
                BonusMap = s.DoAt(BonusMapPointer, () => s.SerializeObject <GBAVV_MapInfo>(BonusMap, name: nameof(BonusMap)));
            }

            if (SerializeAll || LevInfo?.MapType == GBAVV_BaseManager.LevInfo.Type.Challenge)
            {
                ChallengeMap = s.DoAt(ChallengeMapPointer, () => s.SerializeObject <GBAVV_MapInfo>(ChallengeMap, name: nameof(ChallengeMap)));
            }
        }
Пример #5
0
 /// <summary>
 /// Handles the data serialization
 /// </summary>
 /// <param name="s">The serializer object</param>
 public override void SerializeImpl(SerializerObject s)
 {
     MapTilesPointer = s.SerializePointer(MapTilesPointer, name: nameof(MapTilesPointer));
     MapTileTexturesPointersPointer = s.SerializePointer(MapTileTexturesPointersPointer, name: nameof(MapTileTexturesPointersPointer));
     UnkPointer          = s.SerializePointer(UnkPointer, name: nameof(UnkPointer));
     TileTexturesPointer = s.SerializePointer(TileTexturesPointer, name: nameof(TileTexturesPointer));
 }
Пример #6
0
        public override void SerializeImpl(SerializerObject s)
        {
            DataPointer        = s.SerializePointer(DataPointer, name: nameof(DataPointer));
            DataOffsetsPointer = s.SerializePointer(DataOffsetsPointer, name: nameof(DataOffsetsPointer));

            s.DoAt(DataOffsetsPointer, () =>
            {
                s.DoEncoded(new RHREncoder(), () => DataOffsets = s.SerializeArray <ushort>(DataOffsets, s.CurrentLength / 2, name: nameof(DataOffsets)));
            });
            if (Data == null)
            {
                if (DataOffsets != null)
                {
                    Data = new TileData[DataOffsets.Length];
                    for (int i = 0; i < DataOffsets.Length; i++)
                    {
                        s.DoAt(DataPointer + DataOffsets[i] * 4, () => {
                            Data[i] = s.SerializeObject <TileData>(Data[i], onPreSerialize: td => td.TileCompression = TileCompression, name: $"{nameof(Data)}[{i}]");
                        });
                    }
                }
                else
                {
                    Data = new TileData[0];
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            Byte00         = s.Serialize <byte>(Byte00, name: nameof(Byte00));
            AnimationSpeed = s.Serialize <byte>(AnimationSpeed, name: nameof(AnimationSpeed));
            if (Byte00 != 0)
            {
                AnimationPointer = s.SerializePointer(AnimationPointer, name: nameof(AnimationPointer));
            }
            else
            {
                LinkedStatePointer = s.SerializePointer(LinkedStatePointer, name: nameof(LinkedStatePointer));
            }
            CodePointer = s.SerializePointer(CodePointer, name: nameof(CodePointer));
            Byte0A      = s.Serialize <byte>(Byte0A, name: nameof(Byte0A));
            Byte0B      = s.Serialize <byte>(Byte0B, name: nameof(Byte0B));

            s.DoAt(AnimationPointer, () => {
                Animation = s.SerializeObject <R1Jaguar_AnimationDescriptor>(Animation, name: nameof(Animation));
                //Animation = s.SerializeObject<Jaguar_R1_AnimationDescriptor>(Animation, onPreSerialize: l => l.FlipFlagInX = this.FlipFlagInX, name: nameof(Animation));
                //Animation = s.SerializeObject<Jaguar_R1_AnimationDescriptor>(Animation, onPreSerialize: l => l.FlipFlagInX = (Byte00 != 200), name: nameof(Animation));
            });
            s.DoAt(LinkedStatePointer, () => {
                LinkedState = s.SerializeObject <R1Jaguar_EventState>(LinkedState, name: nameof(LinkedState));
            });
        }
Пример #8
0
        public override void SerializeImpl(SerializerObject s)
        {
            TileSet8bppPointer = s.SerializePointer(TileSet8bppPointer, name: nameof(TileSet8bppPointer));
            TileSet4bppPointer = s.SerializePointer(TileSet4bppPointer, name: nameof(TileSet4bppPointer));

            TileSet8bpp = s.DoAt(TileSet8bppPointer, () => s.SerializeObject <GBAVV_WorldMap_TileSet>(TileSet8bpp, name: nameof(TileSet8bpp)));
            TileSet4bpp = s.DoAt(TileSet4bppPointer, () => s.SerializeObject <GBAVV_WorldMap_TileSet>(TileSet4bpp, name: nameof(TileSet4bpp)));
        }
Пример #9
0
 public override void SerializeImpl(SerializerObject s)
 {
     GraphicsDataPointer          = s.SerializePointer <GBAIsometric_RHR_GraphicsData>(GraphicsDataPointer, resolve: true, name: nameof(GraphicsDataPointer));
     LookupBufferPositionsPointer = s.SerializePointer(LookupBufferPositionsPointer, name: nameof(LookupBufferPositionsPointer));
     SpriteInfosPointer           = s.SerializePointer(SpriteInfosPointer, name: nameof(SpriteInfosPointer));
     Is8Bit      = s.Serialize <bool>(Is8Bit, name: nameof(Is8Bit));
     SpriteCount = s.Serialize <byte>(SpriteCount, name: nameof(SpriteCount));
     s.Serialize <ushort>(default, name: "Padding");
Пример #10
0
 public override void SerializeImpl(SerializerObject s)
 {
     FunctionPointer_0 = s.SerializePointer(FunctionPointer_0, name: nameof(FunctionPointer_0));
     FunctionPointer_1 = s.SerializePointer(FunctionPointer_1, name: nameof(FunctionPointer_1));
     FunctionPointer_2 = s.SerializePointer(FunctionPointer_2, name: nameof(FunctionPointer_2));
     Bytes_10          = s.SerializeArray <byte>(Bytes_10, 4, name: nameof(Bytes_10));
     AdditionalHeight  = s.SerializeObject <FixedPointInt>(AdditionalHeight, name: nameof(AdditionalHeight));
     Bytes_18          = s.SerializeArray <byte>(Bytes_18, 20, name: nameof(Bytes_18));
 }
        public override void SerializeImpl(SerializerObject s)
        {
            NamePointer  = s.SerializePointer(NamePointer, name: nameof(NamePointer));
            Uint_04      = s.Serialize <uint>(Uint_04, name: nameof(Uint_04));
            ModelPointer = s.SerializePointer(ModelPointer, name: nameof(ModelPointer));
            Bytes_0C     = s.SerializeArray <byte>(Bytes_0C, 68 - 4 * 3, name: nameof(Bytes_0C));

            Name  = s.DoAt(NamePointer, () => s.SerializeString(Name, name: nameof(Name)));
            Model = s.DoAt(ModelPointer, () => s.SerializeObject <GBAVV_Isometric_CharacterModel>(Model, name: nameof(Model)));
        }
Пример #12
0
        public override void SerializeImpl(SerializerObject s)
        {
            TilePositionsPointer = s.SerializePointer(TilePositionsPointer, name: nameof(TilePositionsPointer));
            TileShapesPointer    = s.SerializePointer(TileShapesPointer, name: nameof(TileShapesPointer));
            TileOffset           = s.Serialize <UInt24>(TileOffset, name: nameof(TileOffset));
            TilesCount           = s.Serialize <byte>(TilesCount, name: nameof(TilesCount));

            TilePositions = s.DoAt(TilePositionsPointer, () => s.SerializeObjectArray <TilePosition>(TilePositions, TilesCount, name: nameof(TilePositions)));
            TileShapes    = s.DoAt(TileShapesPointer, () => s.SerializeObjectArray <TileShape>(TileShapes, TilesCount, name: nameof(TileShapes)));
        }
Пример #13
0
        public override void SerializeImpl(SerializerObject s)
        {
            Uint_00        = s.Serialize <uint>(Uint_00, name: nameof(Uint_00));
            Pointer_04     = s.SerializePointer(Pointer_04, name: nameof(Pointer_04));
            PalettePointer = s.SerializePointer(PalettePointer, name: nameof(PalettePointer));
            NamePointer    = s.SerializePointer(NamePointer, name: nameof(NamePointer));

            Palette = s.DoAt(PalettePointer, () => s.SerializeObjectArray <ARGB1555Color>(Palette, 16, name: nameof(Palette)));
            Name    = s.DoAt(NamePointer, () => s.SerializeString(Name, name: nameof(Name)));
        }
Пример #14
0
 public override void SerializeImpl(SerializerObject s)
 {
     Byte_00             = s.Serialize <byte>(Byte_00, name: nameof(Byte_00));
     Is8Bit              = s.Serialize <bool>(Is8Bit, name: nameof(Is8Bit));
     Byte_02             = s.Serialize <byte>(Byte_02, name: nameof(Byte_02));
     Byte_03             = s.Serialize <byte>(Byte_03, name: nameof(Byte_03));
     GraphicsDataPointer = s.SerializePointer <GBAIsometric_RHR_GraphicsData>(GraphicsDataPointer, resolve: true, name: nameof(GraphicsDataPointer));
     Pointer1            = s.SerializePointer(Pointer1, name: nameof(Pointer1));
     Pointer2            = s.SerializePointer(Pointer2, name: nameof(Pointer2));
 }
Пример #15
0
        public override void SerializeImpl(SerializerObject s)
        {
            LocID           = s.Serialize <uint>(LocID, name: nameof(LocID));
            SpritePointer   = s.SerializePointer(SpritePointer, name: nameof(SpritePointer));
            PalettePointer0 = s.SerializePointer(PalettePointer0, name: nameof(PalettePointer0));
            PalettePointer1 = s.SerializePointer(PalettePointer1, name: nameof(PalettePointer1));

            Sprite   = s.DoAt(SpritePointer, () => s.SerializeObject <GBAIsometric_RHR_Sprite>(Sprite, name: nameof(Sprite)));
            Palette0 = s.DoAt(PalettePointer0, () => s.SerializeObjectArray <RGBA5551Color>(Palette0, 16, name: nameof(Palette0)));
            Palette1 = s.DoAt(PalettePointer1, () => s.SerializeObjectArray <RGBA5551Color>(Palette1, 16, name: nameof(Palette1)));
        }
Пример #16
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            PalettePointer = s.SerializePointer(PalettePointer, name: nameof(PalettePointer));
            UInt_04        = s.Serialize <uint>(UInt_04, name: nameof(UInt_04));
            NamePointer    = s.SerializePointer(NamePointer, name: nameof(NamePointer));

            s.DoAt(NamePointer, () => Name = s.SerializeString(Name, name: nameof(Name)));
            s.DoAt(PalettePointer, () => {
                Palette = s.SerializeObjectArray <RGBA5551Color>(Palette, 256, name: nameof(Palette));
            });
        }
Пример #17
0
        public override void SerializeImpl(SerializerObject s)
        {
            UInt_00 = s.Serialize <uint>(UInt_00, name: nameof(UInt_00));
            CompressionLookupBufferLength = s.Serialize <uint>(CompressionLookupBufferLength, name: nameof(CompressionLookupBufferLength));
            TotalLength = s.Serialize <uint>(TotalLength, name: nameof(TotalLength));

            CompressionLookupPointer = s.SerializePointer(CompressionLookupPointer, name: nameof(CompressionLookupPointer));
            CompressedDataPointer    = s.SerializePointer(CompressedDataPointer, name: nameof(CompressedDataPointer));

            // Serialize data from pointers
            CompressionLookupBuffer = s.DoAt(CompressionLookupPointer, () => s.SerializeArray <byte>(CompressionLookupBuffer, CompressionLookupBufferLength, name: nameof(CompressionLookupBuffer)));
        }
Пример #18
0
        public override void SerializeImpl(SerializerObject s)
        {
            TilePalette2DPointer = s.SerializePointer(TilePalette2DPointer, name: nameof(TilePalette2DPointer));
            MapData2DPointer     = s.SerializePointer(MapData2DPointer, name: nameof(MapData2DPointer));
            MapType   = s.Serialize <GBAVV_MapType>(MapType, name: nameof(MapType));
            Uint_0C   = s.Serialize <uint>(Uint_0C, name: nameof(Uint_0C));
            Index3D   = s.Serialize <short>(Index3D, name: nameof(Index3D));
            Alpha_BG3 = s.Serialize <byte>(Alpha_BG3, name: nameof(Alpha_BG3));
            Alpha_BG2 = s.Serialize <byte>(Alpha_BG2, name: nameof(Alpha_BG2));

            TilePalette2D = s.DoAt(TilePalette2DPointer, () => s.SerializeObjectArray <RGBA5551Color>(TilePalette2D, 256, name: nameof(TilePalette2D)));
            MapData2D     = s.DoAt(MapData2DPointer, () => s.SerializeObject <GBAVV_Map2D_Data>(MapData2D, name: nameof(MapData2D)));
        }
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            // Serialize pointers
            AnimLayersPointer = s.SerializePointer(AnimLayersPointer, name: nameof(AnimLayersPointer));
            AnimFramesPointer = s.SerializePointer(AnimFramesPointer, name: nameof(AnimFramesPointer));

            // Serialize data
            LayersPerFrameSerialized = s.Serialize <ushort>(LayersPerFrameSerialized, name: nameof(LayersPerFrameSerialized));
            FrameCountSerialized     = s.Serialize <ushort>(FrameCountSerialized, name: nameof(FrameCountSerialized));

            // Serialize data from pointers
            s.DoAt(AnimLayersPointer, () => Layers = s.SerializeObjectArray(Layers, LayersPerFrame * FrameCount, name: nameof(Layers)));
            s.DoAt(AnimFramesPointer, () => Frames = s.SerializeObjectArray(Frames, FrameCount, name: nameof(Frames)));
        }
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            ComplexDataPointer = s.SerializePointer(ComplexDataPointer, name: nameof(ComplexDataPointer));
            CodePointer1       = s.SerializePointer(CodePointer1, name: nameof(CodePointer1));
            CodePointer2       = s.SerializePointer(CodePointer2, name: nameof(CodePointer2));
            UnkBytes           = s.SerializeArray <byte>(UnkBytes, 0x14, name: nameof(UnkBytes));

            s.DoAt(ComplexDataPointer, () => {
                ComplexData = s.SerializeObject <R1Jaguar_EventComplexData>(ComplexData, onPreSerialize: complexData => {
                    complexData.StructType = StructType;
                    complexData.NumLayers  = NumLayers;
                }, name: nameof(ComplexData));
            });
        }
Пример #21
0
        public void SerializeData(SerializerObject s, Pointer eventGraphicsPointers, Pointer eventDataPointers, Pointer eventGraphicsGroupCountTablePointers, Pointer levelEventGraphicsGroupCounts)
        {
            // Get the global level index
            var levelIndex = ((R1_GBA_Manager)s.Context.Settings.GetGameManager).LoadData(s.Context).WorldLevelOffsetTable[s.GameSettings.World] + (s.GameSettings.Level - 1);

            // Serialize data
            s.DoAt(eventGraphicsPointers + (uint)(4 * levelIndex),
                   () => EventGraphicsPointer = s.SerializePointer(EventGraphicsPointer, name: nameof(EventGraphicsPointer)));
            s.DoAt(eventDataPointers + (uint)(4 * levelIndex),
                   () => EventDataPointer = s.SerializePointer(EventDataPointer, name: nameof(EventDataPointer)));
            s.DoAt(eventGraphicsGroupCountTablePointers + (uint)(4 * levelIndex),
                   () => GraphicsGroupCountTablePointer = s.SerializePointer(GraphicsGroupCountTablePointer, name: nameof(GraphicsGroupCountTablePointer)));
            s.DoAt(levelEventGraphicsGroupCounts + (uint)(4 * levelIndex),
                   () => GraphicsGroupCount = s.Serialize <uint>(GraphicsGroupCount, name: nameof(GraphicsGroupCount)));


            // Parse data from pointers
            s.DoAt(GraphicsGroupCountTablePointer, () => GraphicsGroupCountTable = s.SerializeArray <byte>(GraphicsGroupCountTable, GraphicsGroupCount, name: nameof(GraphicsGroupCountTable)));
            s.DoAt(EventGraphicsPointer, () => GraphicDataPointers = s.SerializePointerArray(GraphicDataPointers, GraphicsGroupCount, name: nameof(GraphicDataPointers)));

            if (GraphicData == null)
            {
                GraphicData = new R1_GBA_EventGraphicsData[GraphicsGroupCount];
            }

            for (int i = 0; i < GraphicData.Length; i++)
            {
                s.DoAt(GraphicDataPointers[i], () => GraphicData[i] = s.SerializeObject <R1_GBA_EventGraphicsData>(GraphicData[i], name: $"{nameof(GraphicData)}[{i}]"));
            }

            s.DoAt(EventDataPointer, () => EventDataPointers = s.SerializePointerArray(EventDataPointers, GraphicsGroupCount, name: nameof(EventDataPointers)));

            if (EventData == null)
            {
                EventData = new R1_GBA_EventData[GraphicsGroupCount][];
            }

            for (int i = 0; i < EventData.Length; i++)
            {
                if (EventDataPointers[i] != null)
                {
                    s.DoAt(EventDataPointers[i], () => EventData[i] = s.SerializeObjectArray <R1_GBA_EventData>(EventData[i], GraphicsGroupCountTable[i], name: $"{nameof(EventData)}[{i}]"));
                }
                else
                {
                    EventData[i] = new R1_GBA_EventData[0];
                }
            }
        }
Пример #22
0
 public override void SerializeImpl(SerializerObject s)
 {
     LevelDataPointer = s.SerializePointer <GBAIsometric_LevelData>(LevelDataPointer, resolve: true, name: nameof(LevelDataPointer));
     MurfyStampScore1 = s.Serialize <short>(MurfyStampScore1, name: nameof(MurfyStampScore1));
     MurfyStampScore2 = s.Serialize <short>(MurfyStampScore2, name: nameof(MurfyStampScore2));
     MurfyStampScore3 = s.Serialize <short>(MurfyStampScore3, name: nameof(MurfyStampScore3));
     Short_0A         = s.Serialize <short>(Short_0A, name: nameof(Short_0A));
     Short_0C         = s.Serialize <short>(Short_0C, name: nameof(Short_0C));
     Short_0E         = s.Serialize <short>(Short_0E, name: nameof(Short_0E));
     Short_10         = s.Serialize <short>(Short_10, name: nameof(Short_10));
     Short_12         = s.Serialize <short>(Short_12, name: nameof(Short_12));
     Short_14         = s.Serialize <short>(Short_14, name: nameof(Short_14));
     Bytes_16         = s.SerializeArray <byte>(Bytes_16, 14, name: nameof(Bytes_16));
     MapPointer       = s.SerializePointer(MapPointer, resolve: true, name: nameof(MapPointer));
 }
        public override void SerializeImpl(SerializerObject s)
        {
            ID = s.Serialize <uint>(ID, name: nameof(ID));
            DialogDataPointer = s.SerializePointer(DialogDataPointer, name: nameof(DialogDataPointer));

            DialogData = s.DoAt(DialogDataPointer, () => s.SerializeObject <GBAIsometric_Spyro_DialogData>(DialogData, name: nameof(DialogData)));
        }
        public override void SerializeImpl(SerializerObject s)
        {
            DialogCount   = s.Serialize <uint>(DialogCount, name: nameof(DialogCount));
            DialogPointer = s.SerializePointer(DialogPointer, name: nameof(DialogPointer));

            Dialog = s.DoAt(DialogPointer, () => s.SerializeObjectArray <GBAIsometric_RHR_CutsceneDialog>(Dialog, DialogCount, name: nameof(Dialog)));
        }
Пример #25
0
        public override void SerializeImpl(SerializerObject s)
        {
            ObjFlags    = s.Serialize <uint>(ObjFlags, name: nameof(ObjFlags));
            DataPointer = s.SerializePointer(DataPointer, name: nameof(DataPointer));

            Data = s.DoAt(DataPointer, () => s.SerializeObject <GBAIsometric_ObjectTypeData>(Data, name: nameof(Data)));
        }
Пример #26
0
        public override void SerializeImpl(SerializerObject s)
        {
            TileSetPointer = s.SerializePointer(TileSetPointer, name: nameof(TileSetPointer));
            PaletteIndex   = s.Serialize <uint>(PaletteIndex, name: nameof(PaletteIndex));

            TileSet = s.DoAt(TileSetPointer, () => s.SerializeObject <GBAVV_Map2D_TileSet>(TileSet, name: nameof(TileSet)));
        }
Пример #27
0
        public override void SerializeImpl(SerializerObject s)
        {
            TileMapPointer  = s.SerializePointer(TileMapPointer, name: nameof(TileMapPointer));
            DataBlockOffset = s.Serialize <uint>(DataBlockOffset, name: nameof(DataBlockOffset));
            TileSetPointer  = s.SerializePointer(TileSetPointer, name: nameof(TileSetPointer));
            ScrollX         = s.Serialize <uint>(ScrollX, name: nameof(ScrollX));
            ScrollY         = s.Serialize <uint>(ScrollY, name: nameof(ScrollY));
            LayerPrio       = s.Serialize <ushort>(LayerPrio, name: nameof(LayerPrio));
            TileMapWidth    = s.Serialize <ushort>(TileMapWidth, name: nameof(TileMapWidth));
            TileMapHeight   = s.Serialize <ushort>(TileMapHeight, name: nameof(TileMapHeight));
            MapWidth        = s.Serialize <ushort>(MapWidth, name: nameof(MapWidth));
            MapHeight       = s.Serialize <ushort>(MapHeight, name: nameof(MapHeight));
            Ushort_1E       = s.Serialize <ushort>(Ushort_1E, name: nameof(Ushort_1E));

            TileMap = s.DoAt(TileMapPointer, () => s.SerializeArray <ushort>(TileMap, TileMapWidth * TileMapHeight, name: nameof(TileMap)));
            TileSet = s.DoAt(TileSetPointer, () => s.SerializeObject <GBAVV_Map2D_TileSet>(TileSet, name: nameof(TileSet)));
        }
Пример #28
0
        /// <summary>
        /// Handles the data serialization
        /// </summary>
        /// <param name="s">The serializer object</param>
        public override void SerializeImpl(SerializerObject s)
        {
            StringPointer = s.SerializePointer(StringPointer, anchor: StringBase, name: nameof(StringPointer));
            Type          = s.Serialize <EntryType>(Type, name: nameof(Type));
            s.SerializeArray <byte>(new byte[3], 3, name: "Padding");

            if (Type == EntryType.DataBlock)
            {
                DataPointer = s.SerializePointer(DataPointer, name: nameof(DataPointer));
            }
            else
            {
                DataValue = s.Serialize <uint>(DataValue, name: nameof(DataValue));
            }

            s.DoAt(StringPointer, () => String = s.SerializeString(String, name: nameof(String)));
        }
Пример #29
0
        public override void SerializeImpl(SerializerObject s)
        {
            Ushort_00      = s.Serialize <ushort>(Ushort_00, name: nameof(Ushort_00));
            ObjectsCount   = s.Serialize <ushort>(ObjectsCount, name: nameof(ObjectsCount));
            ObjectsPointer = s.SerializePointer(ObjectsPointer, name: nameof(ObjectsPointer));

            Objects = s.DoAt(ObjectsPointer, () => s.SerializeObjectArray <GBAVV_Map2D_Object>(Objects, ObjectsCount, name: nameof(Objects)));
        }
Пример #30
0
 public override void SerializeImpl(SerializerObject s)
 {
     ActorID = s.SerializeString(ActorID, length: 4, name: nameof(ActorID));
     Uint_04 = s.Serialize <uint>(Uint_04, name: nameof(Uint_04));
     ActorFunctionPointer = s.SerializePointer(ActorFunctionPointer, name: nameof(ActorFunctionPointer));
     Uint_0C = s.Serialize <uint>(Uint_0C, name: nameof(Uint_0C));
     Uint_20 = s.Serialize <uint>(Uint_20, name: nameof(Uint_20));
 }