From f2b42d132925c03764ec5064203a5b7e169878c0 Mon Sep 17 00:00:00 2001 From: MaxED Date: Wed, 5 Sep 2012 10:31:32 +0000 Subject: [PATCH] Fixed severe lags during Texture Browser opening when resource wad for current texture had lots of textures. Texture groups weren't created properly in soma cases. Added Monster/Hate Target sprite. --- .../Configurations/Includes/Doom2_things.cfg | 1 + .../Configurations/Includes/ZDoom_things.cfg | 6 ++- Build/Sprites/Target.png | Bin 0 -> 236 bytes Source/Core/GZBuilder/GZGeneral.cs | 2 +- Source/Core/Windows/TextureBrowserForm.cs | 45 ++++++++++-------- Source/Core/Windows/TextureBrowserForm.resx | 2 +- 6 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 Build/Sprites/Target.png diff --git a/Build/Configurations/Includes/Doom2_things.cfg b/Build/Configurations/Includes/Doom2_things.cfg index bfb26d31..c318e1cd 100644 --- a/Build/Configurations/Includes/Doom2_things.cfg +++ b/Build/Configurations/Includes/Doom2_things.cfg @@ -106,6 +106,7 @@ monsters 87 { title = "Monsters Target"; + sprite = "internal:Target"; height = 32; } } diff --git a/Build/Configurations/Includes/ZDoom_things.cfg b/Build/Configurations/Includes/ZDoom_things.cfg index c696f472..c851f1f8 100644 --- a/Build/Configurations/Includes/ZDoom_things.cfg +++ b/Build/Configurations/Includes/ZDoom_things.cfg @@ -787,7 +787,11 @@ zdoom title = "Map Spot (gravity)"; sprite = "internal:MapSpotGravity"; } - 9076 = "Hate target"; + 9076 + { + title = "Hate target"; + sprite = "internal:Target"; + } 9988 { title = "Custom Sprite"; diff --git a/Build/Sprites/Target.png b/Build/Sprites/Target.png new file mode 100644 index 0000000000000000000000000000000000000000..1637d171c20c0a40831ccd4b5583f209b67dbb39 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X`aE46Ln>}9nS7D=fC7h$?InNNHQd{qEgO7i-%_xgxTJ>b z{ej?uCv!Zu9AW;Jz};lVulC_!_1Y)rp9YtnPgzgic6D@|Jot|3S18lu1cSi4 ivN@@|7EkmU*%%^MnSK 1) { //sort them - TreeNode[] children = new TreeNode[item.Nodes.Count]; - item.Nodes.CopyTo(children, 0); - Array.Sort(children, sortTreeNodes); - item.Nodes.Clear(); - item.Nodes.AddRange(children); - }*/ - } } //mxd. Add All textures set @@ -116,6 +116,7 @@ namespace CodeImp.DoomBuilder.Windows TreeNode match = findNodeByName(tvTextureSets.Nodes, selectname); if (match != null) { IFilledTextureSet set = (match.Tag as IFilledTextureSet); + foreach (ImageData img in set.Textures) { if (img.LongName == longname) { selectedset = match; @@ -142,20 +143,22 @@ namespace CodeImp.DoomBuilder.Windows if (selectedset != null) {//mxd tvTextureSets.SelectedNode = selectedset; - FillImagesList(); + //FillImagesList(); } // Texture to select when list is filled - selecttextureonfill = selecttexture; + //selecttextureonfill = selecttexture; // Make groups - usedgroup = browser.AddGroup("Used Textures"); - availgroup = browser.AddGroup("Available Textures"); - + //usedgroup = browser.AddGroup("Used Textures"); + //availgroup = browser.AddGroup("Available Textures"); + // Keep last position and size lastposition = this.Location; lastsize = this.Size; - + + this.SuspendLayout(); + // Position window from configuration settings this.Size = new Size(General.Settings.ReadSetting("browserwindow.sizewidth", this.Size.Width), General.Settings.ReadSetting("browserwindow.sizeheight", this.Size.Height)); @@ -184,6 +187,7 @@ namespace CodeImp.DoomBuilder.Windows //then - in current node IFilledTextureSet set = (node.Tag as IFilledTextureSet); + foreach (ImageData img in set.Textures) { if (img.LongName == longname) return node; @@ -453,7 +457,10 @@ namespace CodeImp.DoomBuilder.Windows private void TextureBrowserForm_Shown(object sender, EventArgs e) { - // Select texture + if (selectedset != null) //mxd. Calling FillImagesList() from constructor leads to TERRIBLE load times. Why? I have no sodding idea... + FillImagesList(); + + // Select texture if(!string.IsNullOrEmpty(selecttextureonfill)) { browser.SelectItem(selecttextureonfill, usedgroup); diff --git a/Source/Core/Windows/TextureBrowserForm.resx b/Source/Core/Windows/TextureBrowserForm.resx index 4af846d8..803f7c60 100644 --- a/Source/Core/Windows/TextureBrowserForm.resx +++ b/Source/Core/Windows/TextureBrowserForm.resx @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAc - DwAAAk1TRnQBSQFMAgEBBwEAAVQBAAFUAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DwAAAk1TRnQBSQFMAgEBBwEAAWQBAAFkAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASwDAAEBAQABCAYAAQsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA