Example #1
0
        public void Load( BinaryFormatter formatter )
        {
            ZoneOfControl = formatter.ReadInt32();
            Name = formatter.ReadString( ( int ) BIQUnitSizes.Name );
            Civlopedia = formatter.ReadString( ( int ) BIQUnitSizes.Civlopedia );
            BombardStrength = formatter.ReadInt32();
            BombardRange = formatter.ReadInt32();
            Capacity = formatter.ReadInt32();
            Cost = formatter.ReadInt32();
            Defence = formatter.ReadInt32();
            IconIndex = formatter.ReadInt32();
            Attack = formatter.ReadInt32();
            OperationalRange = formatter.ReadInt32();
            PopulationCost = formatter.ReadInt32();
            RateOfFire = formatter.ReadInt32();
            Movement = formatter.ReadInt32();
            Tech = formatter.ReadInt32();
            UpgradeTo = formatter.ReadInt32();
            Resource1 = formatter.ReadInt32();
            Resource2 = formatter.ReadInt32();
            Resource3 = formatter.ReadInt32();
            UnitAbilities = formatter.ReadInt32();
            AIStrategy = formatter.ReadInt32();
            AvailableTo = formatter.ReadInt32();
            StandardOrdersSpecialActions = formatter.ReadInt32();
            AirMissions = formatter.ReadInt32();
            UnitClass = formatter.ReadInt32();
            OtherStrategy = formatter.ReadInt32();
            HitPointBonus = formatter.ReadInt32();
            PTWStandardOrders = formatter.ReadInt32();
            PTWSpecialActions = formatter.ReadInt32();
            PTWWorkerActions = formatter.ReadInt32();
            PTWAirMissions = formatter.ReadInt32();

            PTWActionsMix = formatter.ReadShort16();
            Unknown1 = formatter.ReadShort16();
            BombardEffects = formatter.ReadInt32();
            IgnoreMovementCost = new List<byte>();
            for ( int i = 0; i < 14; i++ )
                IgnoreMovementCost.Add ( formatter.ReadByte() );
            RequireSupport = formatter.ReadInt32();
            UseExactCost = formatter.ReadInt32();
            TelepadRange = formatter.ReadInt32();
            Unknown4 = formatter.ReadInt32();
            NumLegalUnitTelepads = formatter.ReadInt32();

            LegalUnitTelepads = new List<int>();
            for ( int i = 0; i < NumLegalUnitTelepads; i++ )
                LegalUnitTelepads.Add( formatter.ReadInt32() );

            EnslaveResults = formatter.ReadInt32();
            Unknown6 = formatter.ReadInt32();
            NumberOfStealthTargets = formatter.ReadInt32();

            StealthTargets = new List<int>();
            for ( int i = 0; i < NumberOfStealthTargets; i++ )
                StealthTargets.Add ( formatter.ReadInt32() );

            Unknown7 = formatter.ReadInt32();
            NumLegalBuildingTelepads = formatter.ReadInt32();
            LegalBuildingTelepads = new List<int>();
            for ( int i = 0; i < NumLegalBuildingTelepads; i++ )
                LegalBuildingTelepads.Add( formatter.ReadInt32() );

            CreateCraters = formatter.ReadByte();
            WorkerStrength1 = formatter.ReadInt32();

            int temp = formatter.ReadInt32();
            if ( temp == 1 )
            {
                WorkerStrength2 = temp;
                WorkerStrength3 = formatter.ReadInt32();

                temp = formatter.ReadInt32();
            }

            Unknown9 = temp;
            AitDefense = formatter.ReadInt32();
        }
Example #2
0
        public void Load( BinaryFormatter formatter )
        {
            RiverConnectionInfo = formatter.ReadByte();
            Border = formatter.ReadByte();
            Resource = formatter.ReadInt32();
            Image = formatter.ReadByte();
            File = formatter.ReadByte();
            Unknown1 = formatter.ReadShort16();
            Overlays = formatter.ReadByte();
            BaseRealTerrain = formatter.ReadByte();
            Bonuses = formatter.ReadByte();
            RiverCrossingData = formatter.ReadByte();
            BarbarianTribe = formatter.ReadShort16();
            City = formatter.ReadShort16();
            Colony = formatter.ReadShort16();
            Continent = formatter.ReadShort16();
            Unknown2 = formatter.ReadByte();
            VictoryPointLocation = formatter.ReadShort16();
            Ruin = formatter.ReadInt32();

            // Conquests
            C3COverlays = formatter.ReadInt32();
            Unknown3 = formatter.ReadByte();
            C3CBaseRealTerrain = formatter.ReadByte();
            Unknown4 = formatter.ReadShort16();
            FogOfWar = formatter.ReadShort16();
            C3CBonuses = formatter.ReadInt32();
            Unknown5 = formatter.ReadShort16();
        }
Example #3
0
        long FlcDeltaFlc(BinaryFormatter formatter, int frame)
        {
            long pos, read;
            short lines, l, b, colour;
            byte skip;
            sbyte change;

            lines = formatter.ReadShort16();

            read = 6 + sizeof(short);

            l = 0;
            while (lines > 0) {
                pos = l * FlcHeader.width;

                b = formatter.ReadShort16();
                read += 2;
                if ((b & 0xC000) == 0x0000) {
                    b &= 0x3FFF;
                    for (int j = 0; j < b; j++) {
                        skip = formatter.ReadByte();
                        pos += skip;
                        read += 1;

                        change = formatter.ReadSByte();
                        read += 1;
                        if (change > 0) {
                            for (int i = 0; i < change; i++) {
                                colour = formatter.ReadShort16();
                                read += 2;
                                mBufferFrames[frame][pos++] = (byte)(colour & 0x00FF);
                                mBufferFrames[frame][pos++] = (byte)((colour >> 8) & 0x00FF);
                            }
                        }
                        else {
                            change = (sbyte)-change;
                            colour = formatter.ReadShort16();
                            read += 2;

                            for (int i = 0; i < change; i++) {
                                mBufferFrames[frame][pos++] = (byte)(colour & 0x00FF);
                                mBufferFrames[frame][pos++] = (byte)((colour >> 8) & 0x00FF);
                            }
                        }
                    }
                    lines--;
                    l++;

                }
                else {
                    if ((b & 0xC000) == 0xC000)
                        l -= b;
                    else
                        mBufferFrames[frame][pos++] = (byte)(b & 0x00FF);

                }
            }

            if ((read % 4) == 1) {
                formatter.ReadBytes(2);
                read++;
            }

            return read;
        }
Example #4
0
            public short width; /* FLIC width in pixels */

            #endregion Fields

            #region Methods

            //BYTE												reserved3[40]; /* Set to zero */
            public void ReadData(BinaryFormatter mFormatter)
            {
                this.size = mFormatter.ReadInt32();
                this.type = mFormatter.ReadShort16();
                this.frames = mFormatter.ReadShort16();
                this.width = mFormatter.ReadShort16();
                this.height = mFormatter.ReadShort16();
                this.depth = mFormatter.ReadShort16();
                this.flags = mFormatter.ReadShort16();
                this.speed = mFormatter.ReadInt32();
                this.reserved1 = mFormatter.ReadShort16();
                this.created = mFormatter.ReadInt32();
                this.creator = mFormatter.ReadInt32();
                this.updated = mFormatter.ReadInt32();
                this.updater = mFormatter.ReadInt32();
                this.aspect_dx = mFormatter.ReadShort16();
                this.aspect_dy = mFormatter.ReadShort16();
                this.reserved2 = mFormatter.ReadChars(38);
                this.oframe1 = mFormatter.ReadInt32();
                this.oframe2 = mFormatter.ReadInt32();
            }
Example #5
0
        void FlcColour256(BinaryFormatter formatter, int frame)
        {
            short packets, idx;
            byte skip, change;

            packets = formatter.ReadShort16();

            idx = 0;
            for (int i = 0; i < packets; i++) {

                skip = formatter.ReadByte();
                idx += skip;

                change = formatter.ReadByte();

                if (change == 0) {

                    for (idx = 0; idx < 256; idx++) {
                        mColourMap[frame][idx].red = formatter.ReadByte();
                        mColourMap[frame][idx].green = formatter.ReadByte();
                        mColourMap[frame][idx].blue = formatter.ReadByte();
                    }

                }
                else {
                    for (int j = 0; j < change; j++) {
                        mColourMap[frame][idx].red = formatter.ReadByte();
                        mColourMap[frame][idx].green = formatter.ReadByte();
                        mColourMap[frame][idx].blue = formatter.ReadByte();
                        idx++;

                    }
                }

            }
        }