Exemple #1
0
        public void LoadTIX(string tixPath)
        {
            Logger.Log()(LogLevel.INFO, $"Loading TIX from: {tixPath}");

            TIX tix;

            using (BinaryReader br = new BinaryReader(File.Open(tixPath, FileMode.Open)))
            {
                tix = new TIX(br);
            }

            Logger.Log()(LogLevel.INFO, "Successfully loaded TIX");

            TIXDocument document = CreateDocument(tix);

            _treeController.PopulateTreeWithDocument(document, Path.GetFileName(tixPath));
        }
Exemple #2
0
        protected MeshListTreeNode createTIXNode(string name, TIXDocument tixDoc)
        {
            MeshListTreeNode rootNode = new MeshListTreeNode(name,
                                                             new List <IRenderable> {
                tixDoc.TIMs[0].TextureMeshes[0]
            },
                                                             contextMenu: new ContextMenu(
                                                                 new Dictionary <string, Action>
            {
                {
                    "Export as TIX",
                    () =>
                    {
                        _exportController.OpenDialog(
                            filePath => { _exportController.ExportOriginal(tixDoc.Document, filePath); },
                            ".tix");
                    }
                },
                {
                    "Export as PNGs",
                    () =>
                    {
                        _exportController.OpenDialog(
                            filePath =>
                        {
                            _exportController.ExportImages(tixDoc.Document, filePath, false,
                                                           ImageFormat.Png);
                        }, ".png");
                    }
                }
            }));

            for (int i = 0; i < tixDoc.TIMs.Count; i++)
            {
                MeshListTreeNode timNode = createTIMNode($"Texture {i}", tixDoc.TIMs[i]);
                rootNode.AddNode(timNode);
            }

            return(rootNode);
        }