示例#1
0
        public static void OutputTree(DirectoryInfo directory, SimpleMesh mesh)
        {
            if (mesh == null)
            {
                return;
            }

            FileInfo file = new FileInfo(directory.FullName + "\\tree_" + mesh.ID.ToString("X8") + ".txt");

            using (FileStream stream = file.OpenWrite())
            {
                using (StreamWriter writer = new StreamWriter(stream))
                {
                    if (mesh.HasFirstTrifanSet)
                    {
                        writer.WriteLine("First trifan set");
                        OutputNode(0, mesh.FirstTrifanSet.BP, writer);
                        writer.WriteLine(writer.NewLine);
                    }
                    if (mesh.HasSecondTrifanSet)
                    {
                        writer.WriteLine("Second trifan set");
                        OutputNode(0, mesh.SecondTrifanSet.BP, writer);
                    }
                }
            }
        }
示例#2
0
 public MeshScene(Device device, SimpleMesh mesh)
 {
     m_device                    = device;
     m_renderSubMeshOnly         = false;
     m_noTexturingOnSimpleMeshes = false;
     m_texturedTrifans           = new Dictionary <int, TrifanDrawInfo>();
     m_coloredTrifans            = new Dictionary <int, TrifanDrawInfo>();
     Debug.Assert(mesh != null);
     m_simpleMesh = mesh;
 }
示例#3
0
        private static void TrySimpleMesh(DatReader reader, uint fileId)
        {
            EmbeddedFile file = reader.LocateFile(fileId);

            if (file == null)
            {
                throw new Exception("Unable to locate file");
            }
            SimpleMesh mesh = new SimpleMesh(file);

            mesh.ReadSimpleMesh();
        }
示例#4
0
        /// <summary>
        /// Loads the simple mesh with the specified ID
        /// </summary>
        /// <param name="id">The ID of the simple mesh</param>
        /// <returns>The simple mesh, or null if it couldn't be found</returns>
        public SimpleMesh LoadSimpleMesh(uint id)
        {
            EmbeddedFile file = m_portalReader.LocateFile(id);

            if (file == null)
            {
                return(null);
            }
            SimpleMesh mesh = new SimpleMesh(file);

            mesh.ReadSimpleMesh();
            return(mesh);
        }
示例#5
0
        /// <summary>
        /// Changes the mesh to the specified ID
        /// </summary>
        /// <param name="id">The ID of the new mesh</param>
        public void ChangeMesh(uint id)
        {
            lock (this)
            {
                DisposeDueToLostDevice();

                // if we're loading a dungeon block, then we'll have to convert this
                // to a simple mesh
                if ((id & 0xFF000000) == 0x0D000000)
                {
                    DungeonBlock block = DungeonProvider.Instance.GetDungeonBlock(id);
                    m_noTexturing = true;
                    m_simpleMesh  = new SimpleMesh(block);
                }
                else
                {
                    m_noTexturing = m_noTexturingOnSimpleMeshes;
                    m_simpleMesh  = MeshProvider.Instance.LoadSimpleMesh(id);
                }
                m_subMeshIndex = 0;
                ReInitialize();
            }
        }
示例#6
0
 public static void OutputTree(string directory, SimpleMesh mesh)
 {
     OutputTree(new DirectoryInfo(directory), mesh);
 }