Esempio n. 1
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            int size = SizeOfObject(this, fmt);

            SaveFileGTA3VC.WriteBlockHeader(buf, "SCR", size - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(Globals.Count * sizeof(int));
            buf.Write(Globals);
            buf.Align4();
            buf.Write(ScriptDataSize);
            buf.Write(OnAMissionFlag);
            buf.Write(LastMissionPassedTime);
            buf.Write(BuildingSwaps, NumBuildingSwaps);
            buf.Write(InvisibilitySettings, NumInvisibilitySettings);
            buf.Write(UsingAMultiScriptFile);
            buf.Write(PlayerHasMetDebbieHarry);
            buf.Write((short)0);
            buf.Write(MainScriptSize);
            buf.Write(LargestMissionScriptSize);
            buf.Write(NumberOfMissionScripts);
            buf.Write((short)0);
            buf.Write(Threads.Count);
            buf.Write(Threads, fmt);

            Debug.Assert(buf.Offset == size);
        }
Esempio n. 2
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "SCR");

            int varSpace = buf.ReadInt32();

            ScriptSpace = buf.ReadArray <byte>(varSpace);
            buf.Align4();
            int scriptDataSize = buf.ReadInt32();

            Debug.Assert(scriptDataSize == ScriptDataSize);
            OnAMissionFlag          = buf.ReadInt32();
            Contacts                = buf.ReadArray <Contact>(NumContacts);
            Collectives             = buf.ReadArray <Collective>(NumCollectives);
            NextFreeCollectiveIndex = buf.ReadInt32();
            BuildingSwaps           = buf.ReadArray <BuildingSwap>(NumBuildingSwaps);
            InvisibilitySettings    = buf.ReadArray <InvisibleObject>(NumInvisibilitySettings);
            UsingAMultiScriptFile   = buf.ReadBool();
            buf.ReadByte();
            buf.ReadUInt16();
            MainScriptSize           = buf.ReadInt32();
            LargestMissionScriptSize = buf.ReadInt32();
            NumberOfMissionScripts   = buf.ReadInt16();
            buf.ReadUInt16();
            int runningScripts = buf.ReadInt32();

            Threads = buf.ReadArray <RunningScript>(runningScripts, fmt);

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfObject(this, fmt) - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 3
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "SCR");

            int varSpace = buf.ReadInt32();

            Globals = buf.ReadArray <int>(varSpace / sizeof(int));
            buf.Align4();
            int scriptDataSize = buf.ReadInt32();

            Debug.Assert(scriptDataSize == ScriptDataSize);
            OnAMissionFlag          = buf.ReadInt32();
            LastMissionPassedTime   = buf.ReadUInt32();
            BuildingSwaps           = buf.ReadArray <BuildingSwap>(NumBuildingSwaps);
            InvisibilitySettings    = buf.ReadArray <InvisibleObject>(NumInvisibilitySettings);
            UsingAMultiScriptFile   = buf.ReadBool();
            PlayerHasMetDebbieHarry = buf.ReadBool();
            buf.ReadUInt16();
            MainScriptSize           = buf.ReadInt32();
            LargestMissionScriptSize = buf.ReadInt32();
            NumberOfMissionScripts   = buf.ReadInt16();
            buf.ReadUInt16();
            int runningScripts = buf.ReadInt32();

            Threads = buf.ReadArray <RunningScript>(runningScripts, fmt);

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfObject(this, fmt) - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 4
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            int size = SizeOfObject(this, fmt);

            SaveFileGTA3VC.WriteBlockHeader(buf, "SCR", size - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(ScriptSpace.Count);
            buf.Write(ScriptSpace);
            buf.Align4();
            buf.Write(ScriptDataSize);
            buf.Write(OnAMissionFlag);
            buf.Write(Contacts, NumContacts);
            buf.Write(Collectives, NumCollectives);
            buf.Write(NextFreeCollectiveIndex);
            buf.Write(BuildingSwaps, NumBuildingSwaps);
            buf.Write(InvisibilitySettings, NumInvisibilitySettings);
            buf.Write(UsingAMultiScriptFile);
            buf.Write((byte)0);
            buf.Write((short)0);
            buf.Write(MainScriptSize);
            buf.Write(LargestMissionScriptSize);
            buf.Write(NumberOfMissionScripts);
            buf.Write((short)0);
            buf.Write(Threads.Count);
            buf.Write(Threads, fmt);

            Debug.Assert(buf.Offset == size);
        }
Esempio n. 5
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "GNG", SizeOfType <GangData>() - SaveFileGTA3VC.BlockHeaderSize);
            buf.Write(Gangs, MaxNumGangs);

            Debug.Assert(buf.Offset == SizeOfType <GangData>());
        }
Esempio n. 6
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "RDR", SizeOfType <RadarData>() - SaveFileGTA3VC.BlockHeaderSize);
            buf.Write(RadarBlips, MaxNumRadarBlips);

            Debug.Assert(buf.Offset == SizeOfType <RadarData>());
        }
Esempio n. 7
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "PTP", SizeOfType <PedTypeData>() - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(PedTypes, NumPedTypes);

            Debug.Assert(buf.Offset == SizeOfType <PedTypeData>());
        }
Esempio n. 8
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "RDR");

            RadarBlips = buf.ReadArray <RadarBlip>(MaxNumRadarBlips);

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfType <RadarData>() - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 9
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "AUD", SizeOfObject(this) - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(AudioScriptObjects.Count);
            buf.Write(AudioScriptObjects);

            Debug.Assert(buf.Offset == SizeOfObject(this));
        }
Esempio n. 10
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "PTP");

            PedTypes = buf.ReadArray <PedType>(NumPedTypes);

            Debug.Assert(buf.Offset == SizeOfType <PedTypeData>());
            Debug.Assert(size == SizeOfType <PedTypeData>() - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 11
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "GNG");

            Gangs = buf.ReadArray <Gang>(MaxNumGangs);

            Debug.Assert(buf.Offset == SizeOfType <GangData>());
            Debug.Assert(size == SizeOfType <GangData>() - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 12
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "AUD");

            int count = buf.ReadInt32();

            AudioScriptObjects = buf.ReadArray <AudioScriptObject>(count);

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfObject(this) - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 13
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "CGN", SizeOfType <CarGeneratorData>() - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(CarGeneratorDataSize);
            buf.Write(NumberOfCarGenerators);
            buf.Write(NumberOfEnabledCarGenerators);
            buf.Write(ProcessCounter);
            buf.Write(GenerateEvenIfPlayerIsCloseCounter);
            buf.Write((short)0);
            buf.Write(CarGeneratorArraySize);
            buf.Write(CarGenerators, MaxNumCarGenerators);

            Debug.Assert(buf.Offset == SizeOfType <CarGeneratorData>());
        }
Esempio n. 14
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "RST", SizeOfType <RestartData>() - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(WastedRestartPoints, MaxNumWastedRestarts);
            buf.Write(BustedRestartPoints, MaxNumBustedRestarts);
            buf.Write(NumberOfWastedRestartPoints);
            buf.Write(NumberOfBustedRestartPoints);
            buf.Write(OverrideNextRestart);
            buf.Write(new byte[3]);
            buf.Write(OverrideRestartPoint);
            buf.Write(FadeInAfteNextDeath);
            buf.Write(FadeInAfteNextArrest);
            buf.Write((byte)OverrideHospitalLevel);
            buf.Write((byte)OverridePoliceStationLevel);

            Debug.Assert(buf.Offset == SizeOfType <RestartData>());
        }
Esempio n. 15
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "RST");

            WastedRestartPoints         = buf.ReadArray <RestartPoint>(MaxNumWastedRestarts);
            BustedRestartPoints         = buf.ReadArray <RestartPoint>(MaxNumBustedRestarts);
            NumberOfWastedRestartPoints = buf.ReadInt16();
            NumberOfBustedRestartPoints = buf.ReadInt16();
            OverrideNextRestart         = buf.ReadBool();
            buf.ReadBytes(3);
            OverrideRestartPoint       = buf.ReadObject <RestartPoint>();
            FadeInAfteNextDeath        = buf.ReadBool();
            FadeInAfteNextArrest       = buf.ReadBool();
            OverrideHospitalLevel      = (Level)buf.ReadByte();
            OverridePoliceStationLevel = (Level)buf.ReadByte();

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfType <RestartData>() - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 16
0
        protected override void WriteData(DataBuffer buf, FileFormat fmt)
        {
            SaveFileGTA3VC.WriteBlockHeader(buf, "ZNS", SizeOfType <ZoneData>() - SaveFileGTA3VC.BlockHeaderSize);

            buf.Write(CurrentZoneIndex);
            buf.Write((int)CurrentLevel);
            buf.Write(FindIndex);
            buf.Write((short)0);
            buf.Write(Zones, MaxNumZones);
            buf.Write(ZoneInfo, MaxNumZoneInfos);
            buf.Write(NumberOfZones);
            buf.Write(NumberOfZoneInfos);
            buf.Write(MapZones, MaxNumMapZones);
            buf.Write(AudioZones, MaxNumAudioZones);
            buf.Write(NumberOfMapZones);
            buf.Write(NumberOfAudioZones);

            Debug.Assert(buf.Offset == SizeOfType <ZoneData>());
        }
Esempio n. 17
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "CGN");

            int infoSize = buf.ReadInt32();

            Debug.Assert(infoSize == CarGeneratorDataSize);
            NumberOfCarGenerators        = buf.ReadInt32();
            NumberOfEnabledCarGenerators = buf.ReadInt32();
            ProcessCounter = buf.ReadByte();
            GenerateEvenIfPlayerIsCloseCounter = buf.ReadByte();
            buf.ReadInt16();
            int carGensSize = buf.ReadInt32();

            Debug.Assert(carGensSize == CarGeneratorArraySize);
            CarGenerators = buf.ReadArray <CarGenerator>(MaxNumCarGenerators);

            Debug.Assert(buf.Offset == SizeOfType <CarGeneratorData>());
            Debug.Assert(size == SizeOfType <CarGeneratorData>() - SaveFileGTA3VC.BlockHeaderSize);
        }
Esempio n. 18
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            int size = SaveFileGTA3VC.ReadBlockHeader(buf, "ZNS");

            CurrentZoneIndex = buf.ReadInt32();
            CurrentLevel     = (Level)buf.ReadInt32();
            FindIndex        = buf.ReadInt16();
            buf.ReadInt16();
            Zones              = buf.ReadArray <Zone>(MaxNumZones);
            ZoneInfo           = buf.ReadArray <ZoneInfo>(MaxNumZoneInfos);
            NumberOfZones      = buf.ReadInt16();
            NumberOfZoneInfos  = buf.ReadInt16();
            MapZones           = buf.ReadArray <Zone>(MaxNumMapZones);
            AudioZones         = buf.ReadArray <short>(MaxNumAudioZones);
            NumberOfMapZones   = buf.ReadInt16();
            NumberOfAudioZones = buf.ReadInt16();

            Debug.Assert(buf.Offset == size + SaveFileGTA3VC.BlockHeaderSize);
            Debug.Assert(size == SizeOfType <ZoneData>() - SaveFileGTA3VC.BlockHeaderSize);
        }