Beispiel #1
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "NAME":
                        NAME = new FormID();
                        NAME.Deserialize(stream, name);
                        break;

                    case "XLOC":
                        XLOC = new REFR_XLOCSubRecord();
                        XLOC.Deserialize(stream, name);
                        break;

                    case "XOWN":
                        XOWN = new FormID();
                        XOWN.Deserialize(stream, name);
                        break;

                    case "XLKR":
                        XLKR = new FormID();
                        XLKR.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new PosAndRotSubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "XSCL":
                        XSCL = new FloatSubRecord();
                        XSCL.Deserialize(stream, name);
                        break;

                    case "XTEL":
                        XTEL = new REFR_XTELSubRecord();
                        XTEL.Deserialize(stream, name);
                        break;

                    case "XNDP":
                        XNDP = new REFR_XNDPSubRecord();
                        XNDP.Deserialize(stream, name);
                        break;

                    case "XLTW":
                        XLTW = new FormID();
                        XLTW.Deserialize(stream, name);
                        break;

                    case "XRDS":
                        XRDS = new FloatSubRecord();
                        XRDS.Deserialize(stream, name);
                        break;

                    case "XEMI":
                        XEMI = new FormID();
                        XEMI.Deserialize(stream, name);
                        break;

                    case "XPWR":
                        var xpwr = new REFR_XPWRSubRecord();
                        xpwr.Deserialize(stream, name);
                        XPWR.Add(xpwr);
                        break;

                    case "XPRD":
                        XPRD = new FloatSubRecord();
                        XPRD.Deserialize(stream, name);
                        break;

                    case "XPPA":
                        var xppaSize = stream.ReadUInt16();
                        var xppaData = stream.ReadBytes(Convert.ToInt32(xppaSize));
                        XPPA = true;
                        if (xppaData.Length > 0)
                        {
                            break;
                        }
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "SCHR":
                        SCHR = new SCHRSubRecord();
                        SCHR.Deserialize(stream, name);
                        break;

                    case "TNAM":
                        TNAM = new BytesSubRecord();
                        TNAM.Deserialize(stream, name);
                        break;

                    case "XMBO":
                        XMBO = new REFR_XMBOSubRecord();
                        XMBO.Deserialize(stream, name);
                        break;

                    case "XPRM":
                        XPRM = new REFR_XPRMSubRecord();
                        XPRM.Deserialize(stream, name);
                        break;

                    case "XRMR":
                        XRMR = new REFR_XRMRSubRecord();
                        XRMR.Deserialize(stream, name);
                        break;

                    case "XLRM":
                        XLRM = new FormID();
                        XLRM.Deserialize(stream, name);
                        break;

                    case "XACT":
                        XACT = new REFR_XACTSubRecord();
                        XACT.Deserialize(stream, name);
                        break;

                    case "ONAM":
                        var onamSize = stream.ReadUInt16();
                        var onamData = stream.ReadBytes(Convert.ToInt32(onamSize));
                        ONAM = true;
                        if (onamData.Length > 0)
                        {
                            break;
                        }
                        break;

                    case "XRGD":
                        XRGD = new BytesSubRecord();
                        XRGD.Deserialize(stream, name);
                        break;

                    case "XHLP":
                        XHLP = new FloatSubRecord();
                        XHLP.Deserialize(stream, name);
                        break;

                    case "XSED":
                        XSED = new ByteSubRecord();
                        XSED.Deserialize(stream, name);
                        break;

                    case "XPOD":
                        XPOD = new REFR_XPODSubRecord();
                        XPOD.Deserialize(stream, name);
                        break;

                    case "XRDO":
                        XRDO = new REFR_XRDOSubRecord();
                        XRDO.Deserialize(stream, name);
                        break;

                    case "XAPD":
                        XAPD = new ByteSubRecord();
                        XAPD.Deserialize(stream, name);
                        break;

                    case "XAPR":
                        var xapr = new REFR_XAPRSubRecord();
                        xapr.Deserialize(stream, name);
                        XAPR.Add(xapr);

                        if (XAPR.Count > 1)
                        {
                            break;
                        }
                        break;

                    case "XESP":
                        XESP = new REFR_XESPSubRecord();
                        XESP.Deserialize(stream, name);
                        break;

                    case "XLCM":
                        XLCM = new UInt32SubRecord();
                        XLCM.Deserialize(stream, name);
                        break;

                    case "XCNT":
                        XCNT = new UInt32SubRecord();
                        XCNT.Deserialize(stream, name);
                        break;

                    case "XTRI":
                        XTRI = new REFR_XTRISubRecord();
                        XTRI.Deserialize(stream, name);
                        break;

                    case "XOCP":
                        XOCP = new BytesSubRecord();
                        XOCP.Deserialize(stream, name);
                        break;

                    case "XAMT":
                        XAMT = new FormID();
                        XAMT.Deserialize(stream, name);
                        break;

                    case "XAMC":
                        XAMC = new UInt32SubRecord();
                        XAMC.Deserialize(stream, name);
                        break;

                    case "XRAD":
                        XRAD = new FloatSubRecord();
                        XRAD.Deserialize(stream, name);
                        break;

                    case "XIBS":
                        var xibsSize = stream.ReadUInt16();
                        var xibsData = stream.ReadBytes(xibsSize);
                        XIBS = true;
                        break;

                    case "XTRG":
                        XTRG = new FormID();
                        XTRG.Deserialize(stream, name);
                        break;

                    case "XORD":
                        XORD = new BytesSubRecord();
                        XORD.Deserialize(stream, name);
                        break;

                    case "XMBP":
                        var xmbpSize = stream.ReadUInt16();
                        var xmbpData = stream.ReadBytes(xmbpSize);
                        XMBP = true;
                        break;

                    case "XMBR":
                        XMBR = new FormID();
                        XMBR.Deserialize(stream, name);
                        break;

                    case "XCLP":
                        XCLP = new BytesSubRecord();
                        XCLP.Deserialize(stream, name);
                        break;

                    case "XMRK":
                        var xmrkSize = stream.ReadUInt16();
                        var xmrkData = stream.ReadBytes(xmrkSize);
                        XMRK = true;
                        break;

                    case "FNAM":
                        FNAM = new REFR_FNAMSubRecord();
                        FNAM.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "SCDA":
                        SCDA = new BytesSubRecord();
                        SCDA.Deserialize(stream, name);
                        break;

                    case "SCRO":
                        SCRO = new BytesSubRecord();
                        SCRO.Deserialize(stream, name);
                        break;

                    case "XLOD":
                        XLOD = new BytesSubRecord();
                        XLOD.Deserialize(stream, name);
                        break;

                    case "RCLR":
                        RCLR = new BytesSubRecord();
                        RCLR.Deserialize(stream, name);
                        break;

                    case "XRGB":
                        XRGB = new BytesSubRecord();
                        XRGB.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Beispiel #2
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new CELL_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "XCLL":
                        XCLL = new BytesSubRecord();
                        XCLL.Deserialize(stream, name);
                        break;

                    case "XCMT":
                        XCMT = new ByteSubRecord();
                        XCMT.Deserialize(stream, name);
                        break;

                    case "XGLB":
                        XGLB = new UInt32SubRecord();
                        XGLB.Deserialize(stream, name);
                        break;

                    case "XRNK":
                        XRNK = new UInt32SubRecord();
                        XRNK.Deserialize(stream, name);
                        break;

                    case "XCLW":
                        XCLW = new FloatSubRecord();
                        XCLW.Deserialize(stream, name);
                        break;

                    case "XCLC":
                        XCLC = new Vector2iSubRecord();
                        XCLC.Deserialize(stream, name);
                        break;


                    case "XCLR":
                        XCLR = new FormID();
                        XCLR.Deserialize(stream, name);
                        break;

                    case "XCIM":
                        XCIM = new FormID();
                        XCIM.Deserialize(stream, name);
                        break;

                    case "XEZN":
                        XEZN = new FormID();
                        XEZN.Deserialize(stream, name);
                        break;

                    case "XCCM":
                        XCCM = new FormID();
                        XCCM.Deserialize(stream, name);
                        break;

                    case "XCWT":
                        XCWT = new FormID();
                        XCWT.Deserialize(stream, name);
                        break;

                    case "XOWN":
                        XOWN = new FormID();
                        XOWN.Deserialize(stream, name);
                        break;

                    case "XCAS":
                        XCAS = new FormID();
                        XCAS.Deserialize(stream, name);
                        break;

                    case "XCMO":
                        XCMO = new FormID();
                        XCMO.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }
Beispiel #3
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "WNAM":
                        WNAM = new FormID();
                        WNAM.Deserialize(stream, name);
                        break;

                    case "CNAM":
                        CNAM = new FormID();
                        CNAM.Deserialize(stream, name);
                        break;

                    case "NAM2":
                        NAM2 = new FormID();
                        NAM2.Deserialize(stream, name);
                        break;

                    case "NAM3":
                        NAM3 = new FormID();
                        NAM3.Deserialize(stream, name);
                        break;

                    case "NAM4":
                        NAM4 = new FloatSubRecord();
                        NAM4.Deserialize(stream, name);
                        break;

                    case "DNAM":
                        DNAM = new WRLD_DNAMSubRecord();
                        DNAM.Deserialize(stream, name);
                        break;

                    case "ICON":
                        ICON = new STRSubRecord();
                        ICON.Deserialize(stream, name);
                        break;

                    case "MNAM":
                        MNAM = new WRLD_MNAMSubRecord();
                        MNAM.Deserialize(stream, name);
                        break;

                    case "ONAM":
                        ONAM = new WRLD_ONAMSubRecord();
                        ONAM.Deserialize(stream, name);
                        break;

                    case "INAM":
                        INAM = new FormID();
                        INAM.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new WRLD_DATASubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "NAM0":
                        NAM0 = new Vector2fSubRecord();
                        NAM0.Deserialize(stream, name);
                        break;

                    case "NAM9":
                        NAM9 = new Vector2fSubRecord();
                        NAM9.Deserialize(stream, name);
                        break;

                    case "NNAM":
                        NNAM = new STRSubRecord();
                        NNAM.Deserialize(stream, name);
                        break;

                    case "XNAM":
                        XNAM = new STRSubRecord();
                        XNAM.Deserialize(stream, name);
                        break;

                    case "XXXX":
                        //var xxxxSize = stream.ReadUInt16();
                        //var xxxxData = stream.ReadBytes(xxxxSize);
                        //var xxxxDataStr = System.Text.Encoding.ASCII.GetString(xxxxData);
                        XXXX = new UInt32SubRecord();
                        XXXX.Deserialize(stream, name);
                        break;

                    case "OFST":
                        var ofstSize = Convert.ToInt32(stream.ReadUInt16());
                        if (ofstSize == 0)
                        {
                            ofstSize = Convert.ToInt32(XXXX.Value);
                        }
                        var ofstData = stream.ReadBytes(ofstSize);
                        break;

                    case "XEZN":
                        XEZN = new FormID();
                        XEZN.Deserialize(stream, name);
                        break;

                    case "PNAM":
                        PNAM = new WRLD_PNAMSubRecord();
                        PNAM.Deserialize(stream, name);
                        break;

                    case "ZNAM":
                        ZNAM = new FormID();
                        ZNAM.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }