Ejemplo n.º 1
0
        public void SetupSettings()
        {
            if (SelectedTexSettings.Format == GTX.GX2SurfaceFormat.INVALID)
            {
                return;
            }

            if (formatComboBox.SelectedItem is GTX.GX2SurfaceFormat)
            {
                SelectedTexSettings.Format = (GTX.GX2SurfaceFormat)formatComboBox.SelectedItem;
                listViewCustom1.SelectedItems[0].SubItems[1].Text = SelectedTexSettings.Format.ToString();
            }

            try
            {
                Bitmap bitmap = Switch_Toolbox.Library.Imaging.GetLoadingImage();

                Thread = new Thread((ThreadStart)(() =>
                {
                    pictureBox1.Image = bitmap;
                    SelectedTexSettings.Compress();

                    bitmap = FTEX.DecodeBlock(SelectedTexSettings.DataBlockOutput[0], SelectedTexSettings.
                                              TexWidth, SelectedTexSettings.TexHeight, (Syroot.NintenTools.Bfres.GX2.GX2SurfaceFormat)SelectedTexSettings.Format);

                    pictureBox1.Image = bitmap;
                }));
                Thread.Start();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }