Esempio n. 1
0
        public BYTVField?XRGD;                    // Ragdoll Data (optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "NAME": NAME = new FMIDField <Record>(r, dataSize); return(true);

            case "DATA": DATA = new REFRRecord.DATAField(r, dataSize); return(true);

            case "XOWN": if (XOWNs == null)
                {
                    XOWNs = new List <CELLRecord.XOWNGroup>();
                }
                XOWNs.Add(new CELLRecord.XOWNGroup {
                    XOWN = new FMIDField <Record>(r, dataSize)
                }); return(true);

            case "XRNK": XOWNs.Last().XRNK = r.ReadT <IN32Field>(dataSize); return(true);

            case "XGLB": XOWNs.Last().XGLB = new FMIDField <Record>(r, dataSize); return(true);

            case "XESP": XESP = new REFRRecord.XESPField(r, dataSize); return(true);

            case "XSCL": XSCL = r.ReadT <FLTVField>(dataSize); return(true);

            case "XRGD": XRGD = r.ReadBYTV(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 2
0
 internal static Bitmap LoadRawBitmap(Stream inputStream)
 {
     using (var r = new BinaryFileReader(inputStream))
     {
         var header       = r.ReadT <BitmapHeader>(0x10);
         var frameCount   = header.FrameCount;
         var frameOffsets = r.ReadTArray <BitmapFrameOffset>(frameCount * 0x08, frameCount);
         var frames       = new Texture2DInfo[frameCount];
         for (var i = 0; i < frameCount; i++)
         {
             r.Position = frameOffsets[i].Offset;
             var frame         = r.ReadT <BitmapFrame>(0x14);
             var frameHeight   = (int)frame.height;
             var sizeOfFrame   = 0x14 + frameHeight * 0x04;
             var frameDataSize = (int)(frameHeight * frame.width);
             var bitsPerPixel  = (int)((frameOffsets[i].Size - sizeOfFrame) / frameDataSize);
             var offsets       = r.ReadTArray <uint>(frameHeight * 0x04, frameHeight); // Offset to the data for each row relative to the start of the resource.
             if (offsets[0] == 0xCDCDCDCD)                                             //: unknownFrame
             {
                 continue;
             }
             r.Position = frameOffsets[i].Offset + offsets[0];
             var rawData = r.ReadBytes(frameDataSize * bitsPerPixel);
             frames[i] = bitsPerPixel == 1
                 ? new Texture2DInfo((int)frame.width, (int)frame.height, UnityEngine.TextureFormat.RGBA32, false, rawData).From8BitPallet(GetGlobal8BitPallet(), UnityEngine.TextureFormat.RGBA32)
                 : new Texture2DInfo((int)frame.width, (int)frame.height, UnityEngine.TextureFormat.RGBA32, false, rawData).FromABGR555();
         }
         return(new Bitmap
         {
             Header = header,
             Frames = frames,
         });
     }
 }
Esempio n. 3
0
 public DATAField(BinaryFileReader r, int dataSize, GameFormat format)
 {
     if (format == GameFormat.TES3)
     {
         Weight          = r.ReadSingle();
         Value           = r.ReadInt32();
         Time            = r.ReadInt32();
         Radius          = r.ReadInt32();
         LightColor      = r.ReadT <ColorRef4>(4);
         Flags           = r.ReadInt32();
         FalloffExponent = 1;
         FOV             = 90;
         return;
     }
     Time       = r.ReadInt32();
     Radius     = r.ReadInt32();
     LightColor = r.ReadT <ColorRef4>(4);
     Flags      = r.ReadInt32();
     if (dataSize == 32)
     {
         FalloffExponent = r.ReadSingle();
         FOV             = r.ReadSingle();
     }
     else
     {
         FalloffExponent = 1;
         FOV             = 90;
     }
     Value  = r.ReadInt32();
     Weight = r.ReadSingle();
 }
Esempio n. 4
0
        public List <RNAMField> RNAMs = new List <RNAMField>(); // Large References

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "WNAM": WNAM = new FMIDField <WRLDRecord>(r, dataSize); return(true);

            case "CNAM": CNAM = new FMIDField <CLMTRecord>(r, dataSize); return(true);

            case "NAM2": NAM2 = new FMIDField <WATRRecord>(r, dataSize); return(true);

            case "ICON": ICON = r.ReadFILE(dataSize); return(true);

            case "MNAM": MNAM = r.ReadT <MNAMField>(dataSize); return(true);

            case "DATA": DATA = r.ReadT <BYTEField>(dataSize); return(true);

            case "NAM0": NAM0 = new NAM0Field(r, dataSize); return(true);

            case "NAM9": NAM0.NAM9Field(r, dataSize); return(true);

            case "SNAM": SNAM = r.ReadT <UI32Field>(dataSize); return(true);

            case "OFST": r.Skip(dataSize); return(true);

            // TES5
            case "RNAM": RNAMs.Add(new RNAMField(r, dataSize)); return(true);

            default: return(false);
            }
        }
        public BYTEField SLCP;              // Soul gem maximum capacity

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            case "DATA": DATA = new DATAField(r, dataSize); return(true);

            case "ICON": ICON = r.ReadFILE(dataSize); return(true);

            case "SOUL": SOUL = r.ReadT <BYTEField>(dataSize); return(true);

            case "SLCP": SLCP = r.ReadT <BYTEField>(dataSize); return(true);

            default: return(false);
            }
        }
 public DATAField(BinaryFileReader r, int dataSize)
 {
     if (dataSize != 102 && dataSize != 86 && dataSize != 62 && dataSize != 42 && dataSize != 2)
     {
         WindVelocity = 1;
     }
     if (dataSize == 2)
     {
         Damage = r.ReadUInt16();
         return;
     }
     WindVelocity          = r.ReadSingle();
     WindDirection         = r.ReadSingle();
     WaveAmplitude         = r.ReadSingle();
     WaveFrequency         = r.ReadSingle();
     SunPower              = r.ReadSingle();
     ReflectivityAmount    = r.ReadSingle();
     FresnelAmount         = r.ReadSingle();
     ScrollXSpeed          = r.ReadSingle();
     ScrollYSpeed          = r.ReadSingle();
     FogDistance_NearPlane = r.ReadSingle();
     if (dataSize == 42)
     {
         Damage = r.ReadUInt16();
         return;
     }
     FogDistance_FarPlane = r.ReadSingle();
     ShallowColor         = r.ReadT <ColorRef4>(dataSize);
     DeepColor            = r.ReadT <ColorRef4>(dataSize);
     ReflectionColor      = r.ReadT <ColorRef4>(dataSize);
     TextureBlend         = r.ReadByte();
     r.Skip(3); // Unused
     if (dataSize == 62)
     {
         Damage = r.ReadUInt16();
         return;
     }
     RainSimulator_Force         = r.ReadSingle();
     RainSimulator_Velocity      = r.ReadSingle();
     RainSimulator_Falloff       = r.ReadSingle();
     RainSimulator_Dampner       = r.ReadSingle();
     RainSimulator_StartingSize  = r.ReadSingle();
     DisplacementSimulator_Force = r.ReadSingle();
     if (dataSize == 86)
     {
         //DisplacementSimulator_Velocity = DisplacementSimulator_Falloff = DisplacementSimulator_Dampner = DisplacementSimulator_StartingSize = 0F;
         Damage = r.ReadUInt16();
         return;
     }
     DisplacementSimulator_Velocity     = r.ReadSingle();
     DisplacementSimulator_Falloff      = r.ReadSingle();
     DisplacementSimulator_Dampner      = r.ReadSingle();
     DisplacementSimulator_StartingSize = r.ReadSingle();
     Damage = r.ReadUInt16();
 }
Esempio n. 7
0
        public FLTVField?FLTV;  // Float data

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "FNAM": FNAM = r.ReadT <BYTEField>(dataSize); return(true);

            case "FLTV": FLTV = r.ReadT <FLTVField>(dataSize); return(true);

            default: return(false);
            }
        }
        public List <LVLIRecord.LVLOField> LVLOs = new List <LVLIRecord.LVLOField>(); // Number of items in list

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "LVLD": LVLD = r.ReadT <BYTEField>(dataSize); return(true);

            case "LVLF": LVLF = r.ReadT <BYTEField>(dataSize); return(true);

            case "LVLO": LVLOs.Add(new LVLIRecord.LVLOField(r, dataSize)); return(true);

            default: return(false);
            }
        }
Esempio n. 9
0
        public GNAMField GNAM; // GNAM

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
                case "EDID": EDID = r.ReadSTRV(dataSize); return true;
                case "TNAM": TNAM = r.ReadSTRV(dataSize); return true;
                case "ANAM": ANAM = r.ReadT<BYTEField>(dataSize); return true;
                case "FNAM": FNAM = r.ReadT<BYTEField>(dataSize); return true;
                case "MNAM": MNAM = r.ReadSTRV(dataSize); return true;
                case "SNAM": SNAM = new FMIDField<SOUNRecord>(r, dataSize); return true;
                case "DATA": DATA = new DATAField(r, dataSize); return true;
                case "GNAM": GNAM = new GNAMField(r, dataSize); return true;
                default: return false;
            }
        }
Esempio n. 10
0
        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            if (format == GameFormat.TES3)
            {
                switch (type)
                {
                case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

                case "FNAM": FNAM = r.ReadSTRV(dataSize); return(true);

                case "RNAM": RNAMs.Add(new RNAMGroup {
                        MNAM = r.ReadSTRV(dataSize)
                    }); return(true);

                case "FADT": FADT = new FADTField(r, dataSize); return(true);

                case "ANAM": ANAMs.Add(r.ReadSTRV(dataSize)); return(true);

                case "INTV": INTVs.Add(r.ReadINTV(dataSize)); return(true);

                default: return(false);
                }
            }
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL": FNAM = r.ReadSTRV(dataSize); return(true);

            case "XNAM": XNAM = new XNAMField(r, dataSize, format); return(true);

            case "DATA": DATA = r.ReadINTV(dataSize); return(true);

            case "CNAM": CNAM = r.ReadT <UI32Field>(dataSize); return(true);

            case "RNAM": RNAMs.Add(new RNAMGroup {
                    RNAM = r.ReadT <IN32Field>(dataSize)
                }); return(true);

            case "MNAM": RNAMs.Last().MNAM = r.ReadSTRV(dataSize); return(true);

            case "FNAM": RNAMs.Last().FNAM = r.ReadSTRV(dataSize); return(true);

            case "INAM": RNAMs.Last().INAM = r.ReadSTRV(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 11
0
        public STRVField MNAM; // Master Text

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "INDX": INDX = r.ReadT <IN32Field>(dataSize); return(true);

            case "DATA":
            case "SKDT": DATA = new DATAField(r, dataSize, format); return(true);

            case "DESC": DESC = r.ReadSTRV(dataSize); return(true);

            case "ICON": ICON = r.ReadFILE(dataSize); return(true);

            case "ANAM": ANAM = r.ReadSTRV(dataSize); return(true);

            case "JNAM": JNAM = r.ReadSTRV(dataSize); return(true);

            case "ENAM": ENAM = r.ReadSTRV(dataSize); return(true);

            case "MNAM": MNAM = r.ReadSTRV(dataSize); return(true);

            default: return(false);
            }
        }
        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "CTDA":
            case "CTDT": CTDAs.Add(new SCPTRecord.CTDAField(r, dataSize, format)); return(true);

            case "ANAM": ANAM = r.ReadT <BYTEField>(dataSize); return(true);

            case "DATA":
                DATAs = new FMIDField <IDLERecord> [dataSize >> 2];
                for (var i = 0; i < DATAs.Length; i++)
                {
                    DATAs[i] = new FMIDField <IDLERecord>(r, 4);
                }
                return(true);

            default: return(false);
            }
        }
        public BYTVField?XRGD;              // Ragdoll Data (optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "NAME": NAME = new FMIDField <Record>(r, dataSize); return(true);

            case "DATA": DATA = new REFRRecord.DATAField(r, dataSize); return(true);

            case "XPCI": XPCI = new FMIDField <CELLRecord>(r, dataSize); return(true);

            case "FULL": XPCI.Value.AddName(r.ReadASCIIString(dataSize)); return(true);

            case "XLOD": XLOD = r.ReadBYTV(dataSize); return(true);

            case "XESP": XESP = new REFRRecord.XESPField(r, dataSize); return(true);

            case "XMRC": XMRC = new FMIDField <REFRRecord>(r, dataSize); return(true);

            case "XHRS": XHRS = new FMIDField <ACRERecord>(r, dataSize); return(true);

            case "XSCL": XSCL = r.ReadT <FLTVField>(dataSize); return(true);

            case "XRGD": XRGD = r.ReadBYTV(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 14
0
        public DATAField DATA;              // Ammo Data

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "ICON": ICON = r.ReadFILE(dataSize); return(true);

            case "ENAM": ENAM = new FMIDField <ENCHRecord>(r, dataSize); return(true);

            case "ANAM": ANAM = r.ReadT <IN16Field>(dataSize); return(true);

            case "DATA": DATA = new DATAField(r, dataSize); return(true);

            default: return(false);
            }
        }
        public FMIDField <SCPTRecord>?SCRI;                     // Unknown

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL":
            case "FNAM": FULL = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "RNAM": RNAM = r.ReadSTRV(dataSize); return(true);

            case "ANAM": ANAM = r.ReadSTRV(dataSize); return(true);

            case "BNAM": BNAM = r.ReadSTRV(dataSize); return(true);

            case "CNAM": CNAM = r.ReadSTRV(dataSize); return(true);

            case "KNAM": KNAM = r.ReadSTRV(dataSize); return(true);

            case "NPDT": NPDT = new NPDTField(r, dataSize); return(true);

            case "FLAG": FLAG = r.ReadINTV(dataSize); return(true);

            case "NPCO": NPCOs.Add(new CNTOField(r, dataSize, format)); return(true);

            case "NPCS": NPCSs.Add(r.ReadSTRV(dataSize, ASCIIFormat.ZeroPadded)); return(true);

            case "AIDT": AIDT = new CREARecord.AIDTField(r, dataSize); return(true);

            case "AI_W": AI_W = new CREARecord.AI_WField(r, dataSize); return(true);

            case "AI_T": AI_T = new CREARecord.AI_TField(r, dataSize); return(true);

            case "AI_F": AI_F = new CREARecord.AI_FField(r, dataSize); return(true);

            case "AI_E": AI_E = new CREARecord.AI_FField(r, dataSize); return(true);

            case "CNDT": CNDT = r.ReadSTRV(dataSize); return(true);

            case "AI_A": AI_A = new CREARecord.AI_AField(r, dataSize); return(true);

            case "DODT": DODT = new DODTField(r, dataSize); return(true);

            case "DNAM": DNAM = r.ReadSTRV(dataSize); return(true);

            case "XSCL": XSCL = r.ReadT <FLTVField>(dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 16
0
        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            if (format == GameFormat.TES3)
            {
                switch (type)
                {
                case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

                case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

                case "FNAM": FNAM = r.ReadSTRV(dataSize); return(true);

                case "NPDT": NPDT = new NPDTField(r, dataSize); return(true);

                case "FLAG": FLAG = r.ReadT <IN32Field>(dataSize); return(true);

                case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

                case "NPCO": NPCO = new CNTOField(r, dataSize, format); return(true);

                case "AIDT": AIDT = new AIDTField(r, dataSize); return(true);

                case "AI_W": AI_W = new AI_WField(r, dataSize); return(true);

                case "AI_T": AI_T = new AI_TField(r, dataSize); return(true);

                case "AI_F": AI_F = new AI_FField(r, dataSize); return(true);

                case "AI_E": AI_E = new AI_FField(r, dataSize); return(true);

                case "AI_A": AI_A = new AI_AField(r, dataSize); return(true);

                case "XSCL": XSCL = r.ReadT <FLTVField>(dataSize); return(true);

                case "CNAM": CNAM = r.ReadSTRV(dataSize); return(true);

                case "NPCS": NPCSs.Add(r.ReadSTRV(dataSize, ASCIIFormat.ZeroPadded)); return(true);

                default: return(false);
                }
            }
            return(false);
        }
Esempio n. 17
0
        public CREFField CNAME; // RGB color

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "CNAME": CNAME = r.ReadT <CREFField>(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 18
0
        public UNKNField?TNAM;         // overrides (Optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "HEDR": HEDR = r.ReadT <HEDRField>(dataSize); return(true);

            case "OFST": r.Skip(dataSize); return(true);

            case "DELE": r.Skip(dataSize); return(true);

            case "CNAM": CNAM = r.ReadSTRV(dataSize); return(true);

            case "SNAM": SNAM = r.ReadSTRV(dataSize); return(true);

            case "MAST": if (MASTs == null)
                {
                    MASTs = new List <STRVField>();
                }
                MASTs.Add(r.ReadSTRV(dataSize)); return(true);

            case "DATA": if (DATAs == null)
                {
                    DATAs = new List <INTVField>();
                }
                DATAs.Add(r.ReadINTV(dataSize)); return(true);

            case "ONAM": ONAM = r.ReadUNKN(dataSize); return(true);

            case "INTV": INTV = r.ReadT <IN32Field>(dataSize); return(true);

            case "INCC": INCC = r.ReadT <IN32Field>(dataSize); return(true);

            // TES5
            case "TNAM": TNAM = r.ReadUNKN(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 19
0
        public static void ReadNonfixed(BinaryFileReader r, Header header, RecordGroup group)
        {
            var world = int.Parse(header.Label);

            // header
            r.Skip(4 * 5);
            var width  = r.ReadUInt32();
            var height = r.ReadUInt32();

            r.Skip(4);
            var indexSize = (int)(width * height);
            var indices   = r.ReadTArray <uint>(indexSize * 4, indexSize);

            r.Skip(4);
            // pages
            var page     = r.ReadT <Page>(28); r.Skip(4 * 7);
            var entities = new Entity[page.EntityCount];

            for (var i = 0; i < entities.Length; i++)
            {
                entities[i] = r.ReadT <Entity>(64);
            }
        }
Esempio n. 20
0
        public List <IN16Field> INTVs = new List <IN16Field>(); // PC level for previous INAM
        // The CNAM/INTV can occur many times in pairs

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            if (format == GameFormat.TES3)
            {
                switch (type)
                {
                case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

                case "DATA": DATA = r.ReadT <IN32Field>(dataSize); return(true);

                case "NNAM": NNAM = r.ReadT <BYTEField>(dataSize); return(true);

                case "INDX": INDX = r.ReadT <IN32Field>(dataSize); return(true);

                case "INAM": INAMs.Add(r.ReadSTRV(dataSize)); return(true);

                case "INTV": INTVs.Add(r.ReadT <IN16Field>(dataSize)); return(true);

                default: return(false);
                }
            }
            return(false);
        }
Esempio n. 21
0
        public BYTEField DATA; // Playable

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "ICON": ICON = r.ReadFILE(dataSize); return(true);

            case "DATA": DATA = r.ReadT <BYTEField>(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 22
0
        public Vector3Int GridId; // => new Vector3Int(INTV.CellX, INTV.CellY, 0);

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "DATA": DATA = r.ReadT <IN32Field>(dataSize); return(true);

            case "VNML": VNML = new VNMLField(r, dataSize); return(true);

            case "VHGT": VHGT = new VHGTField(r, dataSize); return(true);

            case "VCLR": VCLR = new VNMLField(r, dataSize); return(true);

            case "VTEX": VTEX = new VTEXField(r, dataSize, format); return(true);

            // TES3
            case "INTV": INTV = r.ReadT <CORDField>(dataSize); return(true);

            case "WNAM": WNAM = new WNAMField(r, dataSize); return(true);

            // TES4
            case "BTXT": var btxt = r.ReadT <BTXTField>(dataSize); BTXTs[btxt.Quadrant] = btxt; return(true);

            case "ATXT":
                if (ATXTs == null)
                {
                    ATXTs = new ATXTGroup[4];
                }
                var atxt = r.ReadT <BTXTField>(dataSize); _lastATXT = ATXTs[atxt.Quadrant] = new ATXTGroup {
                    ATXT = atxt
                }; return(true);

            case "VTXT": _lastATXT.VTXTs = r.ReadTArray <VTXTField>(dataSize, dataSize >> 3); return(true);

            default: return(false);
            }
        }
        public STRVField?CNAM; // Creature name (optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            if (format == GameFormat.TES3)
            {
                switch (type)
                {
                case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

                case "DATA": DATA = r.ReadT <IN32Field>(dataSize); return(true);

                case "SNAM": SNAM = r.ReadSTRV(dataSize); return(true);

                case "CNAM": CNAM = r.ReadSTRV(dataSize); return(true);

                default: return(false);
                }
            }
            return(false);
        }
Esempio n. 24
0
            public ColorRef4       VertexShading; // RGB + Shading radius (0 - 200) %

            public RDOTField(BinaryFileReader r, int dataSize)
            {
                Object    = new FormId <Record>(r.ReadUInt32());
                ParentIdx = r.ReadUInt16();
                r.Skip(2); // Unused
                Density         = r.ReadSingle();
                Clustering      = r.ReadByte();
                MinSlope        = r.ReadByte();
                MaxSlope        = r.ReadByte();
                Flags           = r.ReadByte();
                RadiusWrtParent = r.ReadUInt16();
                Radius          = r.ReadUInt16();
                MinHeight       = r.ReadSingle();
                MaxHeight       = r.ReadSingle();
                Sink            = r.ReadSingle();
                SinkVariance    = r.ReadSingle();
                SizeVariance    = r.ReadSingle();
                AngleVariance   = new Vector3Int(r.ReadUInt16(), r.ReadUInt16(), r.ReadUInt16());
                r.Skip(2); // Unused
                VertexShading = r.ReadT <ColorRef4>(dataSize);
            }
        public List <INFORecord> INFOs = new List <INFORecord>(); // Info Records

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); LastRecord = this; return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "DATA": DATA = r.ReadT <BYTEField>(dataSize); return(true);

            case "QSTI":
            case "QSTR": if (QSTIs == null)
                {
                    QSTIs = new List <FMIDField <QUSTRecord> >();
                }
                QSTIs.Add(new FMIDField <QUSTRecord>(r, dataSize)); return(true);

            default: return(false);
            }
        }
Esempio n. 26
0
        public IN32Field MNAM;              // Active marker flags, required. A bit field with a bit value of 1 indicating that the matching marker position in the NIF file is active.

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID": EDID = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            case "MNAM": MNAM = r.ReadT <IN32Field>(dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 27
0
        public List <FMIDField <GRASRecord> > GNAMs = new List <FMIDField <GRASRecord> >(); // Potential grass

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "INTV": INTV = r.ReadINTV(dataSize); return(true);

            case "ICON":
            case "DATA": ICON = r.ReadFILE(dataSize); return(true);

            // TES4
            case "HNAM": HNAM = new HNAMField(r, dataSize); return(true);

            case "SNAM": SNAM = r.ReadT <BYTEField>(dataSize); return(true);

            case "GNAM": GNAMs.Add(new FMIDField <GRASRecord>(r, dataSize)); return(true);

            default: return(false);
            }
        }
Esempio n. 28
0
        public FMIDField <SOUNRecord> SNAM; // Sound FormId (optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "FNAM": if (format != GameFormat.TES3)
                {
                    FNAM = r.ReadT <FLTVField>(dataSize);
                }
                else
                {
                    FULL = r.ReadSTRV(dataSize);
                } return(true);

            case "DATA":
            case "LHDT": DATA = new DATAField(r, dataSize, format); return(true);

            case "SCPT": SCPT = r.ReadSTRV(dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            case "ICON":
            case "ITEX": ICON = r.ReadFILE(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "SNAM": SNAM = new FMIDField <SOUNRecord>(r, dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 29
0
        public FMIDField <Record> TNAM;     // Random teleport destination

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "FULL": FULL = r.ReadSTRV(dataSize); return(true);

            case "FNAM": if (format != GameFormat.TES3)
                {
                    FNAM = r.ReadT <BYTEField>(dataSize);
                }
                else
                {
                    FULL = r.ReadSTRV(dataSize);
                } return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            case "SNAM": SNAM = new FMIDField <SOUNRecord>(r, dataSize); return(true);

            case "ANAM": ANAM = new FMIDField <SOUNRecord>(r, dataSize); return(true);

            case "BNAM": ANAM = new FMIDField <SOUNRecord>(r, dataSize); return(true);

            case "TNAM": TNAM = new FMIDField <Record>(r, dataSize); return(true);

            default: return(false);
            }
        }
Esempio n. 30
0
        public IN16Field?ANAM;                                            // Enchantment points (optional)

        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            switch (type)
            {
            case "EDID":
            case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

            case "MODL": MODL = new MODLGroup(r, dataSize); return(true);

            case "MODB": MODL.MODBField(r, dataSize); return(true);

            case "MODT": MODL.MODTField(r, dataSize); return(true);

            case "FULL":
            case "FNAM": FULL = r.ReadSTRV(dataSize); return(true);

            case "DATA":
            case "CTDT": DATA = new DATAField(r, dataSize, format); return(true);

            case "ICON":
            case "ITEX": ICON = r.ReadFILE(dataSize); return(true);

            case "INDX": INDXs.Add(new INDXFieldGroup {
                    INDX = r.ReadINTV(dataSize)
                }); return(true);

            case "BNAM": INDXs.Last().BNAM = r.ReadSTRV(dataSize); return(true);

            case "CNAM": INDXs.Last().CNAM = r.ReadSTRV(dataSize); return(true);

            case "ENAM": ENAM = r.ReadSTRV(dataSize); return(true);

            case "SCRI": SCRI = new FMIDField <SCPTRecord>(r, dataSize); return(true);

            case "BMDT": BMDT = r.ReadT <UI32Field>(dataSize); return(true);

            case "MOD2": MOD2 = new MODLGroup(r, dataSize); return(true);

            case "MO2B": MOD2.MODBField(r, dataSize); return(true);

            case "MO2T": MOD2.MODTField(r, dataSize); return(true);

            case "MOD3": MOD3 = new MODLGroup(r, dataSize); return(true);

            case "MO3B": MOD3.MODBField(r, dataSize); return(true);

            case "MO3T": MOD3.MODTField(r, dataSize); return(true);

            case "MOD4": MOD4 = new MODLGroup(r, dataSize); return(true);

            case "MO4B": MOD4.MODBField(r, dataSize); return(true);

            case "MO4T": MOD4.MODTField(r, dataSize); return(true);

            case "ICO2": ICO2 = r.ReadFILE(dataSize); return(true);

            case "ANAM": ANAM = r.ReadT <IN16Field>(dataSize); return(true);

            default: return(false);
            }
        }