Texture Browser: textures can now be filtered by size.

Visual mode: offsets of double-sided middle textures were still clamped when not required in some cases.
Updated documentation.
This commit is contained in:
MaxED 2013-09-26 12:43:39 +00:00
parent 5c1fb38454
commit ec9d829916
11 changed files with 412 additions and 335 deletions

View file

@ -723,10 +723,16 @@
<td>Raises the targeted or selected floors/ceilings to match the height of adjacent sector. Hold Ctrl to raise to highest surface in selection. Also aligns selected things to ceiling.</td>
</tr>
<tr>
<td><a name="resetoffsets" id="resetoffsets"></a>Reset Texture Offsets</td>
<td><a name="resetoffsets" id="resetoffsets"></a>Reset Local Texture Offsets (UDMF)</td>
<td><div align="center">Ctrl-Shift+R</div></td>
<td><div align="center"></div></td>
<td>Resets upper/middle/lower texture offsets on the targeted or selected sidedef to 0, 0. Also resets sidedef's scale and floor/ceiling's scale and rotation.</td>
</tr>
<tr>
<td>Reset Texture Offsets</td>
<td><div align="center">Shift+R</div></td>
<td><div align="center"></div></td>
<td>Resets the texture offsets on the targeted or selected sidedef to 0, 0. Also resets sidedef's scale and floor/ceiling's scale and rotation in UDMF map format.</td>
<td>Resets the texture offsets on the targeted or selected sidedef to 0, 0.</td>
</tr>
<tr>
<td><a name="rotater" id="rotater"></a>Rotate Clockwise</td>

View file

@ -16,7 +16,7 @@
<table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td valign="top">The Image browser can display the directory structure of a Folder, PK3 and PK7 resource, allowing you to group and find textures easier.<br />
If the current game configuration supports mixed textures and flats, you can filter textures by image type using this drop down:<br />
You can filter textures by texture size. If the current game configuration supports mixed textures and flats, you can filter textures by image type using this drop down:<br />
<img src="texture_types.jpg" alt=""/><br />
<br />
<strong>Technical notice:</strong><br />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -80,7 +80,7 @@
<li>You can use <a href="all_modes/colorpicker.html">Color Picker plugin </a> to edit dynamic light properties and sector's fog and tint colors in Classic and Visual modes.</li>
<li>You can use <a href="all_modes/tagexplorer.html">Tag Explorer plugin</a> to view all tags and actions used in current map.</li>
<li><span class="style1"><strong>[new]</strong></span> You can apply <a href="all_modes/jitter.html">jitter transform</a> to any map element.</li>
<li>Image browser shows directory structure of Folder, PK3 and PK7 resources and can filter images by texture type. <a href="all_modes/texture_browser.html">More info</a>.</li>
<li>Image browser shows directory structure of Folder, PK3 and PK7 resources and can filter images by texture type and size. <a href="all_modes/texture_browser.html">More info</a>.</li>
<li><span class="style1"><strong>[new]</strong></span> Most controls of Edit Sector/Linedef/Thing forms now work in realtime (e.g. you can immediately see texture offset/scale/rotation changes while you are changing appropriate values). Action and Tag changes are still applied only after you press &quot;OK&quot; button.</li>
<li><span class="style1"><strong>[new]</strong></span><strong> [UDMF] </strong>All UDMF properties (except &quot;comment&quot;) can be edited using Edit Sector/Linedef/Thing/Vertex forms user interface.</li>
<li>Thing Edit Form has &quot;Random angle&quot; checkbox.</li>
@ -220,7 +220,7 @@
<li>Selected things can be deleted using &quot;<strong>Delete Item</strong>&quot; action (default key is Delete).</li>
<li>Selected things can be cut/copied/pasted at cursor position.</li>
<li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> Floor/ceiling texture rotation is now taken into account when moving texture offsets with arrow keys.</li>
<li><span class="style3">[changed]</span> <strong>[UDMF]</strong> &quot;<strong><a href="../actions.html#resetoffsets">Reset Texture Offsets</a></strong>&quot; action also resets texture scale and rotation.</li>
<li><span class="style1"><strong>[new] </strong></span><strong>[UDMF] </strong>New action: &quot;<strong><a href="../actions.html#resetoffsets">Reset Local Texture Offsets (UDMF)</a></strong>&quot;. It will reset upper/middle/lower texture offsets, texture scale and rotation.</li>
<li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> &quot;<strong><a href="../actions.html#resetoffsets">Reset Texture Offsets</a></strong>&quot; action works on floors and ceilings.</li>
</ul>
</li>

View file

@ -33,6 +33,8 @@ namespace CodeImp.DoomBuilder.Controls
this.labelMixMode = new System.Windows.Forms.Label();
this.label = new System.Windows.Forms.Label();
this.splitter = new System.Windows.Forms.SplitContainer();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cbMixMode = new System.Windows.Forms.ComboBox();
this.texturesize = new System.Windows.Forms.Label();
this.texturesizelabel = new System.Windows.Forms.Label();
@ -40,6 +42,8 @@ namespace CodeImp.DoomBuilder.Controls
this.refreshtimer = new System.Windows.Forms.Timer(this.components);
this.texturesizetimer = new System.Windows.Forms.Timer(this.components);
this.list = new CodeImp.DoomBuilder.Controls.OptimizedListView();
this.filterHeight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.filterWidth = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.splitter.Panel1.SuspendLayout();
this.splitter.Panel2.SuspendLayout();
this.splitter.SuspendLayout();
@ -48,7 +52,7 @@ namespace CodeImp.DoomBuilder.Controls
// labelMixMode
//
this.labelMixMode.AutoSize = true;
this.labelMixMode.Location = new System.Drawing.Point(3, 11);
this.labelMixMode.Location = new System.Drawing.Point(3, 9);
this.labelMixMode.Name = "labelMixMode";
this.labelMixMode.Size = new System.Drawing.Size(39, 14);
this.labelMixMode.TabIndex = 3;
@ -57,7 +61,7 @@ namespace CodeImp.DoomBuilder.Controls
// label
//
this.label.AutoSize = true;
this.label.Location = new System.Drawing.Point(156, 11);
this.label.Location = new System.Drawing.Point(154, 9);
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(33, 14);
this.label.TabIndex = 0;
@ -78,17 +82,39 @@ namespace CodeImp.DoomBuilder.Controls
//
// splitter.Panel2
//
this.splitter.Panel2.Controls.Add(this.label2);
this.splitter.Panel2.Controls.Add(this.filterHeight);
this.splitter.Panel2.Controls.Add(this.label1);
this.splitter.Panel2.Controls.Add(this.filterWidth);
this.splitter.Panel2.Controls.Add(this.cbMixMode);
this.splitter.Panel2.Controls.Add(this.labelMixMode);
this.splitter.Panel2.Controls.Add(this.texturesize);
this.splitter.Panel2.Controls.Add(this.texturesizelabel);
this.splitter.Panel2.Controls.Add(this.objectname);
this.splitter.Panel2.Controls.Add(this.label);
this.splitter.Size = new System.Drawing.Size(518, 346);
this.splitter.Size = new System.Drawing.Size(639, 346);
this.splitter.SplitterDistance = 312;
this.splitter.TabIndex = 0;
this.splitter.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(356, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(17, 14);
this.label2.TabIndex = 8;
this.label2.Text = "H:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(276, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(20, 14);
this.label1.TabIndex = 6;
this.label1.Text = "W:";
//
// cbMixMode
//
this.cbMixMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -97,7 +123,7 @@ namespace CodeImp.DoomBuilder.Controls
"All",
"Textures",
"Flats"});
this.cbMixMode.Location = new System.Drawing.Point(48, 7);
this.cbMixMode.Location = new System.Drawing.Point(48, 5);
this.cbMixMode.Margin = new System.Windows.Forms.Padding(3, 3, 6, 3);
this.cbMixMode.Name = "cbMixMode";
this.cbMixMode.Size = new System.Drawing.Size(90, 22);
@ -107,9 +133,9 @@ namespace CodeImp.DoomBuilder.Controls
//
// texturesize
//
this.texturesize.Location = new System.Drawing.Point(368, 11);
this.texturesize.Location = new System.Drawing.Point(480, 9);
this.texturesize.Name = "texturesize";
this.texturesize.Size = new System.Drawing.Size(271, 14);
this.texturesize.Size = new System.Drawing.Size(100, 14);
this.texturesize.TabIndex = 2;
this.texturesize.Text = "1024 x 1024";
this.texturesize.Visible = false;
@ -117,7 +143,7 @@ namespace CodeImp.DoomBuilder.Controls
// texturesizelabel
//
this.texturesizelabel.AutoSize = true;
this.texturesizelabel.Location = new System.Drawing.Point(331, 11);
this.texturesizelabel.Location = new System.Drawing.Point(443, 9);
this.texturesizelabel.Name = "texturesizelabel";
this.texturesizelabel.Size = new System.Drawing.Size(31, 14);
this.texturesizelabel.TabIndex = 1;
@ -127,10 +153,10 @@ namespace CodeImp.DoomBuilder.Controls
// objectname
//
this.objectname.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.objectname.Location = new System.Drawing.Point(192, 8);
this.objectname.Location = new System.Drawing.Point(190, 6);
this.objectname.Margin = new System.Windows.Forms.Padding(3, 3, 6, 3);
this.objectname.Name = "objectname";
this.objectname.Size = new System.Drawing.Size(122, 20);
this.objectname.Size = new System.Drawing.Size(69, 20);
this.objectname.TabIndex = 0;
this.objectname.TabStop = false;
this.objectname.TextChanged += new System.EventHandler(this.objectname_TextChanged);
@ -154,7 +180,7 @@ namespace CodeImp.DoomBuilder.Controls
this.list.MultiSelect = false;
this.list.Name = "list";
this.list.OwnerDraw = true;
this.list.Size = new System.Drawing.Size(518, 312);
this.list.Size = new System.Drawing.Size(639, 312);
this.list.TabIndex = 1;
this.list.TabStop = false;
this.list.TileSize = new System.Drawing.Size(90, 90);
@ -165,6 +191,34 @@ namespace CodeImp.DoomBuilder.Controls
this.list.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.list_ItemSelectionChanged);
this.list.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown);
//
// filterHeight
//
this.filterHeight.AllowDecimal = false;
this.filterHeight.AllowNegative = false;
this.filterHeight.AllowRelative = false;
this.filterHeight.ButtonStep = 1;
this.filterHeight.ButtonStepFloat = 1F;
this.filterHeight.Location = new System.Drawing.Point(375, 4);
this.filterHeight.Name = "filterHeight";
this.filterHeight.Size = new System.Drawing.Size(54, 24);
this.filterHeight.StepValues = null;
this.filterHeight.TabIndex = 7;
this.filterHeight.WhenTextChanged += new System.EventHandler(this.filterSize_WhenTextChanged);
//
// filterWidth
//
this.filterWidth.AllowDecimal = false;
this.filterWidth.AllowNegative = false;
this.filterWidth.AllowRelative = false;
this.filterWidth.ButtonStep = 1;
this.filterWidth.ButtonStepFloat = 1F;
this.filterWidth.Location = new System.Drawing.Point(298, 4);
this.filterWidth.Name = "filterWidth";
this.filterWidth.Size = new System.Drawing.Size(54, 24);
this.filterWidth.StepValues = null;
this.filterWidth.TabIndex = 5;
this.filterWidth.WhenTextChanged += new System.EventHandler(this.filterSize_WhenTextChanged);
//
// ImageBrowserControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -172,7 +226,7 @@ namespace CodeImp.DoomBuilder.Controls
this.Controls.Add(this.splitter);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "ImageBrowserControl";
this.Size = new System.Drawing.Size(518, 346);
this.Size = new System.Drawing.Size(639, 346);
this.Resize += new System.EventHandler(this.ImageBrowserControl_Resize);
this.splitter.Panel1.ResumeLayout(false);
this.splitter.Panel2.ResumeLayout(false);
@ -194,6 +248,10 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.ComboBox cbMixMode;
private System.Windows.Forms.Label label;
private System.Windows.Forms.Label labelMixMode;
private ButtonsNumericTextbox filterWidth;
private System.Windows.Forms.Label label2;
private ButtonsNumericTextbox filterHeight;
private System.Windows.Forms.Label label1;
}
}

View file

@ -79,6 +79,11 @@ namespace CodeImp.DoomBuilder.Controls
// Initialize
InitializeComponent();
items = new List<ImageBrowserItem>();
//mxd.
StepsList sizes = new StepsList { 4, 8, 16, 32, 48, 64, 96, 128, 196, 256, 512, 1024 };
filterWidth.StepValues = sizes;
filterHeight.StepValues = sizes;
}
// This applies the application settings
@ -192,6 +197,11 @@ namespace CodeImp.DoomBuilder.Controls
}
}
//mxd
private void filterSize_WhenTextChanged(object sender, EventArgs e) {
objectname_TextChanged(sender, e);
}
// Key pressed in list
private void list_KeyDown(object sender, KeyEventArgs e)
{
@ -459,11 +469,15 @@ namespace CodeImp.DoomBuilder.Controls
// Group property of items will be set to null, we will restore it later
list.Items.Clear();
//mxd. Filtering by texture size?
int w = filterWidth.GetResult(-1);
int h = filterHeight.GetResult(-1);
// Go for all items
foreach(ImageBrowserItem i in items)
{
// Add item if valid
if(ValidateItem(i))
if(ValidateItem(i) && ValidateItemSize(i, w, h))
{
i.Group = i.ListGroup;
i.Selected = false;
@ -516,6 +530,14 @@ namespace CodeImp.DoomBuilder.Controls
return i.Text.Contains(objectname.Text);
}
//mxd. This validates an item's texture size
private bool ValidateItemSize(ImageBrowserItem i, int w, int h) {
if (!i.icon.IsPreviewLoaded) return true;
if (w > 0 && i.icon.Width != w) return false;
if (h > 0 && i.icon.Height != h) return false;
return true;
}
// This sends the focus to the textbox
public void FocusTextbox()
{

View file

@ -129,7 +129,4 @@
<metadata name="texturesizetimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>215, 17</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View file

@ -153,12 +153,17 @@ namespace CodeImp.DoomBuilder.VisualModes
protected void SetVertices(ICollection<WorldVertex> verts)
{
// Copy vertices
if (verts != null) { //mxd
vertices = new WorldVertex[verts.Count];
verts.CopyTo(vertices, 0);
triangles = vertices.Length / 3;
//mxd
CalculateNormals();
} else {
vertices = new WorldVertex[1];
triangles = 0;
}
if(sector != null) sector.NeedsUpdateGeo = true;
}

View file

@ -41,9 +41,9 @@ namespace CodeImp.DoomBuilder.Windows
//
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(781, 596);
this.cancel.Location = new System.Drawing.Point(783, 597);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(100, 25);
this.cancel.Size = new System.Drawing.Size(98, 25);
this.cancel.TabIndex = 3;
this.cancel.TabStop = false;
this.cancel.Text = "Cancel";
@ -53,9 +53,9 @@ namespace CodeImp.DoomBuilder.Windows
// apply
//
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.apply.Location = new System.Drawing.Point(675, 596);
this.apply.Location = new System.Drawing.Point(681, 597);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(100, 25);
this.apply.Size = new System.Drawing.Size(98, 25);
this.apply.TabIndex = 2;
this.apply.TabStop = false;
this.apply.Text = "OK";
@ -77,11 +77,11 @@ namespace CodeImp.DoomBuilder.Windows
// tvTextureSets
//
this.tvTextureSets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
| System.Windows.Forms.AnchorStyles.Right)));
this.tvTextureSets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tvTextureSets.ImageIndex = 0;
this.tvTextureSets.ImageList = this.smallimages;
this.tvTextureSets.Location = new System.Drawing.Point(12, 9);
this.tvTextureSets.Location = new System.Drawing.Point(681, 12);
this.tvTextureSets.Name = "tvTextureSets";
this.tvTextureSets.SelectedImageIndex = 0;
this.tvTextureSets.Size = new System.Drawing.Size(200, 576);
@ -96,7 +96,7 @@ namespace CodeImp.DoomBuilder.Windows
| System.Windows.Forms.AnchorStyles.Right)));
this.browser.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.browser.HideInputBox = false;
this.browser.Location = new System.Drawing.Point(218, 9);
this.browser.Location = new System.Drawing.Point(12, 12);
this.browser.Name = "browser";
this.browser.PreventSelection = false;
this.browser.Size = new System.Drawing.Size(663, 610);
@ -111,7 +111,7 @@ namespace CodeImp.DoomBuilder.Windows
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(893, 631);
this.ClientSize = new System.Drawing.Size(893, 628);
this.Controls.Add(this.tvTextureSets);
this.Controls.Add(this.cancel);
this.Controls.Add(this.apply);

View file

@ -117,12 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="cancel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="apply.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="smallimages.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
@ -131,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAc
DwAAAk1TRnQBSQFMAgEBBwEAAYQBAAGEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DwAAAk1TRnQBSQFMAgEBBwEAAcwBAAHMAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASwDAAEBAQABCAYAAQsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -198,12 +192,6 @@
AfABAAHAAQABwAEHAYED/wHwAQABwAEHBP8B8AEAHP8L
</value>
</data>
<metadata name="tvTextureSets.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="browser.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View file

@ -229,6 +229,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
base.SetVertices(null); //mxd
return false;
}
@ -286,7 +287,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, getRoundedTextureOffset(oldx, xy.X, scalex, Texture != null ? Texture.Width : -1)); //mxd
//mxd. Don't clamp offsetY of clipped mid textures
bool dontClamp = (Texture == null || Sidedef.IsFlagSet("clipmidtex") || Sidedef.Line.IsFlagSet("clipmidtex"));
bool dontClamp = (Texture == null || (!Sidedef.IsFlagSet("wrapmidtex") && !Sidedef.Line.IsFlagSet("wrapmidtex")));
Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, getRoundedTextureOffset(oldy, xy.Y, scaley, dontClamp ? -1 : Texture.Height));
}