private void mODE1ToolStripMenuItem_Click(object sender, EventArgs e) { listBox1.Items.Clear(); //numericUpDown1.Enabled = true; //numericUpDown1.Value = 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "*.*|*.*" }; if (ofd.ShowDialog() != DialogResult.OK) return; _lastKnownPath = ofd.FileName; UpdateStatus(_lastKnownPath); GfAlt = new GF_AlternativeTexture(ofd.FileName); Console.WriteLine("GFAlt: Trying to render single file texture!"); Bitmap bmp = GfAlt.DrawMODE1Texture(); pictureBox1.SizeMode = PictureBoxSizeMode.Normal; pictureBox1.Image = bmp; GfAlt.CloseAll(); _state = StateTexture; }
private void specialTextureFormatToolStripMenuItem_Click(object sender, EventArgs e) { if ((sender as ToolStripMenuItem).Tag.ToString() == "cheeseburger") return; listBox1.Items.Clear(); //numericUpDown1.Enabled = true; //numericUpDown1.Value = 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "*.*|*.*" }; if (ofd.ShowDialog() != DialogResult.OK) return; _lastKnownPath = ofd.FileName; UpdateStatus(_lastKnownPath); GfAlt = new GF_AlternativeTexture(ofd.FileName); if (!GfAlt.Valid()) { Console.WriteLine("GFAlt: I can't handle this file! Probably bad file or another alternative texture... :/\n");GfAlt.CloseAll();return;} Console.WriteLine("GFAlt: File valid! Trying to draw texture"); foreach (uint i in GfAlt.tex.TexturePointers) listBox1.Items.Add(i); Bitmap bmp = GfAlt.DrawTexture(GfAlt.tex.TexturePointers[0], GfAlt.tex.TexturePointers.Length == 1 ? true : false); pictureBox1.SizeMode = PictureBoxSizeMode.Normal; pictureBox1.Image = bmp; GfAlt.CloseAll(); _state = StateTextureGFSpecial; }