public override void Parse(MetaFile meta, CMloInstanceDef CMloInstanceDef)
        {
            this.Meta          = meta;
            this.MetaStructure = CMloInstanceDef;

            this.ArchetypeName = CMloInstanceDef.archetypeName;
            this.Flags         = CMloInstanceDef.flags;
            this.Guid          = CMloInstanceDef.guid;
            this.Position      = CMloInstanceDef.position;
            this.Rotation      = CMloInstanceDef.rotation;
            this.ScaleXY       = CMloInstanceDef.scaleXY;
            this.ScaleZ        = CMloInstanceDef.scaleZ;
            this.ParentIndex   = CMloInstanceDef.parentIndex;
            this.LodDist       = CMloInstanceDef.lodDist;
            this.ChildLodDist  = CMloInstanceDef.childLodDist;
            this.LodLevel      = CMloInstanceDef.lodLevel;
            this.NumChildren   = CMloInstanceDef.numChildren;
            this.PriorityLevel = CMloInstanceDef.priorityLevel;
            this.Extensions    = new Array_StructurePointer();
            this.AmbientOcclusionMultiplier = CMloInstanceDef.ambientOcclusionMultiplier;
            this.ArtificialAmbientOcclusion = CMloInstanceDef.artificialAmbientOcclusion;
            this.TintValue         = CMloInstanceDef.tintValue;
            this.GroupId           = CMloInstanceDef.groupId;
            this.FloorId           = CMloInstanceDef.floorId;
            this.DefaultEntitySets = CMloInstanceDef.defaultEntitySets;
            this.NumExitPortals    = CMloInstanceDef.numExitPortals;
            this.MLOInstflags      = CMloInstanceDef.MLOInstflags;
        }
Beispiel #2
0
 public static uint[] GetUintArray(PsoFile pso, Array_uint arr)
 {
     uint[] uints = GetUintArrayRaw(pso, arr);
     if (uints == null)
     {
         return(null);
     }
     for (int i = 0; i < uints.Length; i++)
     {
         uints[i] = MetaUtils.SwapBytes(uints[i]);
     }
     return(uints);
 }
Beispiel #3
0
 public static MetaName[] GetHashArray(PsoFile pso, Array_uint arr)
 {
     uint[] uints = GetUintArrayRaw(pso, arr);
     if (uints == null)
     {
         return(null);
     }
     MetaName[] hashes = new MetaName[uints.Length];
     for (int n = 0; n < uints.Length; n++)
     {
         hashes[n] = (MetaName)MetaUtils.SwapBytes(uints[n]);
     }
     return(hashes);
 }
Beispiel #4
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 #5
0
        public static uint[] GetUintArrayRaw(PsoFile pso, Array_uint arr)
        {
            byte[] data    = pso.DataSection.Data;
            var    entryid = arr.Pointer & 0xFFF;

            if ((entryid == 0) || (entryid > pso.DataMappingSection.EntriesCount))
            {
                return(null);
            }
            var entryoffset = (arr.Pointer & 0xFFFFFF) >> 12;
            var arrentry    = pso.DataMappingSection.Entries[(int)entryid - 1];
            int totoffset   = arrentry.Offset + (int)entryoffset;

            uint[] readdata = ConvertDataArrayRaw <uint>(data, totoffset, arr.Count1);
            return(readdata);
        }