private void SetUpRendering() { // Make sure the shaders and textures are ready for rendering. OpenTKSharedResources.InitializeSharedResources(); if (OpenTKSharedResources.SetupStatus == OpenTKSharedResources.SharedResourceStatus.Initialized) { currentNut.RefreshGlTexturesByHashId(); pngExportFramebuffer = new Framebuffer(FramebufferTarget.Framebuffer, glControl1.Width, glControl1.Height); } }
private void RegenerateMipMaps_Click(object sender, EventArgs e) { if (OpenTKSharedResources.SetupStatus != OpenTKSharedResources.SharedResourceStatus.Initialized) { return; } if (textureListBox.SelectedItem != null) { NutTexture tex = ((NutTexture)textureListBox.SelectedItem); NUT.RegenerateMipmapsFromTexture2D(tex); // Render the selected texture again. currentNut.RefreshGlTexturesByHashId(); if (currentNut.glTexByHashId.ContainsKey(tex.HashId)) { textureToRender = currentNut.glTexByHashId[tex.HashId]; } glControl1.Invalidate(); } }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { tbl = new DataTable(); tbl.Columns.Add(new DataColumn("Name") { ReadOnly = true }); tbl.Columns.Add("Value"); dataGridView1.DataSource = tbl; tbl.Rows.Clear(); try { if (e.Node.Parent.Text == "Symbols") { tbl.Rows.Add("String", Lumen.Strings[e.Node.Index]); } else if (e.Node.Parent.Text == "Colors") { tbl.Rows.Add("Red", Lumen.Colors[e.Node.Index].X * 255); tbl.Rows.Add("Green", Lumen.Colors[e.Node.Index].Y * 255); tbl.Rows.Add("Blue", Lumen.Colors[e.Node.Index].Z * 255); tbl.Rows.Add("Alpha", Lumen.Colors[e.Node.Index].W * 255); } else if (e.Node.Parent.Text == "Transforms") { tbl.Rows.Add("X-Scale", Lumen.Transforms[e.Node.Index].Row0[0]); tbl.Rows.Add("X-Skew", Lumen.Transforms[e.Node.Index].Row1[0]); tbl.Rows.Add("X-Transform", Lumen.Transforms[e.Node.Index].Row3[0]); tbl.Rows.Add("Y-Scale", Lumen.Transforms[e.Node.Index].Row1[1]); tbl.Rows.Add("Y-Skew", Lumen.Transforms[e.Node.Index].Row0[1]); tbl.Rows.Add("Y-Transform", Lumen.Transforms[e.Node.Index].Row3[1]); } else if (e.Node.Parent.Text == "Positions") { tbl.Rows.Add("X", Lumen.Positions[e.Node.Index][0]); tbl.Rows.Add("Y", Lumen.Positions[e.Node.Index][1]); } else if (e.Node.Parent.Text == "Bounds") { tbl.Rows.Add("Top", Lumen.Bounds[e.Node.Index].TopLeft.X); tbl.Rows.Add("Left", Lumen.Bounds[e.Node.Index].TopLeft.Y); tbl.Rows.Add("Bottom", Lumen.Bounds[e.Node.Index].BottomRight.X); tbl.Rows.Add("Right", Lumen.Bounds[e.Node.Index].BottomRight.Y); } else if (e.Node.Parent.Text == "Atlases") { tbl.Rows.Add("Texture ID", Lumen.Atlases[e.Node.Index].id); tbl.Rows.Add("Name ID", Lumen.Atlases[e.Node.Index].nameId); tbl.Rows.Add("Width", Lumen.Atlases[e.Node.Index].width); tbl.Rows.Add("Height", Lumen.Atlases[e.Node.Index].height); } else if (e.Node.Text.StartsWith("Graphic 0x")) { string filename = (Path.GetDirectoryName(Lumen.Filename) + "\\img-" + (e.Node.Index.ToString("00000")) + ".nut"); Nut = new NUT(filename); Nut.RefreshGlTexturesByHashId(); LMUVViewer UvViewer = new LMUVViewer(Lumen, Nut, e.Node.Parent.Index, e.Node.Index); UvViewer.Show(); } else if (e.Node.Parent.Text == "Texts") { tbl.Rows.Add("Character ID", Lumen.Texts[e.Node.Index].CharacterId); tbl.Rows.Add("unk 1", Lumen.Texts[e.Node.Index].unk1); tbl.Rows.Add("Placeholder Text ID", Lumen.Texts[e.Node.Index].placeholderTextId); tbl.Rows.Add("unk 2", Lumen.Texts[e.Node.Index].unk2); tbl.Rows.Add("Stroke Color ID", Lumen.Texts[e.Node.Index].strokeColorId); tbl.Rows.Add("unk 3", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("unk 4", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("unk 5", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("Text Alignment", Lumen.Texts[e.Node.Index].alignment); tbl.Rows.Add("unk 6", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("unk 7", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("unk 8", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("Size", Lumen.Texts[e.Node.Index].size); tbl.Rows.Add("unk 9", Lumen.Texts[e.Node.Index].unk3); tbl.Rows.Add("unk 10", Lumen.Texts[e.Node.Index].unk10); tbl.Rows.Add("unk 11", Lumen.Texts[e.Node.Index].unk11); tbl.Rows.Add("unk 12", Lumen.Texts[e.Node.Index].unk12); } else if (e.Node.Parent.Text == "Unk") { } } catch { } }