Beispiel #1
0
        private static void AddTile(Mooege.Common.MPQ.FileFormats.World worldData, TileInfo tileInfo, Vector3D location)
        {
            var sceneChunk = new SceneChunk();

            sceneChunk.SNOHandle                       = new SNOHandle(tileInfo.SNOScene);
            sceneChunk.PRTransform                     = new PRTransform();
            sceneChunk.PRTransform.Quaternion          = new Quaternion();
            sceneChunk.PRTransform.Quaternion.W        = 1.0f;
            sceneChunk.PRTransform.Quaternion.Vector3D = new Vector3D(0, 0, 0);
            sceneChunk.PRTransform.Vector3D            = new Vector3D();
            sceneChunk.PRTransform.Vector3D            = location;



            var spec = new SceneSpecification();

            //scene.Specification = spec;
            spec.Cell = new Vector2D()
            {
                X = 0, Y = 0
            };
            spec.CellZ                      = 0;
            spec.SNOLevelAreas              = new int[] { -1, -1, -1, -1 };
            spec.SNOMusic                   = -1;
            spec.SNONextLevelArea           = -1;
            spec.SNONextWorld               = -1;
            spec.SNOPresetWorld             = -1;
            spec.SNOPrevLevelArea           = -1;
            spec.SNOPrevWorld               = -1;
            spec.SNOReverb                  = -1;
            spec.SNOWeather                 = 50542;
            spec.SNOCombatMusic             = -1;
            spec.SNOAmbient                 = -1;
            spec.ClusterID                  = -1;
            spec.Unknown1                   = 14;
            spec.Unknown3                   = 5;
            spec.Unknown4                   = -1;
            spec.Unknown5                   = 0;
            spec.SceneCachedValues          = new SceneCachedValues();
            spec.SceneCachedValues.Unknown1 = 63;
            spec.SceneCachedValues.Unknown2 = 96;
            spec.SceneCachedValues.Unknown3 = 96;
            var sceneFile = MPQStorage.Data.Assets[SNOGroup.Scene][tileInfo.SNOScene];
            var sceneData = (Mooege.Common.MPQ.FileFormats.Scene)sceneFile.Data;

            spec.SceneCachedValues.AABB1    = sceneData.AABBBounds;
            spec.SceneCachedValues.AABB2    = sceneData.AABBMarketSetBounds;
            spec.SceneCachedValues.Unknown4 = new int[4] {
                0, 0, 0, 0
            };

            sceneChunk.SceneSpecification = spec;


            worldData.SceneParams.SceneChunks.Add(sceneChunk);
            worldData.SceneParams.ChunkCount++;
        }
Beispiel #2
0
 public override void Parse(GameBitBuffer buffer)
 {
     WorldID = buffer.ReadUInt(32);
     SceneSpec = new SceneSpecification();
     SceneSpec.Parse(buffer);
     ChunkID = buffer.ReadUInt(32);
     SceneSNO = buffer.ReadInt(32);
     Transform = new PRTransform();
     Transform.Parse(buffer);
     ParentChunkID = buffer.ReadUInt(32);
     SceneGroupSNO = buffer.ReadInt(32);
     arAppliedLabels = new int /* gbid */[buffer.ReadInt(9)];
     for (int i = 0; i < arAppliedLabels.Length; i++) arAppliedLabels[i] = buffer.ReadInt(32);
 }
Beispiel #3
0
 public override void Parse(GameBitBuffer buffer)
 {
     WorldID   = buffer.ReadUInt(32);
     SceneSpec = new SceneSpecification();
     SceneSpec.Parse(buffer);
     ChunkID   = buffer.ReadUInt(32);
     SceneSNO  = buffer.ReadInt(32);
     Transform = new PRTransform();
     Transform.Parse(buffer);
     ParentChunkID   = buffer.ReadUInt(32);
     SceneGroupSNO   = buffer.ReadInt(32);
     arAppliedLabels = new int /* gbid */[buffer.ReadInt(9)];
     for (int i = 0; i < arAppliedLabels.Length; i++)
     {
         arAppliedLabels[i] = buffer.ReadInt(32);
     }
 }
Beispiel #4
0
 public override void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new SceneSpecification();
     Field1.Parse(buffer);
     Field2 = buffer.ReadInt(32);
     snoScene = buffer.ReadInt(32);
     Field4 = new PRTransform();
     Field4.Parse(buffer);
     Field5 = buffer.ReadInt(32);
     snoSceneGroup = buffer.ReadInt(32);
     arAppliedLabels = new int[buffer.ReadInt(9)];
     for(int i = 0;i < _arAppliedLabels.Length;i++) _arAppliedLabels[i] = buffer.ReadInt(32);
 }
Beispiel #5
0
 public void Read(MpqFileStream stream)
 {
     this.SNOHandle          = new SNOHandle(stream);
     this.PRTransform        = new PRTransform(stream);
     this.SceneSpecification = new SceneSpecification(stream);
 }
Beispiel #6
0
        public RevealSceneMessage(string[] data, int f0)
        {
            Id        = 0x0034;
            WorldID   = f0;//0x772E0000; //int.Parse(data[0]),
            SceneSpec = new SceneSpecification()
            {
                Field0 = int.Parse(data[1]),
                Field1 = new IVector2D()
                {
                    Field0 = int.Parse(data[2]),
                    Field1 = int.Parse(data[3]),
                },
                arSnoLevelAreas = new int[4] {
                    int.Parse(data[4]), int.Parse(data[5]), int.Parse(data[6]), int.Parse(data[7]),
                },
                snoPrevWorld     = int.Parse(data[8]),
                Field4           = int.Parse(data[9]),
                snoPrevLevelArea = int.Parse(data[10]),
                snoNextWorld     = int.Parse(data[11]),
                Field7           = int.Parse(data[12]),
                snoNextLevelArea = int.Parse(data[13]),
                snoMusic         = int.Parse(data[14]),
                snoCombatMusic   = int.Parse(data[15]),
                snoAmbient       = int.Parse(data[16]),
                snoReverb        = int.Parse(data[17]),
                snoWeather       = int.Parse(data[18]),
                snoPresetWorld   = int.Parse(data[19]),
                Field15          = int.Parse(data[20]),
                Field16          = int.Parse(data[21]),
                Field17          = int.Parse(data[22]),
                Field18          = int.Parse(data[23]),
                tCachedValues    = new SceneCachedValues()
                {
                    Field0 = int.Parse(data[24]),
                    Field1 = int.Parse(data[25]),
                    Field2 = int.Parse(data[26]),
                    Field3 = new AABB()
                    {
                        Field0 = new Vector3D()
                        {
                            X = float.Parse(data[27], System.Globalization.CultureInfo.InvariantCulture),
                            Y = float.Parse(data[28], System.Globalization.CultureInfo.InvariantCulture),
                            Z = float.Parse(data[29], System.Globalization.CultureInfo.InvariantCulture),
                        },
                        Field1 = new Vector3D()
                        {
                            X = float.Parse(data[30], System.Globalization.CultureInfo.InvariantCulture),
                            Y = float.Parse(data[31], System.Globalization.CultureInfo.InvariantCulture),
                            Z = float.Parse(data[32], System.Globalization.CultureInfo.InvariantCulture),
                        },
                    },
                    Field4 = new AABB()
                    {
                        Field0 = new Vector3D()
                        {
                            X = float.Parse(data[33], System.Globalization.CultureInfo.InvariantCulture),
                            Y = float.Parse(data[34], System.Globalization.CultureInfo.InvariantCulture),
                            Z = float.Parse(data[35], System.Globalization.CultureInfo.InvariantCulture),
                        },
                        Field1 = new Vector3D()
                        {
                            X = float.Parse(data[36], System.Globalization.CultureInfo.InvariantCulture),
                            Y = float.Parse(data[37], System.Globalization.CultureInfo.InvariantCulture),
                            Z = float.Parse(data[38], System.Globalization.CultureInfo.InvariantCulture),
                        },
                    },
                    Field5 = new int[4] {
                        int.Parse(data[39]), int.Parse(data[40]), int.Parse(data[41]), int.Parse(data[42]),
                    },
                    Field6 = int.Parse(data[43]),
                },
            };
            ChunkID  = int.Parse(data[44]);
            snoScene = int.Parse(data[45]);
            Position = new PRTransform()
            {
                Field0 = new Quaternion()
                {
                    Amount = float.Parse(data[49], System.Globalization.CultureInfo.InvariantCulture),
                    Axis   = new Vector3D()
                    {
                        X = float.Parse(data[46], System.Globalization.CultureInfo.InvariantCulture),
                        Y = float.Parse(data[47], System.Globalization.CultureInfo.InvariantCulture),
                        Z = float.Parse(data[48], System.Globalization.CultureInfo.InvariantCulture),
                    },
                },
                ReferencePoint = new Vector3D()
                {
                    X = float.Parse(data[50], System.Globalization.CultureInfo.InvariantCulture),
                    Y = float.Parse(data[51], System.Globalization.CultureInfo.InvariantCulture),
                    Z = float.Parse(data[52], System.Globalization.CultureInfo.InvariantCulture),
                },
            };

            ParentChunkID   = int.Parse(data[53]);
            snoSceneGroup   = int.Parse(data[54]);
            arAppliedLabels = new int[0];
        }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new SNOName();
     Field0.Parse(buffer);
     Field1 = new PRTransform();
     Field1.Parse(buffer);
     Field2 = new SceneSpecification();
     Field2.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new RequiredMessageHeader();
     Field0.Parse(buffer);
     Field1 = buffer.ReadInt(32);
     Field2 = new SceneSpecification();
     Field2.Parse(buffer);
     Field3 = buffer.ReadInt(32);
     snoScene = buffer.ReadInt(32);
     Field5 = new PRTransform();
     Field5.Parse(buffer);
     Field6 = buffer.ReadInt(32);
     snoSceneGroup = buffer.ReadInt(32);
     arAppliedLabels = new int[buffer.ReadInt(9)];
     for(int i = 0;i < _arAppliedLabels.Length;i++) _arAppliedLabels[i] = buffer.ReadInt(32);
 }