private static void BuildTextureNodes(TreeNode parent, UInt32 offset) { var newTextureNode = new TextureNode(file, offset); var newTreeNode = new TreeNode("TextureNode"); newTreeNode.Tag = newTextureNode; parent.Nodes.Add(newTreeNode); if (newTextureNode.paletteHeaderOffset0x50 != 0) { BuildPaletteHeader(newTreeNode, newTextureNode.paletteHeaderOffset0x50 + dataOffset, ref newTextureNode); } if (newTextureNode.imageHeaderOffset0x4C != 0) { BuildImageHeader(newTreeNode, newTextureNode.imageHeaderOffset0x4C + dataOffset, ref newTextureNode); bool add = true; for (int i = 0; i < textureList.Items.Count; i++) { if (textureList.Items[i].ToString().IndexOf(newTextureNode.imageHeader.imageOffset0x0.ToString("x8")) != -1) //TODO: Make textureList a LL and not a ListBox { add = false; } } if (add) { textureList.Items.Add(new TextureListObject(newTextureNode.imageHeader.imageOffset0x0, newTextureNode)); } } }
public TextureListObject(UInt32 imageHeaderOffset, TextureNode node) { name = "Texture " + (DatFile.textureList.Items.Count + 1) + " (" + imageHeaderOffset.ToString("x8") + ")"; this.node = node; imageHeader = node.imageHeader; paletteHeader = node.paletteHeader; imageBitmap = TPL.ConvertFromTextureMelee(imageHeader, paletteHeader, out imageSize); }
private static void BuildPaletteHeader(TreeNode parent, UInt32 offset, ref TextureNode texNode) { var newPaletteHeader = new PaletteHeader(file, offset); var newTreeNode = new TreeNode("PaletteHeader"); newTreeNode.Tag = newPaletteHeader; parent.Nodes.Add(newTreeNode); texNode.paletteHeader = newPaletteHeader; }
public TextureListObject(UInt32 imageHeaderOffset, TextureNode node) { name = "Texture " + (DatFile.textureList.Items.Count +1) + " (" + imageHeaderOffset.ToString("x8") + ")"; this.node = node; imageHeader = node.imageHeader; paletteHeader = node.paletteHeader; imageBitmap = TPL.ConvertFromTextureMelee(imageHeader, paletteHeader, out imageSize); }
private static void BuildTextureNodes(TreeNode parent, UInt32 offset) { var newTextureNode = new TextureNode(file, offset); var newTreeNode = new TreeNode("TextureNode"); newTreeNode.Tag = newTextureNode; parent.Nodes.Add(newTreeNode); if (newTextureNode.paletteHeaderOffset0x50 != 0) { BuildPaletteHeader(newTreeNode, newTextureNode.paletteHeaderOffset0x50 + dataOffset, ref newTextureNode); } if (newTextureNode.imageHeaderOffset0x4C != 0) { BuildImageHeader(newTreeNode, newTextureNode.imageHeaderOffset0x4C + dataOffset, ref newTextureNode); bool add = true; for (int i = 0; i < textureList.Items.Count; i++) { if (textureList.Items[i].ToString().IndexOf(newTextureNode.imageHeader.imageOffset0x0.ToString("x8")) != -1 ) //TODO: Make textureList a LL and not a ListBox add = false; } if (add) textureList.Items.Add(new TextureListObject(newTextureNode.imageHeader.imageOffset0x0, newTextureNode)); } }