Esempio n. 1
0
        public override void Replace(string FileName)
        {
            GamecubeTextureImporterList     importer = new GamecubeTextureImporterList(SupportedFormats);
            GameCubeTextureImporterSettings settings = new GameCubeTextureImporterSettings();

            importer.ForceMipCount    = true;
            importer.SelectedMipCount = 1;

            settings.LoadBitMap(FileName);
            importer.LoadSettings(new List <GameCubeTextureImporterSettings>()
            {
                settings,
            });
            settings.MipCount = 1;
            settings.Format   = Decode_Gamecube.FromGenericFormat(Format);

            if (importer.ShowDialog() == DialogResult.OK)
            {
                if (settings.GenerateMipmaps && !settings.IsFinishedCompressing)
                {
                    settings.Compress();
                }

                ApplySettings(settings);
                UpdateEditor();
            }
        }
Esempio n. 2
0
            public override void Replace(string FileName)
            {
                GamecubeTextureImporterList     importer = new GamecubeTextureImporterList(SupportedFormats);
                GameCubeTextureImporterSettings settings = new GameCubeTextureImporterSettings();

                importer.ForceMipCount = true;
                if (MipCount == 1)
                {
                    importer.SelectedMipCount = 1;
                }

                if (Utils.GetExtension(FileName) == ".dds" ||
                    Utils.GetExtension(FileName) == ".dds2")
                {
                    settings.LoadDDS(FileName);
                    importer.LoadSettings(new List <GameCubeTextureImporterSettings>()
                    {
                        settings,
                    });

                    ApplySettings(settings);
                    UpdateEditor();
                }
                else
                {
                    settings.LoadBitMap(FileName);
                    importer.LoadSettings(new List <GameCubeTextureImporterSettings>()
                    {
                        settings,
                    });

                    if (importer.ShowDialog() == DialogResult.OK)
                    {
                        if (settings.GenerateMipmaps && !settings.IsFinishedCompressing)
                        {
                            settings.Compress();
                        }

                        ApplySettings(settings);
                        UpdateEditor();
                    }
                }
            }