Ejemplo n.º 1
0
        public TextureImporterSettings LoadSettings(string name)
        {
            var importer = new TextureImporterSettings();

            string ext = Path.GetExtension(name);

            ext = ext.ToLower();

            switch (ext)
            {
            case ".bftex":
                Texture tex = new Texture();
                tex.Import(name);
                break;

            case ".dds":
                importer.LoadDDS(name, BinaryTexFile);
                break;

            default:
                importer.LoadBitMap(name, BinaryTexFile);
                break;
            }

            return(importer);
        }
Ejemplo n.º 2
0
        public void Replace(string FileName)
        {
            string ext = Path.GetExtension(FileName);

            ext = ext.ToLower();

            switch (ext)
            {
            case ".bftex":
                Texture.Import(FileName);
                break;

            case ".dds":
                TextureImporterSettings importDDS = new TextureImporterSettings();
                importDDS.LoadDDS(FileName, bntxFile, null, this);
                break;

            default:
                TextureImporterSettings import = new TextureImporterSettings();
                import.LoadBitMap(FileName, bntxFile, this);
                break;
            }
            Texture.Name = Text;
            UpdateBfresTextureMapping();
            if (BNTXEditor != null)
            {
                BNTXEditor.LoadPicture(DisplayTexture());
                BNTXEditor.LoadProperty(this);
            }
        }
Ejemplo n.º 3
0
        public void Replace(string FileName)
        {
            string ext = Path.GetExtension(FileName);

            ext = ext.ToLower();

            TextureImporterSettings   setting  = new TextureImporterSettings();
            BinaryTextureImporterList importer = new BinaryTextureImporterList();

            switch (ext)
            {
            case ".bftex":
                Texture.Import(FileName);
                break;

            case ".dds":
                setting.LoadDDS(FileName, bntxFile, null, this);
                ApplyImportSettings(setting);
                break;

            default:
                setting.LoadBitMap(FileName, bntxFile);
                importer.LoadSetting(setting);

                if (importer.ShowDialog() == DialogResult.OK)
                {
                    ApplyImportSettings(setting);
                }
                break;
            }
        }
Ejemplo n.º 4
0
        private void ImportPlaceholderTexture(byte[] data, string TextureName)
        {
            TextureImporterSettings importDDS = new TextureImporterSettings();

            importDDS.LoadDDS(TextureName, BinaryTexFile, data);

            TextureData texData = importDDS.textureData;

            texData.Text = TextureName;

            Nodes.Add(texData);
            Textures.Add(TextureName, texData);
            texData.LoadOpenGLTexture();
        }
Ejemplo n.º 5
0
        public TextureData AddTexture(string name)
        {
            var importer = new TextureImporterSettings();

            TextureData texData = null;
            string      ext     = Path.GetExtension(name);

            ext = ext.ToLower();

            switch (ext)
            {
            case ".bftex":
                Texture tex = new Texture();
                tex.Import(name);
                texData = new TextureData(tex, BinaryTexFile);
                break;

            case ".dds":
                importer.LoadDDS(name, BinaryTexFile);
                texData = importer.textureData;
                break;

            default:
                importer.LoadBitMap(name, BinaryTexFile);
                texData = importer.textureData;
                break;
            }
            if (texData != null)
            {
                List <string> keyList = new List <string>(Textures.Keys);
                texData.Text = Utils.RenameDuplicateString(keyList, texData.Text);

                Nodes.Add(texData);
                Textures.Add(texData.Text, texData);
                texData.LoadOpenGLTexture();
            }
            return(texData);
        }