Beispiel #1
0
        public override void Parse(MetaFile meta, CLODLight CLODLight)
        {
            this.Meta          = meta;
            this.MetaStructure = CLODLight;

            var             _direction = MetaUtils.ConvertDataArray <VECTOR3>(meta, CLODLight.direction);
            List <MVECTOR3> direction  = _direction?.Select(e => { var msw = new MVECTOR3(); msw.Parse(meta, e); return(msw); }).ToList();

            float[] falloff           = MetaUtils.ConvertDataArray <float>(meta, CLODLight.falloff.Pointer, CLODLight.falloff.Count1).ToArray();
            float[] falloffExponent   = MetaUtils.ConvertDataArray <float>(meta, CLODLight.falloffExponent.Pointer, CLODLight.falloffExponent.Count1).ToArray();
            uint[]  timeAndStateFlags = MetaUtils.ConvertDataArray <uint>(meta, CLODLight.timeAndStateFlags.Pointer, CLODLight.timeAndStateFlags.Count1).ToArray();
            uint[]  hash                   = MetaUtils.ConvertDataArray <uint>(meta, CLODLight.hash.Pointer, CLODLight.hash.Count1).ToArray();
            byte[]  coneInnerAngle         = MetaUtils.ConvertDataArray <byte>(meta, CLODLight.coneInnerAngle.Pointer, CLODLight.coneInnerAngle.Count1).ToArray();
            byte[]  coneOuterAngleOrCapExt = MetaUtils.ConvertDataArray <byte>(meta, CLODLight.coneOuterAngleOrCapExt.Pointer, CLODLight.coneOuterAngleOrCapExt.Count1).ToArray();
            byte[]  coronaIntensity        = MetaUtils.ConvertDataArray <byte>(meta, CLODLight.coronaIntensity.Pointer, CLODLight.coronaIntensity.Count1).ToArray();

            Entries.Clear();

            for (int i = 0; i < hash.Length; i++)
            {
                Entries.Add(new LODLightEntry()
                {
                    Direction         = direction[i],
                    FallOff           = falloff[i],
                    FalloffExponent   = falloffExponent[i],
                    TimeAndStateFlags = timeAndStateFlags[i],
                    Hash                   = hash[i],
                    ConeInnerAngle         = coneInnerAngle[i],
                    ConeOuterAngleOrCapExt = coneOuterAngleOrCapExt[i],
                    CoronaIntensity        = coronaIntensity[i]
                });
            }
        }
Beispiel #2
0
        public override void Parse(MetaFile meta, CMloEntitySet CMloEntitySet)
        {
            this.Meta          = meta;
            this.MetaStructure = CMloEntitySet;

            this.Name      = CMloEntitySet.name;
            this.Locations = MetaUtils.ConvertDataArray <uint>(meta, CMloEntitySet.locations.Pointer, CMloEntitySet.locations.Count1)?.ToList();
            this.Entities  = MetaUtils.ConvertDataArray <CEntityDef>(this.Meta, CMloEntitySet.entities)?.Select(e => { var obj = new MCEntityDef(); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCEntityDef>();
        }
Beispiel #3
0
        public override void Parse(MetaFile meta, rage__phVerletClothCustomBounds rage__phVerletClothCustomBounds)
        {
            this.Meta          = meta;
            this.MetaStructure = rage__phVerletClothCustomBounds;

            this.Name = rage__phVerletClothCustomBounds.name;
            var CollisionData = MetaUtils.ConvertDataArray <Unk_1701774085>(meta, rage__phVerletClothCustomBounds.CollisionData);

            this.CollisionData = CollisionData?.Select(e => { var msw = new MUnk_1701774085(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #4
0
		public override void Parse(MetaFile meta, Unk_3538495220 Unk_3538495220)
		{
			this.Meta = meta;
			this.MetaStructure = Unk_3538495220;

			//this.Unk_3371516811 = Unk_3538495220.Unk_3371516811;
			var Unk_1756136273 = MetaUtils.ConvertDataArray<Unk_1535046754>(meta, Unk_3538495220.Unk_1756136273);
			this.Unk_1756136273 = Unk_1756136273?.Select(e => { var msw = new MUnk_1535046754(); msw.Parse(meta, e); return msw; }).ToList();

		}
Beispiel #5
0
        public override void Parse(MetaFile meta, CExtensionDefLightEffect CExtensionDefLightEffect)
        {
            this.Meta          = meta;
            this.MetaStructure = CExtensionDefLightEffect;

            this.Name           = CExtensionDefLightEffect.name;
            this.OffsetPosition = CExtensionDefLightEffect.offsetPosition;
            var instances = MetaUtils.ConvertDataArray <CLightAttrDef>(meta, CExtensionDefLightEffect.instances);

            this.Instances = instances?.Select(e => { var msw = new MCLightAttrDef(); msw.Parse(meta, e); return(msw); }).ToList();
        }
        public override void Parse(MetaFile meta, rage__fwInstancedMapData rage__fwInstancedMapData)
        {
            this.Meta          = meta;
            this.MetaStructure = rage__fwInstancedMapData;

            this.ImapLink = rage__fwInstancedMapData.ImapLink;
            // this.PropInstanceList = rage__fwInstancedMapData.PropInstanceList;
            var GrassInstanceList = MetaUtils.ConvertDataArray <rage__fwGrassInstanceListDef>(meta, rage__fwInstancedMapData.GrassInstanceList);

            this.GrassInstanceList = GrassInstanceList?.Select(e => { var msw = new Mrage__fwGrassInstanceListDef(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #7
0
        public override void Parse(MetaFile meta, CScenarioPointContainer CScenarioPointContainer)
        {
            this.Meta          = meta;
            this.MetaStructure = CScenarioPointContainer;

            var LoadSavePoints = MetaUtils.ConvertDataArray <CExtensionDefSpawnPoint>(meta, CScenarioPointContainer.LoadSavePoints);

            this.LoadSavePoints = LoadSavePoints?.Select(e => { var msw = new MCExtensionDefSpawnPoint(); msw.Parse(meta, e); return(msw); }).ToList();

            var MyPoints = MetaUtils.ConvertDataArray <CScenarioPoint>(meta, CScenarioPointContainer.MyPoints);

            this.MyPoints = MyPoints?.Select(e => { var msw = new MCScenarioPoint(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #8
0
        public override void Parse(MetaFile meta, CMloPortalDef CMloPortalDef)
        {
            this.Meta          = meta;
            this.MetaStructure = CMloPortalDef;

            this.RoomFrom        = CMloPortalDef.roomFrom;
            this.RoomTo          = CMloPortalDef.roomTo;
            this.Flags           = CMloPortalDef.flags;
            this.MirrorPriority  = CMloPortalDef.mirrorPriority;
            this.Opacity         = CMloPortalDef.opacity;
            this.AudioOcclusion  = CMloPortalDef.audioOcclusion;
            this.Corners         = MetaUtils.ConvertDataArray <Vector4>(meta, CMloPortalDef.corners.Pointer, CMloPortalDef.corners.Count1)?.Select(e => (Vector3)e).ToList();
            this.AttachedObjects = MetaUtils.ConvertDataArray <uint>(meta, CMloPortalDef.attachedObjects.Pointer, CMloPortalDef.attachedObjects.Count1)?.ToList();
        }
        public override void Parse(MetaFile meta, CScenarioEntityOverride CScenarioEntityOverride)
        {
            this.Meta          = meta;
            this.MetaStructure = CScenarioEntityOverride;

            this.EntityPosition = CScenarioEntityOverride.EntityPosition;
            this.EntityType     = CScenarioEntityOverride.EntityType;
            var ScenarioPoints = MetaUtils.ConvertDataArray <CExtensionDefSpawnPoint>(meta, CScenarioEntityOverride.ScenarioPoints);

            this.ScenarioPoints = ScenarioPoints?.Select(e => { var msw = new MCExtensionDefSpawnPoint(); msw.Parse(meta, e); return(msw); }).ToList();

            this.Unk_538733109  = CScenarioEntityOverride.Unk_538733109;
            this.Unk_1035513142 = CScenarioEntityOverride.Unk_1035513142;
        }
Beispiel #10
0
        public override void Parse(MetaFile meta, Unk_1535046754 Unk_1535046754)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_1535046754;

            this.PropMask       = Unk_1535046754.propMask;
            this.Unk_2806194106 = Unk_1535046754.Unk_2806194106;
            var aTexData = MetaUtils.ConvertDataArray <Unk_1036962405>(meta, Unk_1535046754.aTexData);

            this.ATexData = aTexData?.Select(e => { var msw = new MUnk_1036962405(); msw.Parse(meta, e); return(msw); }).ToList();

            this.ClothData = new MUnk_2236980467();
            this.ClothData.Parse(meta, Unk_1535046754.clothData);
        }
Beispiel #11
0
        public override void Parse(MetaFile meta, Unk_1980345114 Unk_1980345114)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_1980345114;

            this.AnimDict      = Unk_1980345114.AnimDict;
            this.AnimName      = Unk_1980345114.AnimName;
            this.AnimatedModel = Unk_1980345114.AnimatedModel;
            this.PunchInPhase  = Unk_1980345114.punchInPhase;
            this.PunchOutPhase = Unk_1980345114.punchOutPhase;
            var effectsData = MetaUtils.ConvertDataArray <Unk_3430328684>(meta, Unk_1980345114.effectsData);

            this.EffectsData = effectsData?.Select(e => { var msw = new MUnk_3430328684(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #12
0
        public override void Parse(MetaFile meta, CAnchorProps CAnchorProps)
        {
            this.Meta          = meta;
            this.MetaStructure = CAnchorProps;

            this.Anchor = CAnchorProps.anchor;
            var props       = MetaUtils.ConvertDataArray <byte>(meta, CAnchorProps.props.Pointer, CAnchorProps.props.Count1)?.ToList();
            var linkedProps = Parent.Unk_3902803273.Where(e => e.AnchorId == (byte)Anchor).ToList();

            for (int i = 0; i < linkedProps.Count; i++)
            {
                PropsMap[linkedProps[i]] = props[i];
            }
        }
Beispiel #13
0
        public override void Parse(MetaFile meta, CStreamingRequestRecord CStreamingRequestRecord)
        {
            this.Meta          = meta;
            this.MetaStructure = CStreamingRequestRecord;

            var Frames = MetaUtils.ConvertDataArray <CStreamingRequestFrame>(meta, CStreamingRequestRecord.Frames);

            this.Frames = Frames?.Select(e => { var msw = new MCStreamingRequestFrame(); msw.Parse(meta, e); return(msw); }).ToList();

            var CommonSets = MetaUtils.ConvertDataArray <Unk_1358189812>(meta, CStreamingRequestRecord.CommonSets);

            this.CommonSets = CommonSets?.Select(e => { var msw = new MUnk_1358189812(); msw.Parse(meta, e); return(msw); }).ToList();

            this.NewStyle = CStreamingRequestRecord.NewStyle;
        }
Beispiel #14
0
        public override void Parse(MetaFile meta, CMapData CMapData)
        {
            this.Meta          = meta;
            this.MetaStructure = CMapData;

            this.Name                = (MetaName)CMapData.name;
            this.Parent              = (MetaName)CMapData.parent;
            this.Flags               = CMapData.flags;
            this.ContentFlags        = CMapData.contentFlags;
            this.StreamingExtentsMin = CMapData.streamingExtentsMin;
            this.StreamingExtentsMax = CMapData.streamingExtentsMax;
            this.EntitiesExtentsMin  = CMapData.entitiesExtentsMin;
            this.EntitiesExtentsMax  = CMapData.entitiesExtentsMax;

            this.Entities = MetaUtils.GetTypedDataArray <CEntityDef>(this.Meta, MetaName.CEntityDef)?.Select(e => { var obj = new MCEntityDef(this); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCEntityDef>();

            this.MloInstances = MetaUtils.GetTypedDataArray <CMloInstanceDef>(this.Meta, MetaName.CMloInstanceDef)?.Select(e => { var obj = new MCMloInstanceDef(); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCMloInstanceDef>();

            this.ContainerLods = new Array_Structure();
            var boxOccluders = MetaUtils.ConvertDataArray <Unk_975711773>(meta, CMapData.boxOccluders);

            this.BoxOccluders = boxOccluders?.Select(e => { var msw = new MUnk_975711773(); msw.Parse(meta, e); return(msw); }).ToList();

            var occludeModels = MetaUtils.ConvertDataArray <Unk_2741784237>(meta, CMapData.occludeModels);

            this.OccludeModels = occludeModels?.Select(e => { var msw = new MUnk_2741784237(); msw.Parse(meta, e); return(msw); }).ToList();

            this.PhysicsDictionaries = CMapData.physicsDictionaries;
            this.InstancedData       = new Mrage__fwInstancedMapData();
            this.InstancedData.Parse(meta, CMapData.instancedData);


            var timeCycleModifiers = MetaUtils.ConvertDataArray <CTimeCycleModifier>(meta, CMapData.timeCycleModifiers);

            this.TimeCycleModifiers = timeCycleModifiers?.Select(e => { var msw = new MCTimeCycleModifier(); msw.Parse(meta, e); return(msw); }).ToList();


            var carGenerators = MetaUtils.ConvertDataArray <CCarGen>(meta, CMapData.carGenerators);

            this.CarGenerators = carGenerators?.Select(e => { var msw = new MCCarGen(); msw.Parse(meta, e); return(msw); }).ToList();

            this.LODLightsSOA = new MCLODLight();
            this.LODLightsSOA.Parse(meta, CMapData.LODLightsSOA);
            this.DistantLODLightsSOA = new MCDistantLODLight();
            this.DistantLODLightsSOA.Parse(meta, CMapData.DistantLODLightsSOA);
            this.Block = new MCBlockDesc();
            this.Block.Parse(meta, CMapData.block);
        }
Beispiel #15
0
        public override void Parse(MetaFile meta, CMloRoomDef CMloRoomDef)
        {
            this.Meta          = meta;
            this.MetaStructure = CMloRoomDef;

            this.Name                   = MetaUtils.GetString(Meta, CMloRoomDef.name);
            this.BbMin                  = CMloRoomDef.bbMin;
            this.BbMax                  = CMloRoomDef.bbMax;
            this.Blend                  = CMloRoomDef.blend;
            this.TimecycleName          = CMloRoomDef.timecycleName;
            this.SecondaryTimecycleName = CMloRoomDef.secondaryTimecycleName;
            this.Flags                  = CMloRoomDef.flags;
            this.PortalCount            = CMloRoomDef.portalCount;
            this.FloorId                = CMloRoomDef.floorId;
            this.ExteriorVisibiltyDepth = CMloRoomDef.exteriorVisibiltyDepth;
            this.AttachedObjects        = MetaUtils.ConvertDataArray <uint>(meta, CMloRoomDef.attachedObjects.Pointer, CMloRoomDef.attachedObjects.Count1)?.ToList();
        }
        public override void Parse(MetaFile meta, CCreatureMetaData CCreatureMetaData)
        {
            this.Meta          = meta;
            this.MetaStructure = CCreatureMetaData;

            var shaderVariableComponents = MetaUtils.ConvertDataArray <CShaderVariableComponent>(meta, CCreatureMetaData.shaderVariableComponents);

            this.ShaderVariableComponents = shaderVariableComponents?.Select(e => { var msw = new MCShaderVariableComponent(); msw.Parse(meta, e); return(msw); }).ToList();

            var pedPropExpressions = MetaUtils.ConvertDataArray <CPedPropExpressionData>(meta, CCreatureMetaData.pedPropExpressions);

            this.PedPropExpressions = pedPropExpressions?.Select(e => { var msw = new MCPedPropExpressionData(); msw.Parse(meta, e); return(msw); }).ToList();

            var pedCompExpressions = MetaUtils.ConvertDataArray <CPedCompExpressionData>(meta, CCreatureMetaData.pedCompExpressions);

            this.PedCompExpressions = pedCompExpressions?.Select(e => { var msw = new MCPedCompExpressionData(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #17
0
        public override void Parse(MetaFile meta, Unk_4023740759 Unk_4023740759)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_4023740759;

            var Nodes = MetaUtils.ConvertDataArray <CScenarioChainingNode>(meta, Unk_4023740759.Nodes);

            this.Nodes = Nodes?.Select(e => { var msw = new MCScenarioChainingNode(); msw.Parse(meta, e); return(msw); }).ToList();

            var Edges = MetaUtils.ConvertDataArray <CScenarioChainingEdge>(meta, Unk_4023740759.Edges);

            this.Edges = Edges?.Select(e => { var msw = new MCScenarioChainingEdge(); msw.Parse(meta, e); return(msw); }).ToList();

            var Chains = MetaUtils.ConvertDataArray <CScenarioChain>(meta, Unk_4023740759.Chains);

            this.Chains = Chains?.Select(e => { var msw = new MCScenarioChain(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #18
0
        public override void Parse(MetaFile meta, rage__fwGrassInstanceListDef rage__fwGrassInstanceListDef)
        {
            this.Meta          = meta;
            this.MetaStructure = rage__fwGrassInstanceListDef;

            this.BatchAABB = new Mrage__spdAABB();
            this.BatchAABB.Parse(meta, rage__fwGrassInstanceListDef.BatchAABB);
            this.ScaleRange       = rage__fwGrassInstanceListDef.ScaleRange;
            this.ArchetypeName    = rage__fwGrassInstanceListDef.archetypeName;
            this.LodDist          = rage__fwGrassInstanceListDef.lodDist;
            this.LodFadeStartDist = rage__fwGrassInstanceListDef.LodFadeStartDist;
            this.LodInstFadeRange = rage__fwGrassInstanceListDef.LodInstFadeRange;
            this.OrientToTerrain  = rage__fwGrassInstanceListDef.OrientToTerrain;
            var InstanceList = MetaUtils.ConvertDataArray <rage__fwGrassInstanceListDef__InstanceData>(meta, rage__fwGrassInstanceListDef.InstanceList);

            this.InstanceList = InstanceList?.Select(e => { var msw = new Mrage__fwGrassInstanceListDef__InstanceData(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #19
0
        public override void Parse(MetaFile meta, Unk_94549140 Unk_94549140)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_94549140;

            this.AudioId        = Unk_94549140.audioId;
            this.ExpressionMods = Unk_94549140.expressionMods;
            var texData = MetaUtils.ConvertDataArray <Unk_254518642>(meta, Unk_94549140.texData);

            this.TexData = texData?.Select(e => { var msw = new MUnk_254518642(); msw.Parse(meta, e); return(msw); }).ToList();

            this.RenderFlags = Unk_94549140.renderFlags;
            this.PropFlags   = Unk_94549140.propFlags;
            this.Flags       = Unk_94549140.flags;
            this.AnchorId    = Unk_94549140.anchorId;
            //this.PropId = Unk_94549140.propId;
            this.Unk_2894625425 = Unk_94549140.Unk_2894625425;
        }
Beispiel #20
0
        public override void Parse(MetaFile meta, CCompositeEntityType CCompositeEntityType)
        {
            this.Meta          = meta;
            this.MetaStructure = CCompositeEntityType;

            this.Name             = CCompositeEntityType.Name;
            this.LodDist          = CCompositeEntityType.lodDist;
            this.Flags            = CCompositeEntityType.flags;
            this.SpecialAttribute = CCompositeEntityType.specialAttribute;
            this.BbMin            = CCompositeEntityType.bbMin;
            this.BbMax            = CCompositeEntityType.bbMax;
            this.BsCentre         = CCompositeEntityType.bsCentre;
            this.BsRadius         = CCompositeEntityType.bsRadius;
            this.StartModel       = CCompositeEntityType.StartModel;
            this.EndModel         = CCompositeEntityType.EndModel;
            this.StartImapFile    = CCompositeEntityType.StartImapFile;
            this.EndImapFile      = CCompositeEntityType.EndImapFile;
            this.PtFxAssetName    = CCompositeEntityType.PtFxAssetName;
            var Animations = MetaUtils.ConvertDataArray <RageLib.Resources.GTA5.PC.Meta.Unk_1980345114>(meta, CCompositeEntityType.Animations);

            this.Animations = Animations?.Select(e => { var msw = new MUnk_1980345114(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #21
0
        public override void Parse(MetaFile meta, Unk_2858946626 Unk_2858946626)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_2858946626;

            // this.Unk_2598445407 = Unk_2858946626.Unk_2598445407;
            var Unk_3902803273 = MetaUtils.ConvertDataArray <Unk_94549140>(meta, Unk_2858946626.Unk_3902803273);

            var values = Enum.GetValues(typeof(Unk_2834549053));

            foreach (Unk_2834549053 value in values)
            {
                if (value != Unk_2834549053.NUM_ANCHORS)
                {
                    Props[value] = Unk_3902803273?.Where(e => e.anchorId == (byte)value).Select(e => { var msw = new MUnk_94549140(this); msw.Parse(meta, e); return(msw); }).ToList() ?? new List <MUnk_94549140>();
                }
            }

            var aAnchors = MetaUtils.ConvertDataArray <CAnchorProps>(meta, Unk_2858946626.aAnchors);

            this.AAnchors = (aAnchors?.Select(e => { var msw = new MCAnchorProps(this); msw.Parse(meta, e); return(msw); }).ToList()) ?? new List <MCAnchorProps>();
        }
Beispiel #22
0
        public override void Parse(MetaFile meta, CDistantLODLight CDistantLODLight)
        {
            this.Meta          = meta;
            this.MetaStructure = CDistantLODLight;

            var             _position = MetaUtils.ConvertDataArray <VECTOR3>(meta, CDistantLODLight.position);
            List <MVECTOR3> position  = _position?.Select(e => { var msw = new MVECTOR3(); msw.Parse(meta, e); return(msw); }).ToList();

            uint[] rgbi = MetaUtils.ConvertDataArray <uint>(meta, CDistantLODLight.RGBI.Pointer, CDistantLODLight.RGBI.Count1).ToArray();

            Entries.Clear();

            for (int i = 0; i < position.Count; i++)
            {
                Entries.Add(new DistantLODLightEntry()
                {
                    Position = position[i],
                    RGBI     = rgbi[i],
                });
            }

            this.NumStreetLights = CDistantLODLight.numStreetLights;
            this.Category        = CDistantLODLight.category;
        }
        public override void Parse(MetaFile meta, CScenarioPointRegion CScenarioPointRegion)
        {
            this.Meta          = meta;
            this.MetaStructure = CScenarioPointRegion;

            this.VersionNumber = CScenarioPointRegion.VersionNumber;
            this.Points        = new MCScenarioPointContainer();
            this.Points.Parse(meta, CScenarioPointRegion.Points);
            var EntityOverrides = MetaUtils.ConvertDataArray <CScenarioEntityOverride>(meta, CScenarioPointRegion.EntityOverrides);

            this.EntityOverrides = EntityOverrides?.Select(e => { var msw = new MCScenarioEntityOverride(); msw.Parse(meta, e); return(msw); }).ToList();

            this.Unk_3696045377 = new MUnk_4023740759();
            this.Unk_3696045377.Parse(meta, CScenarioPointRegion.Unk_3696045377);
            this.AccelGrid = new Mrage__spdGrid2D();
            this.AccelGrid.Parse(meta, CScenarioPointRegion.AccelGrid);
            // this.Unk_3844724227 = CScenarioPointRegion.Unk_3844724227;
            var Clusters = MetaUtils.ConvertDataArray <CScenarioPointCluster>(meta, CScenarioPointRegion.Clusters);

            this.Clusters = Clusters?.Select(e => { var msw = new MCScenarioPointCluster(); msw.Parse(meta, e); return(msw); }).ToList();

            this.LookUps = new MCScenarioPointLookUps();
            this.LookUps.Parse(meta, CScenarioPointRegion.LookUps);
        }
Beispiel #24
0
        public override void Parse(MetaFile meta, Unk_376833625 Unk_376833625)
        {
            this.Meta          = meta;
            this.MetaStructure = Unk_376833625;

            this.Unk_1235281004 = Unk_376833625.Unk_1235281004;
            this.Unk_4086467184 = Unk_376833625.Unk_4086467184;
            this.Unk_911147899  = Unk_376833625.Unk_911147899;
            this.Unk_315291935  = Unk_376833625.Unk_315291935;

            //this.Unk_2996560424 = Unk_376833625.Unk_2996560424;

            var Unk_3796409423 = MetaUtils.ConvertDataArray <Unk_3538495220>(meta, Unk_376833625.Unk_3796409423);

            int componentCount = 0;

            if (Unk_376833625.Unk_2996560424.b00 != 255)
            {
                Components[Unk_884254308.PV_COMP_HEAD] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_HEAD].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b01 != 255)
            {
                Components[Unk_884254308.PV_COMP_BERD] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_BERD].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b02 != 255)
            {
                Components[Unk_884254308.PV_COMP_HAIR] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_HAIR].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b03 != 255)
            {
                Components[Unk_884254308.PV_COMP_UPPR] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_UPPR].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b04 != 255)
            {
                Components[Unk_884254308.PV_COMP_LOWR] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_LOWR].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b05 != 255)
            {
                Components[Unk_884254308.PV_COMP_HAND] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_HAND].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b06 != 255)
            {
                Components[Unk_884254308.PV_COMP_FEET] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_FEET].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b07 != 255)
            {
                Components[Unk_884254308.PV_COMP_TEEF] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_TEEF].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b08 != 255)
            {
                Components[Unk_884254308.PV_COMP_ACCS] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_ACCS].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b09 != 255)
            {
                Components[Unk_884254308.PV_COMP_TASK] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_TASK].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b10 != 255)
            {
                Components[Unk_884254308.PV_COMP_DECL] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_DECL].Parse(meta, Unk_3796409423[componentCount++]);
            }

            if (Unk_376833625.Unk_2996560424.b11 != 255)
            {
                Components[Unk_884254308.PV_COMP_JBIB] = new MUnk_3538495220();
                Components[Unk_884254308.PV_COMP_JBIB].Parse(meta, Unk_3796409423[componentCount++]);
            }

            //this.Unk_3796409423 = Unk_3796409423?.Select(e => { var msw = new MUnk_3538495220(); msw.Parse(meta, e); return msw; }).ToList();

            var Unk_2131007641 = MetaUtils.ConvertDataArray <Unk_253191135>(meta, Unk_376833625.Unk_2131007641);

            this.Unk_2131007641 = Unk_2131007641?.Select(e => { var msw = new MUnk_253191135(); msw.Parse(meta, e); return(msw); }).ToList();

            var compInfos = MetaUtils.ConvertDataArray <CComponentInfo>(meta, Unk_376833625.compInfos);

            this.CompInfos = compInfos?.Select(e => { var msw = new MCComponentInfo(); msw.Parse(meta, e); return(msw); }).ToList();

            this.PropInfo = new MUnk_2858946626();
            this.PropInfo.Parse(meta, Unk_376833625.propInfo);
            this.DlcName = Unk_376833625.dlcName;
        }
Beispiel #25
0
        private static void WriteArrayNode(StringBuilder sb, int indent, PsoCont cont, int blockId, int offset, PsoStructureEntryInfo entry, PsoStructureInfo estruct, string ename)
        {
            var    block    = cont.Pso.GetBlock(blockId);
            var    boffset  = offset + block.Offset;
            var    eoffset  = boffset + entry.DataOffset;
            var    aOffset  = offset + entry.DataOffset;
            var    aBlockId = blockId;
            uint   aCount   = ((uint)entry.ReferenceKey >> 16) & 0x0000FFFF;
            var    aind     = indent + 1;
            string arrTag   = ename;
            PsoStructureEntryInfo arrEntry = estruct.GetEntry((int)(entry.ReferenceKey & 0xFFFF));

            if (arrEntry == null)
            {
                ErrorXml(sb, indent, "ARRAYINFO not found for " + ename + "!");
                return;
            }

            var data = cont.Pso.DataSection.Data;

            switch (entry.Unk_5h)
            {
            default:
                ErrorXml(sb, indent, ename + ": WIP! Unsupported Array subtype: " + entry.Unk_5h.ToString());
                break;

            case 0:     //Array_Structure
                var arrStruc = MetaUtils.ConvertData <Array_Structure>(data, eoffset);
                arrStruc.SwapEnd();
                aBlockId = (int)arrStruc.PointerDataId;
                aOffset  = (int)arrStruc.PointerDataOffset;
                aCount   = arrStruc.Count1;
                break;

            case 1:     //Raw in-line array
                break;

            case 2:     //also raw in-line array, but how different from above?
                break;

            case 4:                       //pointer array? default array?
                if (arrEntry.Unk_5h == 3) //pointers...
                {
                    var arrStruc4 = MetaUtils.ConvertData <Array_Structure>(data, eoffset);
                    arrStruc4.SwapEnd();
                    aBlockId = (int)arrStruc4.PointerDataId;
                    aOffset  = (int)arrStruc4.PointerDataOffset;
                    aCount   = arrStruc4.Count1;
                }
                break;

            case 129:     //also raw inline array? in junctions.pso
                break;
            }

            switch (arrEntry.Type)
            {
            default:
                ErrorXml(sb, indent, ename + ": WIP! Unsupported array entry DataType: " + arrEntry.Type.ToString());
                break;

            case RageLib.GTA5.PSO.DataType.Array:
                var rk0 = (entry.ReferenceKey >> 16) & 0x0000FFFF;
                if (rk0 > 0)
                {
                    //var arrStruc5 = MetaUtils.ConvertDataArray<Array_StructurePointer>(data, eoffset, (int)rk0);
                    //for (int n = 0; n < rk0; n++) arrStruc5[n].SwapEnd();
                    aOffset = offset + entry.DataOffset;

                    OpenTag(sb, indent, arrTag);
                    for (int n = 0; n < rk0; n++)     //ARRAY ARRAY!
                    {
                        WriteArrayNode(sb, aind, cont, blockId, aOffset, arrEntry, estruct, "Item");

                        aOffset += 16;    //ptr size... todo: what if not pointer array?
                    }
                    CloseTag(sb, indent, ename);
                }
                else
                {
                    SelfClosingTag(sb, indent, arrTag);
                }
                break;

            case RageLib.GTA5.PSO.DataType.Structure:
                switch (arrEntry.Unk_5h)
                {
                case 0:
                    break;

                case 3:        //structure pointer array
                    var arrStrucPtr = MetaUtils.ConvertData <Array_StructurePointer>(data, eoffset);
                    arrStrucPtr.SwapEnd();
                    aBlockId = (int)arrStrucPtr.PointerDataId;
                    aOffset  = (int)arrStrucPtr.PointerDataOffset;
                    aCount   = arrStrucPtr.Count1;
                    if (aCount > 0)
                    {
                        var ptrArr = PsoUtils.GetPointerArray(cont.Pso, arrStrucPtr);
                        OpenTag(sb, indent, arrTag);
                        for (int n = 0; n < aCount; n++)
                        {
                            var ptrVal = ptrArr[n];
                            WriteNode(sb, aind, cont, ptrVal.BlockID, (int)ptrVal.ItemOffset, XmlTagMode.ItemAndType);
                        }
                        CloseTag(sb, indent, ename);
                    }
                    break;

                default:
                    break;
                }
                arrTag += " itemType=\"" + HashString((MetaName)arrEntry.ReferenceKey) + "\"";
                if (aCount > 0)
                {
                    var aBlock = cont.Pso.GetBlock(aBlockId);
                    var atyp   = cont.GetStructureInfo((MetaName)arrEntry.ReferenceKey);
                    if (aBlock == null)
                    {
                        ErrorXml(sb, indent, ename + ": Array block not found: " + aBlockId.ToString());
                    }
                    else if ((MetaName)aBlock.NameHash != MetaName.PsoPOINTER)
                    {
                        OpenTag(sb, indent, arrTag);
                        if (atyp == null)
                        {
                            ErrorXml(sb, indent, ename + ": Array type not found: " + HashString((MetaName)arrEntry.ReferenceKey));
                        }
                        else
                        {
                            for (int n = 0; n < aCount; n++)
                            {
                                WriteNode(sb, aind, cont, aBlockId, aOffset, XmlTagMode.Item, (MetaName)arrEntry.ReferenceKey);
                                aOffset += atyp.StructureLength;
                                if ((n < (aCount - 1)) && (aBlock != null) && (aOffset >= aBlock.Length))
                                {
                                    break;
                                }
                            }
                        }
                        CloseTag(sb, indent, ename);
                    }
                    else
                    {
                    }       //pointer array should get here, but it's already handled above. should improve this.
                }
                else
                {
                    SelfClosingTag(sb, indent, arrTag);
                }
                break;

            case RageLib.GTA5.PSO.DataType.String:
                switch (entry.Unk_5h)
                {
                default:
                    ErrorXml(sb, indent, ename + ": Unexpected String array subtype: " + entry.Unk_5h.ToString());
                    break;

                case 0:         //hash array...
                    var arrHash = MetaUtils.ConvertData <Array_uint>(data, eoffset);
                    arrHash.SwapEnd();
                    var hashArr = PsoUtils.GetHashArray(cont.Pso, arrHash);
                    WriteItemArray(sb, hashArr, indent, ename, "Hash", HashString);
                    break;
                }
                break;

            case RageLib.GTA5.PSO.DataType.Float2:
                aCount  = ((uint)entry.ReferenceKey >> 16) & 0x0000FFFF;
                arrTag += " itemType=\"Vector2\"";
                var v2Arr = MetaUtils.ConvertDataArray <Vector2>(data, eoffset, (int)aCount);
                WriteRawArray(sb, v2Arr, indent, ename, "Vector2", FormatVector2Swap, 1);
                break;

            case RageLib.GTA5.PSO.DataType.Float3:
                aCount  = ((uint)entry.ReferenceKey >> 16) & 0x0000FFFF;
                arrTag += " itemType=\"Vector3\"";     //this is actually aligned as vector4, the W values are crazy in places
                var v4Arr = MetaUtils.ConvertDataArray <Vector4>(data, eoffset, (int)aCount);
                WriteRawArray(sb, v4Arr, indent, ename, "Vector3", FormatVector4SwapXYZOnly, 1);
                break;

            case RageLib.GTA5.PSO.DataType.UByte:
                var barr = new byte[aCount];
                if (aCount > 0)
                {
                    var bblock = cont.Pso.GetBlock(aBlockId);
                    var boffs  = bblock.Offset + aOffset;
                    Buffer.BlockCopy(data, boffs, barr, 0, (int)aCount);
                }
                WriteRawArray(sb, barr, indent, ename, "byte");
                break;

            case RageLib.GTA5.PSO.DataType.Bool:
                var barr2 = new byte[aCount];
                if (aCount > 0)
                {
                    var bblock = cont.Pso.GetBlock(aBlockId);
                    var boffs  = bblock.Offset + aOffset;
                    Buffer.BlockCopy(data, boffs, barr2, 0, (int)aCount);
                }
                WriteRawArray(sb, barr2, indent, ename, "boolean");     //todo: true/false output
                break;

            case RageLib.GTA5.PSO.DataType.Float:
                var arrFloat = MetaUtils.ConvertData <Array_float>(data, eoffset);
                arrFloat.SwapEnd();
                var floatArr = PsoUtils.GetFloatArray(cont.Pso, arrFloat);
                WriteRawArray(sb, floatArr, indent, ename, "float");
                break;

            case RageLib.GTA5.PSO.DataType.UShort:
                var arrShort = MetaUtils.ConvertData <Array_Structure>(data, eoffset);
                arrShort.SwapEnd();
                var shortArr = PsoUtils.GetUShortArray(cont.Pso, arrShort);
                WriteRawArray(sb, shortArr, indent, ename, "ushort");
                break;

            case RageLib.GTA5.PSO.DataType.UInt:
                var intArr = MetaUtils.ConvertDataArray <int>(data, eoffset, (int)aCount);
                WriteRawArray(sb, intArr, indent, ename, "int");
                break;

            case RageLib.GTA5.PSO.DataType.SInt:
                var arrUint2 = MetaUtils.ConvertData <Array_uint>(data, eoffset);
                arrUint2.SwapEnd();
                var intArr2 = PsoUtils.GetUintArray(cont.Pso, arrUint2);
                WriteRawArray(sb, intArr2, indent, ename, "int");
                break;

            case RageLib.GTA5.PSO.DataType.Enum:
                var arrEnum = MetaUtils.ConvertData <Array_uint>(data, eoffset);
                arrEnum.SwapEnd();
                var enumArr = PsoUtils.GetUintArray(cont.Pso, arrEnum);
                var enumDef = cont.GetEnumInfo((MetaName)arrEntry.ReferenceKey);
                WriteItemArray(sb, enumArr, indent, ename, "enum", (ie) => {
                    var eval = enumDef?.FindEntry((int)ie);
                    return(HashString((MetaName)(eval?.EntryNameHash ?? 0)));
                });
                break;
            }
        }
Beispiel #26
0
        public override void Parse(MetaFile meta, CMapTypes CMapTypes)
        {
            this.Meta          = meta;
            this.MetaStructure = CMapTypes;

            // this.Extensions = CMapTypes.extensions;

            // CBaseArchetypeDef + CMloArchetypeDef + CTimeArchetypeDef
            var archPtrs = MetaUtils.GetPointerArray(this.Meta, this.MetaStructure.archetypes);

            if (archPtrs != null)
            {
                for (int i = 0; i < archPtrs.Length; i++)
                {
                    var ptr   = archPtrs[i];
                    var block = Meta.GetBlock(ptr.BlockID);

                    if (block == null)
                    {
                        continue;
                    }

                    if ((ptr.Offset < 0) || (block.Data == null) || (ptr.Offset >= block.Data.Length))
                    {
                        continue;
                    }

                    byte[] data = Array.ConvertAll(block.Data.ToArray(), e => (byte)e);

                    switch ((MetaName)block.StructureNameHash)
                    {
                    case MetaName.CBaseArchetypeDef:
                    {
                        var struc = PsoUtils.ConvertDataRaw <RageLib.Resources.GTA5.PC.Meta.CBaseArchetypeDef>(data, ptr.Offset);
                        var arch  = new MCBaseArchetypeDef();
                        arch.Parse(meta, struc);
                        this.Archetypes.Add(arch);
                        break;
                    }

                    case MetaName.CMloArchetypeDef:
                    {
                        var struc = PsoUtils.ConvertDataRaw <RageLib.Resources.GTA5.PC.Meta.CMloArchetypeDef>(data, ptr.Offset);
                        var arch  = new MCMloArchetypeDef();
                        arch.Parse(meta, struc);
                        this.MloArchetypes.Add(arch);
                        break;
                    }

                    case MetaName.CTimeArchetypeDef:
                    {
                        var struc = PsoUtils.ConvertDataRaw <RageLib.Resources.GTA5.PC.Meta.CTimeArchetypeDef>(data, ptr.Offset);
                        var arch  = new MCTimeArchetypeDef();
                        arch.Parse(meta, struc);
                        this.TimeArchetypes.Add(arch);
                        break;
                    }

                    default: continue;
                    }
                }
            }

            this.Name = (MetaName)CMapTypes.name;
            // this.Dependencies = CMapTypes.dependencies;
            var compositeEntityTypes = MetaUtils.ConvertDataArray <CCompositeEntityType>(meta, CMapTypes.compositeEntityTypes);

            this.CompositeEntityTypes = compositeEntityTypes?.Select(e => { var msw = new MCCompositeEntityType(); msw.Parse(meta, e); return(msw); }).ToList();
        }
Beispiel #27
0
        private static void WriteArrayNode(StringBuilder sb, int indent, MetaCont cont, byte[] data, StructureEntryInfo arrEntry, string ename, int eoffset)
        {
            int    aCount = 0;
            var    aind   = indent + 1;
            string arrTag = ename;

            switch (arrEntry.DataType)
            {
            default:
                ErrorXml(sb, indent, ename + ": Unexpected array entry DataType: " + arrEntry.DataType.ToString());
                break;

            case StructureEntryDataType.Structure:
                var arrStruc = MetaUtils.ConvertData <Array_Structure>(data, eoffset);
                var aBlockId = (int)arrStruc.PointerDataId;
                var aOffset  = (int)arrStruc.PointerDataOffset;
                aCount  = arrStruc.Count1;
                arrTag += " itemType=\"" + HashString((MetaName)arrEntry.ReferenceKey) + "\"";
                if (aCount > 0)
                {
                    OpenTag(sb, indent, arrTag);
                    var atyp   = cont.GetStructureInfo((MetaName)arrEntry.ReferenceKey);
                    var aBlock = cont.Meta.GetBlock(aBlockId);
                    for (int n = 0; n < aCount; n++)
                    {
                        WriteNode(sb, aind, cont, aBlockId, aOffset, XmlTagMode.Item, (MetaName)arrEntry.ReferenceKey);
                        aOffset += atyp.StructureLength;

                        if ((n < (aCount - 1)) && (aBlock != null) && (aOffset >= aBlock.DataLength))
                        {
                            aOffset = 0;
                            aBlockId++;
                            aBlock = cont.Meta.GetBlock(aBlockId);
                        }
                    }
                    CloseTag(sb, indent, ename);
                }
                else
                {
                    SelfClosingTag(sb, indent, arrTag);
                }
                break;

            case StructureEntryDataType.StructurePointer:
                var arrStrucP = MetaUtils.ConvertData <Array_StructurePointer>(data, eoffset);
                var ptrArr    = MetaUtils.GetPointerArray(cont.Meta, arrStrucP);
                aCount = ptrArr?.Length ?? 0;
                if (aCount > 0)
                {
                    OpenTag(sb, indent, arrTag);
                    for (int n = 0; n < aCount; n++)
                    {
                        var ptr    = ptrArr[n];
                        var offset = ptr.Offset;
                        WriteNode(sb, aind, cont, ptr.BlockID, offset, XmlTagMode.ItemAndType);
                    }
                    CloseTag(sb, indent, ename);
                }
                else
                {
                    SelfClosingTag(sb, indent, arrTag);
                }
                break;

            case StructureEntryDataType.UnsignedInt:
                var arrUint = MetaUtils.ConvertData <Array_uint>(data, eoffset);
                var uintArr = MetaUtils.ConvertDataArray <uint>(cont.Meta, arrUint.Pointer, arrUint.Count1);;
                WriteRawArray(sb, uintArr, indent, ename, "uint");
                break;

            case StructureEntryDataType.UnsignedShort:
                var arrUshort = MetaUtils.ConvertData <Array_ushort>(data, eoffset);
                var ushortArr = MetaUtils.ConvertDataArray <ushort>(cont.Meta, arrUshort.Pointer, arrUshort.Count1);;
                WriteRawArray(sb, ushortArr, indent, ename, "ushort");
                break;

            case StructureEntryDataType.UnsignedByte:
                var arrUbyte = MetaUtils.ConvertData <Array_byte>(data, eoffset);
                var byteArr  = MetaUtils.ConvertDataArray <byte>(cont.Meta, arrUbyte.Pointer, arrUbyte.Count1);;
                WriteRawArray(sb, byteArr, indent, ename, "byte");
                break;

            case StructureEntryDataType.Float:
                var arrFloat = MetaUtils.ConvertData <Array_float>(data, eoffset);
                var floatArr = MetaUtils.ConvertDataArray <float>(cont.Meta, arrFloat.Pointer, arrFloat.Count1);;
                WriteRawArray(sb, floatArr, indent, ename, "float");
                break;

            case StructureEntryDataType.Float_XYZ:
                var arrV3 = MetaUtils.ConvertData <Array_Vector3>(data, eoffset);
                var v4Arr = MetaUtils.ConvertDataArray <Vector4>(cont.Meta, arrV3.Pointer, arrV3.Count1);
                WriteItemArray(sb, v4Arr, indent, ename, "Vector3/4", FormatVector4);
                break;

            case StructureEntryDataType.CharPointer:
                ErrorXml(sb, indent, "CharPointer ARRAY not supported here!");
                break;

            case StructureEntryDataType.DataBlockPointer:
                ErrorXml(sb, indent, "DataBlockPointer ARRAY not supported here!");
                break;

            case StructureEntryDataType.Hash:
                var arrHash  = MetaUtils.ConvertData <Array_uint>(data, eoffset);
                var uintArr2 = MetaUtils.ConvertDataArray <uint>(cont.Meta, arrHash.Pointer, arrHash.Count1);
                var hashArr  = Array.ConvertAll(uintArr2, e => (MetaName)e);
                WriteItemArray(sb, hashArr, indent, ename, "Hash", FormatHash);
                break;
            }
        }
Beispiel #28
0
        public override void Parse(MetaFile meta, CMloArchetypeDef CMloArchetypeDef)
        {
            this.Meta          = meta;
            this.MetaStructure = CMloArchetypeDef;

            this.LodDist            = CMloArchetypeDef.lodDist;
            this.Flags              = CMloArchetypeDef.flags;
            this.SpecialAttribute   = CMloArchetypeDef.specialAttribute;
            this.BbMin              = CMloArchetypeDef.bbMin;
            this.BbMax              = CMloArchetypeDef.bbMax;
            this.BsCentre           = CMloArchetypeDef.bsCentre;
            this.BsRadius           = CMloArchetypeDef.bsRadius;
            this.HdTextureDist      = CMloArchetypeDef.hdTextureDist;
            this.Name               = CMloArchetypeDef.name;
            this.TextureDictionary  = CMloArchetypeDef.textureDictionary;
            this.ClipDictionary     = CMloArchetypeDef.clipDictionary;
            this.DrawableDictionary = CMloArchetypeDef.drawableDictionary;
            this.PhysicsDictionary  = CMloArchetypeDef.physicsDictionary;
            this.AssetType          = CMloArchetypeDef.assetType;
            this.AssetName          = CMloArchetypeDef.assetName;

            // Extensions
            var extptrs = MetaUtils.GetPointerArray(meta, CMloArchetypeDef.extensions);

            if (extptrs != null)
            {
                for (int i = 0; i < extptrs.Length; i++)
                {
                    var extptr = extptrs[i];
                    var block  = meta.GetBlock(extptr.BlockID);

                    switch (block.StructureNameHash)
                    {
                    case MetaName.CExtensionDefAudioCollisionSettings:
                    {
                        var data = MetaUtils.GetData <CExtensionDefAudioCollisionSettings>(meta, extptr);
                        var obj  = new MCExtensionDefAudioCollisionSettings();
                        obj.Parse(meta, data);
                        ExtensionDefAudioCollisionSettings.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefAudioEmitter:
                    {
                        var data = MetaUtils.GetData <CExtensionDefAudioEmitter>(meta, extptr);
                        var obj  = new MCExtensionDefAudioEmitter();
                        obj.Parse(meta, data);
                        ExtensionDefAudioEmitters.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefBuoyancy:
                    {
                        var data = MetaUtils.GetData <CExtensionDefBuoyancy>(meta, extptr);
                        var obj  = new MCExtensionDefBuoyancy();
                        obj.Parse(meta, data);
                        ExtensionDefBuoyancies.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefExplosionEffect:
                    {
                        var data = MetaUtils.GetData <CExtensionDefExplosionEffect>(meta, extptr);
                        var obj  = new MCExtensionDefExplosionEffect();
                        obj.Parse(meta, data);
                        ExtensionDefExplosionEffects.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefExpression:
                    {
                        var data = MetaUtils.GetData <CExtensionDefExpression>(meta, extptr);
                        var obj  = new MCExtensionDefExpression();
                        obj.Parse(meta, data);
                        ExtensionDefExpressions.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefLadder:
                    {
                        var data = MetaUtils.GetData <CExtensionDefLadder>(meta, extptr);
                        var obj  = new MCExtensionDefLadder();
                        obj.Parse(meta, data);
                        ExtensionDefLadders.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefLightShaft:
                    {
                        var data = MetaUtils.GetData <CExtensionDefLightShaft>(meta, extptr);
                        var obj  = new MCExtensionDefLightShaft();
                        obj.Parse(meta, data);
                        ExtensionDefLightShafts.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefParticleEffect:
                    {
                        var data = MetaUtils.GetData <CExtensionDefParticleEffect>(meta, extptr);
                        var obj  = new MCExtensionDefParticleEffect();
                        obj.Parse(meta, data);
                        ExtensionDefParticleEffects.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefProcObject:
                    {
                        var data = MetaUtils.GetData <CExtensionDefProcObject>(meta, extptr);
                        var obj  = new MCExtensionDefProcObject();
                        obj.Parse(meta, data);
                        ExtensionDefProcObjects.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefSpawnPoint:
                    {
                        var data = MetaUtils.GetData <CExtensionDefSpawnPoint>(meta, extptr);
                        var obj  = new MCExtensionDefSpawnPoint();
                        obj.Parse(meta, data);
                        ExtensionDefSpawnPoints.Add(obj);
                        break;
                    }

                    case MetaName.CExtensionDefWindDisturbance:
                    {
                        var data = MetaUtils.GetData <CExtensionDefWindDisturbance>(meta, extptr);
                        var obj  = new MCExtensionDefWindDisturbance();
                        obj.Parse(meta, data);
                        ExtensionDefWindDisturbances.Add(obj);
                        break;
                    }

                    default: break;
                    }
                }
            }

            this.MloFlags = CMloArchetypeDef.mloFlags;

            this.Entities = MetaUtils.ConvertDataArray <CEntityDef>(this.Meta, CMloArchetypeDef.entities)?.Select(e => { var obj = new MCEntityDef(); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCEntityDef>();

            var rooms = MetaUtils.ConvertDataArray <CMloRoomDef>(meta, CMloArchetypeDef.rooms);

            this.Rooms = rooms?.Select(e => { var msw = new MCMloRoomDef(this); msw.Parse(meta, e); return(msw); }).ToList();

            var portals = MetaUtils.ConvertDataArray <CMloPortalDef>(meta, CMloArchetypeDef.portals);

            this.Portals = portals?.Select(e => { var msw = new MCMloPortalDef(); msw.Parse(meta, e); return(msw); }).ToList();

            var entitySets = MetaUtils.ConvertDataArray <CMloEntitySet>(meta, CMloArchetypeDef.entitySets);

            this.EntitySets = entitySets?.Select(e => { var msw = new MCMloEntitySet(); msw.Parse(meta, e); return(msw); }).ToList();

            var timeCycleModifiers = MetaUtils.ConvertDataArray <CMloTimeCycleModifier>(meta, CMloArchetypeDef.timeCycleModifiers);

            this.TimeCycleModifiers = timeCycleModifiers?.Select(e => { var msw = new MCMloTimeCycleModifier(); msw.Parse(meta, e); return(msw); }).ToList();
        }