Exemple #1
0
        /// <summary>
        /// Loads all markersets of a scene and looks for the one with the subscene position
        /// </summary>
        private static Vector3D FindSubScenePosition(Mooege.Common.MPQ.FileFormats.SceneChunk sceneChunk)
        {
            var mpqScene = MPQStorage.Data.Assets[SNOGroup.Scene][sceneChunk.SNOHandle.Id].Data as Mooege.Common.MPQ.FileFormats.Scene;

            foreach (var markerSet in mpqScene.MarkerSets)
            {
                var mpqMarkerSet = MPQStorage.Data.Assets[SNOGroup.MarkerSet][markerSet].Data as Mooege.Common.MPQ.FileFormats.MarkerSet;
                foreach (var marker in mpqMarkerSet.Markers)
                    if (marker.Type == Mooege.Common.MPQ.FileFormats.MarkerType.SubScenePosition)
                        return marker.PRTransform.Vector3D;
            }
            return null;
        }
Exemple #2
0
        /// <summary>
        /// Loads all markersets of a scene and looks for the one with the subscene position
        /// </summary>
        private static Vector3D FindSubScenePosition(Mooege.Common.MPQ.FileFormats.SceneChunk sceneChunk)
        {
            var mpqScene = MPQStorage.Data.Assets[SNOGroup.Scene][sceneChunk.SNOHandle.Id].Data as Mooege.Common.MPQ.FileFormats.Scene;

            foreach (var markerSet in mpqScene.MarkerSets)
            {
                var mpqMarkerSet = MPQStorage.Data.Assets[SNOGroup.MarkerSet][markerSet].Data as Mooege.Common.MPQ.FileFormats.MarkerSet;
                foreach (var marker in mpqMarkerSet.Markers)
                {
                    if (marker.Type == Mooege.Common.MPQ.FileFormats.MarkerType.SubScenePosition)      // TODO Make this an enum value /farmy
                    {
                        return(marker.PRTransform.Vector3D);
                    }
                }
            }

            return(null);
        }
        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++;
        }