예제 #1
0
 public void Read(MpqFileStream stream)
 {
     this.DRLGParams      = stream.ReadSerializedData <DRLGParams>();
     stream.Position     += 8;
     this.SceneParams     = stream.ReadSerializedItem <SceneParams>();
     stream.Position     += 8;
     LabelRuleSet         = new LabelRuleSet(stream);
     this.Int1            = stream.ReadValueS32();
     this.SceneClusterSet = new SceneClusterSet(stream);
     for (int i = 0; i < SNONavMeshFunctions.Length; i++)
     {
         SNONavMeshFunctions[i] = stream.ReadValueS32();
     }
     SNOScript = stream.ReadValueS32();
     Int2      = stream.ReadValueS32();
 }
예제 #2
0
        public World(MpqFile file)
        {
            if (file.Size == 0)
            {
                return;
            }
            var stream = file.Open();

            this.Header = new Header(stream);

            this.IsGenerated = (stream.ReadValueS32() != 0);
            this.Int1        = stream.ReadValueS32();
            this.Int2        = stream.ReadValueS32();

            //this.DRLGParams = stream.ReadSerializedData<DRLGParams>(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/120) /raist
            stream.Position += 8;                                         // skips reading of DRLG Pointer
            stream.Position += (2 * 4);
            this.SceneParams = stream.ReadSerializedItem <SceneParams>(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/24) /raist

            stream.Position += (2 * 4);
            this.MarkerSets  = stream.ReadSerializedInts();

            stream.Position += (14 * 4);
            this.Environment = new Environment(stream);

            stream.Position += 4;
            LabelRuleSet     = new LabelRuleSet(stream);
            this.Int4        = stream.ReadValueS32();

            stream.Position     += 4;
            this.SceneClusterSet = new SceneClusterSet(stream);

            for (int i = 0; i < SNONavMeshFunctions.Length; i++)
            {
                SNONavMeshFunctions[i] = stream.ReadValueS32();
            }

            stream.Position += 4;
            Float0           = stream.ReadValueF32();
            Int5             = stream.ReadValueS32();
            SNOScript        = stream.ReadValueS32();
            Int6             = stream.ReadValueS32();

            stream.Close();
        }
예제 #3
0
파일: World.cs 프로젝트: vrobel/mooege
        public World(MpqFile file)
        {
            if (file.Size == 0)
                return;
            var stream = file.Open();

            this.Header = new Header(stream);

            this.IsGenerated = (stream.ReadValueS32() != 0);
            this.Int1 = stream.ReadValueS32();
            this.Int2 = stream.ReadValueS32();

            //this.DRLGParams = stream.ReadSerializedData<DRLGParams>(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/120) /raist
            stream.Position += 8; // skips reading of DRLG Pointer
            stream.Position += (2 * 4);
            this.SceneParams = stream.ReadSerializedItem<SceneParams>(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/24) /raist

            stream.Position += (2 * 4);
            this.MarkerSets = stream.ReadSerializedInts();

            stream.Position += (14 * 4);
            this.Environment = new Environment(stream);

            stream.Position += 4;
            LabelRuleSet = new LabelRuleSet(stream);
            this.Int4 = stream.ReadValueS32();

            stream.Position += 4;
            this.SceneClusterSet = new SceneClusterSet(stream);

            for (int i = 0; i < SNONavMeshFunctions.Length; i++)
            {
                SNONavMeshFunctions[i] = stream.ReadValueS32();
            }

            stream.Position += 4;
            Float0 = stream.ReadValueF32();
            Int5 = stream.ReadValueS32();
            SNOScript = stream.ReadValueS32();
            Int6 = stream.ReadValueS32();

            stream.Close();
        }
예제 #4
0
파일: World.cs 프로젝트: Naxp/mooege
 public void Read(MpqFileStream stream)
 {
     this.DRLGParams = stream.ReadSerializedData<DRLGParams>();
     stream.Position += 8;
     this.SceneParams = stream.ReadSerializedItem<SceneParams>();
     stream.Position += 8;
     LabelRuleSet = new LabelRuleSet(stream);
     this.Int1 = stream.ReadValueS32();
     this.SceneClusterSet = new SceneClusterSet(stream);
     for (int i = 0; i < SNONavMeshFunctions.Length; i++)
     {
         SNONavMeshFunctions[i] = stream.ReadValueS32();
     }
     SNOScript = stream.ReadValueS32();
     Int2 = stream.ReadValueS32();
 }
예제 #5
0
파일: World.cs 프로젝트: nerdymerky/mooege
        public World(MpqFile file)
        {
            var stream = file.Open();
            Header = new Header(stream);
            SNO = stream.ReadInt32();
            serDRLGParams = new SerializeData(stream);
            long x = stream.Position;
            if (serDRLGParams.Size > 0)
            {
                Param = new DRLGParams[serDRLGParams.Size / 120];
                stream.Position = serDRLGParams.Offset + 16;
                for (int i = 0; i < serDRLGParams.Size/120; i++)
                {
                    Param[i] = new DRLGParams(stream);
                }
            }
            stream.Position = x;
            stream.Position += (5 * 4); // This was 3 ints padding in the struct, was 8 bytes behind though so i changed it - DarkLotus

            serSceneParams = new SerializeData(stream);
            x = stream.Position;
            if (serSceneParams.Size > 0)
            {
                stream.Position = serSceneParams.Offset + 16;
                Scene = new SceneParams(stream); ;
                

            }
            stream.Position = x;
            stream.Position += (2 * 4);
            serMarkerSets = new SerializeData(stream);
            x = stream.Position;
            if (serMarkerSets.Size > 0)
            {
                MarkerSets = new int[serMarkerSets.Size / 4];
                stream.Position = serMarkerSets.Offset + 16;
                for (int i = 0; i < serMarkerSets.Size / 4; i++)
                {
                    MarkerSets[i] = stream.ReadInt32();
                }
            }
            stream.Position = x;

            stream.Position += (14 * 4);

            Environment = new DataTypes.Environment(stream);

            stream.Position += 4;
            LabelRuleSet = new DataTypes.LabelRuleSet(stream);
            i0 = stream.ReadInt32();
            stream.Position += 4;
            SceneClusterSet5 = new SceneClusterSet(stream);
            arNavMeshFuncs = new int[4];
            for (int i = 0; i < arNavMeshFuncs.Length; i++)
            {
                arNavMeshFuncs[i] = stream.ReadInt32();
            }
            stream.Position += 4;
            f0 = stream.ReadFloat();
            i1 = stream.ReadInt32();
            snoScript = stream.ReadInt32();
            i2 = stream.ReadInt32();
         
            stream.Close();
        }