public void Serialize(IBinarySerializer s) { Unknown1 = s.SerializeArray <byte>(Unknown1, 528, name: nameof(Unknown1)); Unknown2 = s.SerializeBool <uint>(Unknown2, name: nameof(Unknown2)); SaveData = s.SerializeObject <PersistentGameData_Universe>(SaveData, name: nameof(SaveData)); Unknown3 = s.SerializeArray <byte>(Unknown3, (int)(s.Stream.Length - s.Stream.Position), name: nameof(Unknown3)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Unk1 = s.SerializeArray <byte>(Unk1, 3, name: nameof(Unk1)); LastLevel = s.Serialize <byte>(LastLevel, name: nameof(LastLevel)); Unk2 = s.SerializeArray <byte>(Unk2, 7, name: nameof(Unk2)); GlobalArray = s.SerializeArray <int>(GlobalArray, 45, name: nameof(GlobalArray)); Unk3 = s.SerializeArray <byte>(Unk3, 5, name: nameof(Unk3)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Header_0 = s.SerializeArray <byte>(Header_0, 35, name: nameof(Header_0)); CompressionType = s.Serialize <TextureCompressionType>(CompressionType, name: nameof(CompressionType)); Dimensions = s.Serialize <int>(Dimensions, name: nameof(Dimensions)); Width = BitHelpers.ExtractBits(Dimensions, 13, 0) + 1; Height = BitHelpers.ExtractBits(Dimensions, 13, 13) + 1; Header_1 = s.SerializeArray <byte>(Header_1, 12, name: nameof(Header_1)); ImgData = s.SerializeArray <byte>(ImgData, (int)(s.Stream.Length - s.Stream.Position), name: nameof(ImgData)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { TotalCages = s.Serialize <int>(TotalCages, name: nameof(TotalCages)); TotalScore = s.Serialize <int>(TotalScore, name: nameof(TotalScore)); Levels = s.SerializeObjectArray <Rayman3PCSaveDataLevel>(Levels, 9, name: nameof(Levels)); ForKeyAlgo = s.Serialize <uint>(ForKeyAlgo, name: nameof(ForKeyAlgo)); Dword_7FE504 = s.Serialize <uint>(Dword_7FE504, name: nameof(Dword_7FE504)); Dword_7FE508 = s.Serialize <uint>(Dword_7FE508, name: nameof(Dword_7FE508)); Dword_7FE50C = s.Serialize <uint>(Dword_7FE50C, name: nameof(Dword_7FE50C)); EndOfGameIsDone = s.SerializeBool <uint>(EndOfGameIsDone, name: nameof(EndOfGameIsDone)); MaxIndCurrentEnv = s.Serialize <uint>(MaxIndCurrentEnv, name: nameof(MaxIndCurrentEnv)); UnusedDword1 = s.Serialize <uint>(UnusedDword1, name: nameof(UnusedDword1)); UnusedDword2 = s.Serialize <uint>(UnusedDword2, name: nameof(UnusedDword2)); DummyByte = s.Serialize <byte>(DummyByte, name: nameof(DummyByte)); IsVibrationEnabled = s.Serialize <bool>(IsVibrationEnabled, name: nameof(IsVibrationEnabled)); IsHorizontalInversionEnabled = s.Serialize <bool>(IsHorizontalInversionEnabled, name: nameof(IsHorizontalInversionEnabled)); IsVerticalInversionEnabled = s.Serialize <bool>(IsVerticalInversionEnabled, name: nameof(IsVerticalInversionEnabled)); KeyboardMapping = s.SerializeArray <DirectXKey>(KeyboardMapping, 13, name: nameof(KeyboardMapping)); ControllerMapping = s.SerializeArray <ushort>(ControllerMapping, 13, name: nameof(ControllerMapping)); UserWarnedAboutAutoSave = s.Serialize <int>(UserWarnedAboutAutoSave, name: nameof(UserWarnedAboutAutoSave)); RevisitMode = s.Serialize <int>(RevisitMode, name: nameof(RevisitMode)); RevisitEnvScoreAtBeginingOfLevel = s.Serialize <int>(RevisitEnvScoreAtBeginingOfLevel, name: nameof(RevisitEnvScoreAtBeginingOfLevel)); RevisitGlobalScoreAtBeginingOfLevel = s.Serialize <int>(RevisitGlobalScoreAtBeginingOfLevel, name: nameof(RevisitGlobalScoreAtBeginingOfLevel)); RevisitIndCurrentEnv = s.Serialize <int>(RevisitIndCurrentEnv, name: nameof(RevisitIndCurrentEnv)); RevisitIndEnvironementFromWhereWeCome = s.Serialize <int>(RevisitIndEnvironementFromWhereWeCome, name: nameof(RevisitIndEnvironementFromWhereWeCome)); LevelNameToSave = s.SerializeString(LevelNameToSave, 20, LevelNameToSave); LevelNameAfterReinitToSave = s.SerializeString(LevelNameAfterReinitToSave, 20, LevelNameAfterReinitToSave); Unk1 = s.SerializeArray <byte>(Unk1, 16, name: nameof(Unk1)); SetVolumeSound = s.Serialize <int>(SetVolumeSound, name: nameof(SetVolumeSound)); SetVolumeVoice = s.Serialize <int>(SetVolumeVoice, name: nameof(SetVolumeVoice)); SetVolumeMusic = s.Serialize <int>(SetVolumeMusic, name: nameof(SetVolumeMusic)); SetVolumeAmbiance = s.Serialize <int>(SetVolumeAmbiance, name: nameof(SetVolumeAmbiance)); SetVolumeMenu = s.Serialize <int>(SetVolumeMenu, name: nameof(SetVolumeMenu)); if (s.IsReading) { var temp = new List <Rayman3PCSaveDataEntry>(); var index = 0; while (temp.LastOrDefault()?.KeyLength != 0) { temp.Add(s.SerializeObject <Rayman3PCSaveDataEntry>(default, name: $"{Items}[{index}]"));
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // 3DS files can not be serialized separately if (IPKVersion == 4) { throw new BinarySerializableException("File data for IPK 4 can not be serialized separately"); } // Read common values OffsetCount = s.Serialize <uint>(OffsetCount, name: nameof(OffsetCount)); Size = s.Serialize <uint>(Size, name: nameof(Size)); CompressedSize = s.Serialize <uint>(CompressedSize, name: nameof(CompressedSize)); TStamp = s.Serialize <ulong>(TStamp, name: nameof(TStamp)); Offsets = s.SerializeArray <ulong>(Offsets, (int)OffsetCount, name: nameof(Offsets)); // For any game after Origins the path is in the standard format if (IPKVersion >= 5) { Path = s.SerializeObject <UbiArtPath>(Path, name: nameof(Path)); } else { Path = new UbiArtPath(s.SerializeLengthPrefixedString(Path?.FullPath, name: nameof(Path))); } }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Lums = s.Serialize <byte>(Lums, name: nameof(Lums)); TeensiesFreed = s.Serialize <byte>(TeensiesFreed, name: nameof(TeensiesFreed)); Unknown1 = s.Serialize <byte>(Unknown1, name: nameof(Unknown1)); Unknown2 = s.SerializeArray <byte>(Unknown2, 11, name: nameof(Unknown2)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // Read the unknown value Unknown = s.Serialize <ushort>(Unknown, name: nameof(Unknown)); // Create the level collection Levels = s.SerializeObjectArray <FiestaRunPCSaveDataLevel>(Levels, 72, name: nameof(Levels)); // Read unknown bytes Unknown1 = s.SerializeArray <byte>(Unknown1, 128, name: nameof(Unknown1)); // Read Lums Lums = s.Serialize <uint>(Lums, name: nameof(Lums)); // Read remaining bytes Unknown2 = s.SerializeArray <byte>(Unknown2, (int)(s.Stream.Length - s.Stream.Position), name: nameof(Unknown2)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Strings = s.SerializeUbiArtObjectArray <UbiArtLocStringValuePair>(Strings, name: nameof(Strings)); Audio = s.SerializeUbiArtObjectArray <UbiArtKeyObjValuePair <int, UbiArtLocalizationAudio> >(Audio, name: nameof(Audio)); Paths = s.SerializeUbiArtArray <string>(Paths, name: nameof(Paths)); Unknown = s.SerializeArray <uint>(Unknown, (int)(s.Stream.Length - s.Stream.Position) / sizeof(uint), name: nameof(Unknown)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { DirectoryIndex = s.Serialize <int>(DirectoryIndex, name: nameof(DirectoryIndex)); FileName = s.SerializeOpenSpaceEncryptedString(FileName, XORKey, name: nameof(FileName)); FileXORKey = s.SerializeArray <byte>(FileXORKey, 4, name: nameof(FileXORKey)); Checksum = s.Serialize <uint>(Checksum, name: nameof(Checksum)); Pointer = s.Serialize <uint>(Pointer, name: nameof(Pointer)); Size = s.Serialize <uint>(Size, name: nameof(Size)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // Serialize the unknown value Unknown = s.Serialize <ushort>(Unknown, name: nameof(Unknown)); // Serialize the level collection Levels = s.SerializeObjectArray <JungleRunPCSaveDataLevel>(Levels, 70, name: nameof(Levels)); // Serialize remaining bytes RemainingBytes = s.SerializeArray <byte>(RemainingBytes, (int)(s.Stream.Length - s.Stream.Position), name: nameof(RemainingBytes)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { SaveName = s.SerializeString(SaveName, 4, name: nameof(SaveName)); ContinuesCount = s.Serialize <byte>(ContinuesCount, name: nameof(ContinuesCount)); Wi_Save_Zone = s.SerializeObjectArray <Rayman1PCSaveDataLevel>(Wi_Save_Zone, 24, name: nameof(Wi_Save_Zone)); RayEvts = s.Serialize <RayEvtsFlags>(RayEvts, name: nameof(RayEvts)); Poing = s.SerializeArray <byte>(Poing, 20, name: nameof(Poing)); StatusBar = s.SerializeObject <Rayman1PCSaveDataStatusBar>(StatusBar, name: nameof(StatusBar)); CurrentHealth = s.Serialize <byte>(CurrentHealth, name: nameof(CurrentHealth)); SaveZone ??= new byte[81][]; for (int i = 0; i < SaveZone.Length; i++) { SaveZone[i] = s.SerializeArray <byte>(SaveZone[i], 32, name: $"{nameof(SaveZone)}[{i}]"); } BonusPerfect = s.SerializeArray <byte>(BonusPerfect, 24, name: nameof(BonusPerfect)); WorldIndex = s.Serialize <ushort>(WorldIndex, name: nameof(WorldIndex)); FinBossLevel = s.Serialize <Rayman1FinBossLevelFlags>(FinBossLevel, name: nameof(FinBossLevel)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { VersionLength = s.Serialize <int>(VersionLength, name: nameof(VersionLength)); Version = s.SerializeString(Version, VersionLength + 1, name: nameof(Version)); SlotCount = s.Serialize <int>(SlotCount, name: nameof(SlotCount)); Slots = s.SerializeObjectArray <Rayman2PCConfigSlotData>(Slots, SlotCount, name: nameof(Slots)); UnkDword1 = s.Serialize <int>(UnkDword1, name: nameof(UnkDword1)); UnkDword2 = s.Serialize <int>(UnkDword2, name: nameof(UnkDword2)); Lumonosity = s.Serialize <int>(Lumonosity, name: nameof(Lumonosity)); SoundEffectVolume = s.Serialize <int>(SoundEffectVolume, name: nameof(SoundEffectVolume)); MusicVolume = s.Serialize <int>(MusicVolume, name: nameof(MusicVolume)); UnkDword6 = s.Serialize <int>(UnkDword6, name: nameof(UnkDword6)); Unk2 = s.SerializeArray <byte>(Unk2, 7, name: nameof(Unk2)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // Get the settings var settings = s.GetSettings <Ray1Settings>(); if (settings.Game == Ray1Game.Rayman1) { FileOffset = s.Serialize <uint>(FileOffset, name: nameof(FileOffset)); FileSize = s.Serialize <uint>(FileSize, name: nameof(FileSize)); XORKey = s.Serialize <byte>(XORKey, name: nameof(XORKey)); Checksum = s.Serialize <byte>(Checksum, name: nameof(Checksum)); s.SerializeArray <byte>(new byte[2], 2, name: "Padding"); } else { XORKey = s.Serialize <byte>(XORKey, name: nameof(XORKey)); Checksum = s.Serialize <byte>(Checksum, name: nameof(Checksum)); FileOffset = s.Serialize <uint>(FileOffset, name: nameof(FileOffset)); FileSize = s.Serialize <uint>(FileSize, name: nameof(FileSize)); s.DoXOR(XORKey, () => FileName = s.SerializeString(FileName, 9, name: nameof(FileName))); } }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Data = s.SerializeArray <byte>(Data, 17, name: nameof(Data)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // Get the settings var settings = s.GetSettings <Ray1Settings>(); if (settings.Game == Ray1Game.Rayman1) { Language = s.Serialize <R1Languages>(Language, name: nameof(Language)); } Port = s.Serialize <uint>(Port, name: nameof(Port)); Irq = s.Serialize <uint>(Irq, name: nameof(Irq)); Dma = s.Serialize <uint>(Dma, name: nameof(Dma)); Param = s.Serialize <uint>(Param, name: nameof(Param)); DeviceID = s.Serialize <uint>(DeviceID, name: nameof(DeviceID)); NumCard = s.Serialize <byte>(NumCard, name: nameof(NumCard)); KeyJump = s.Serialize <ushort>(KeyJump, name: nameof(KeyJump)); KeyWeapon = s.Serialize <ushort>(KeyWeapon, name: nameof(KeyWeapon)); Options_jeu_10 = s.Serialize <ushort>(Options_jeu_10, name: nameof(Options_jeu_10)); KeyAction = s.Serialize <ushort>(KeyAction, name: nameof(KeyAction)); MusicCdActive = s.Serialize <ushort>(MusicCdActive, name: nameof(MusicCdActive)); VolumeSound = s.Serialize <ushort>(VolumeSound, name: nameof(VolumeSound)); IsStero = s.Serialize <ushort>(IsStero, name: nameof(IsStero)); if (settings.Game != Ray1Game.Rayman1) { EDU_VoiceSound = s.Serialize <ushort>(EDU_VoiceSound, name: nameof(EDU_VoiceSound)); } Mode_Pad = s.Serialize <bool>(Mode_Pad, name: nameof(Mode_Pad)); Port_Pad = s.Serialize <byte>(Port_Pad, name: nameof(Port_Pad)); XPadMax = s.Serialize <short>(XPadMax, name: nameof(XPadMax)); XPadMin = s.Serialize <short>(XPadMin, name: nameof(XPadMin)); YPadMax = s.Serialize <short>(YPadMax, name: nameof(YPadMax)); YPadMin = s.Serialize <short>(YPadMin, name: nameof(YPadMin)); XPadCentre = s.Serialize <short>(XPadCentre, name: nameof(XPadCentre)); YPadCentre = s.Serialize <short>(YPadCentre, name: nameof(YPadCentre)); NotBut = s.SerializeArray <byte>(NotBut, 4, name: nameof(NotBut)); Tab_Key = s.SerializeArray <byte>(Tab_Key, 7, name: nameof(Tab_Key)); GameModeVideo = s.Serialize <byte>(GameModeVideo, name: nameof(GameModeVideo)); P486 = s.Serialize <byte>(P486, name: nameof(P486)); SizeScreen = s.Serialize <byte>(SizeScreen, name: nameof(SizeScreen)); Frequence = s.Serialize <Rayman1Freq>(Frequence, name: nameof(Frequence)); FixOn = s.Serialize <bool>(FixOn, name: nameof(FixOn)); BackgroundOptionOn = s.Serialize <bool>(BackgroundOptionOn, name: nameof(BackgroundOptionOn)); ScrollDiffOn = s.Serialize <bool>(ScrollDiffOn, name: nameof(ScrollDiffOn)); RefRam2VramNormalFix = s.SerializeArray <ushort>(RefRam2VramNormalFix, 8, name: nameof(RefRam2VramNormalFix)); RefRam2VramNormal = s.SerializeArray <ushort>(RefRam2VramNormal, 8, name: nameof(RefRam2VramNormal)); RefTransFondNormal = s.SerializeArray <ushort>(RefTransFondNormal, 8, name: nameof(RefTransFondNormal)); RefSpriteNormal = s.SerializeArray <ushort>(RefSpriteNormal, 2, name: nameof(RefSpriteNormal)); RefRam2VramX = s.SerializeArray <ushort>(RefRam2VramX, 2, name: nameof(RefRam2VramX)); RefVram2VramX = s.SerializeArray <ushort>(RefVram2VramX, 2, name: nameof(RefVram2VramX)); RefSpriteX = s.SerializeArray <ushort>(RefSpriteX, 2, name: nameof(RefSpriteX)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { TexHeader = s.SerializeObject <UbiArtTEXData>(TexHeader, name: nameof(TexHeader)); ImageData = s.SerializeArray <byte>(ImageData, (int)(s.Stream.Length - s.Stream.Position), name: nameof(ImageData)); }