mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 07:05:48 +00:00
Add a little Ctrl-G popup on the texture viewer to jump to a pixel
This commit is contained in:
@@ -97,4 +97,5 @@ This page is a random hodge-podge of different tips and tricks that might not be
|
||||
D3DSetBlobPart(strippedBlob->GetBufferPointer(), strippedBlob->GetBufferSize(), D3D_BLOB_PRIVATE_DATA, 0, &path, pathSize, &annotatedBlob);
|
||||
// use annotatedBlob instead of strippedBlob from here on
|
||||
|
||||
#. You can hit :kbd:`Ctrl-G` to open a popup that lets you jump to a particular co-ordinate.
|
||||
#. More coming soon hopefully :).
|
||||
|
||||
@@ -238,6 +238,21 @@ This button opens the texture in the :doc:`raw buffer viewer <buffer_viewer>`. T
|
||||
|
||||
The buffer viewer may not be able to handle the full number of columns that are appropriate for the full width of a texture, so it is better to limit the number of columns and manually calculate the offset into the table of data.
|
||||
|
||||
Goto Location
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
.. |find| image:: ../imgs/icons/find.png
|
||||
|
||||
..
|
||||
|
||||
| |find| Goto pixel location
|
||||
|
||||
This button opens a small popup above the main texture view that lets you type in a pixel location to jump to. This is useful if you're investigating a particular issue where you know what pixel the problem will lie on.
|
||||
|
||||
.. note::
|
||||
|
||||
This popup is also available with the keyboard shortcut :kbd:`Ctrl-G`.
|
||||
|
||||
Zoom Controls
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
namespace renderdocui.Windows.Dialogs
|
||||
{
|
||||
partial class TextureGoto
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
System.Windows.Forms.Label label1;
|
||||
this.chooseX = new System.Windows.Forms.NumericUpDown();
|
||||
this.chooseY = new System.Windows.Forms.NumericUpDown();
|
||||
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chooseX)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chooseY)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
tableLayoutPanel1.AutoSize = true;
|
||||
tableLayoutPanel1.ColumnCount = 2;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel1.Controls.Add(this.chooseX, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(this.chooseY, 1, 1);
|
||||
tableLayoutPanel1.Controls.Add(label1, 0, 0);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(4, 4);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 2;
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(137, 39);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
label1.AutoSize = true;
|
||||
tableLayoutPanel1.SetColumnSpan(label1, 2);
|
||||
label1.Location = new System.Drawing.Point(3, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(131, 13);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Goto Location";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
|
||||
//
|
||||
// chooseX
|
||||
//
|
||||
this.chooseX.Location = new System.Drawing.Point(3, 16);
|
||||
this.chooseX.Maximum = new decimal(new int[] {
|
||||
16384,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.chooseX.Name = "chooseX";
|
||||
this.chooseX.Size = new System.Drawing.Size(62, 20);
|
||||
this.chooseX.TabIndex = 1;
|
||||
this.chooseX.Value = new decimal(new int[] {
|
||||
16384,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.chooseX.Enter += new System.EventHandler(this.location_Enter);
|
||||
this.chooseX.KeyDown += new System.Windows.Forms.KeyEventHandler(this.location_KeyDown);
|
||||
//
|
||||
// chooseY
|
||||
//
|
||||
this.chooseY.Location = new System.Drawing.Point(71, 16);
|
||||
this.chooseY.Maximum = new decimal(new int[] {
|
||||
16384,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.chooseY.Name = "chooseY";
|
||||
this.chooseY.Size = new System.Drawing.Size(63, 20);
|
||||
this.chooseY.TabIndex = 2;
|
||||
this.chooseY.Value = new decimal(new int[] {
|
||||
16384,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.chooseY.Enter += new System.EventHandler(this.location_Enter);
|
||||
this.chooseY.KeyDown += new System.Windows.Forms.KeyEventHandler(this.location_KeyDown);
|
||||
//
|
||||
// TextureGoto
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.ClientSize = new System.Drawing.Size(145, 47);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TextureGoto";
|
||||
this.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.TopMost = true;
|
||||
this.Deactivate += new System.EventHandler(this.TextureGoto_Deactivate);
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chooseX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chooseY)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.NumericUpDown chooseX;
|
||||
private System.Windows.Forms.NumericUpDown chooseY;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace renderdocui.Windows.Dialogs
|
||||
{
|
||||
public partial class TextureGoto : Form
|
||||
{
|
||||
public delegate void OnFinishedMethod(int x, int y);
|
||||
|
||||
private OnFinishedMethod m_FinishedCallback;
|
||||
|
||||
public TextureGoto(OnFinishedMethod callback)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
m_FinishedCallback = callback;
|
||||
}
|
||||
|
||||
public int X
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return (int)chooseX.Value;
|
||||
}
|
||||
catch (System.ArgumentOutOfRangeException)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
chooseX.Value = (decimal)value;
|
||||
}
|
||||
catch (System.ArgumentOutOfRangeException)
|
||||
{
|
||||
chooseX.Value = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Y
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return (int)chooseY.Value;
|
||||
}
|
||||
catch (System.ArgumentOutOfRangeException)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
chooseY.Value = (decimal)value;
|
||||
}
|
||||
catch (System.ArgumentOutOfRangeException)
|
||||
{
|
||||
chooseY.Value = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Show(Control parent, Point p)
|
||||
{
|
||||
X = p.X;
|
||||
Y = p.Y;
|
||||
|
||||
Location = new Point(
|
||||
parent.PointToScreen(parent.Location).X + parent.ClientRectangle.Width / 2 - ClientRectangle.Width / 2,
|
||||
parent.PointToScreen(parent.Location).Y + parent.ClientRectangle.Height / 2 - ClientRectangle.Height / 2
|
||||
);
|
||||
|
||||
Show();
|
||||
|
||||
chooseY.Select();
|
||||
chooseX.Select();
|
||||
}
|
||||
|
||||
private void location_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
m_FinishedCallback(X, Y);
|
||||
Hide();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void TextureGoto_Deactivate(object sender, EventArgs e)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void location_Enter(object sender, EventArgs e)
|
||||
{
|
||||
NumericUpDown up = sender as NumericUpDown;
|
||||
if (up != null)
|
||||
{
|
||||
up.Select(0, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="tableLayoutPanel1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+27
-14
@@ -55,6 +55,8 @@
|
||||
this.showEmpty = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.usedSep = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.openNewTab = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.imageInLayoutMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.usedStartLabel = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.colorDialog = new System.Windows.Forms.ColorDialog();
|
||||
this.toolstripMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
@@ -149,8 +151,7 @@
|
||||
this.pixelContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.highlightedPixelHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.highlightedPixelDebugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.imageInLayoutMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.gotoLocationButton = new System.Windows.Forms.ToolStripButton();
|
||||
subSep = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
|
||||
toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
|
||||
@@ -220,7 +221,7 @@
|
||||
this.usedStartLabel});
|
||||
this.rightclickMenu.MaximumSize = new System.Drawing.Size(0, 480);
|
||||
this.rightclickMenu.Name = "rightclickMenu";
|
||||
this.rightclickMenu.Size = new System.Drawing.Size(181, 148);
|
||||
this.rightclickMenu.Size = new System.Drawing.Size(181, 126);
|
||||
//
|
||||
// showDisabled
|
||||
//
|
||||
@@ -249,6 +250,17 @@
|
||||
this.openNewTab.Text = "Open new Locked Tab";
|
||||
this.openNewTab.Click += new System.EventHandler(this.resourceContextItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
|
||||
//
|
||||
// imageInLayoutMenuItem
|
||||
//
|
||||
this.imageInLayoutMenuItem.Name = "imageInLayoutMenuItem";
|
||||
this.imageInLayoutMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.imageInLayoutMenuItem.Text = "Image in layout <X>";
|
||||
//
|
||||
// usedStartLabel
|
||||
//
|
||||
this.usedStartLabel.Name = "usedStartLabel";
|
||||
@@ -994,11 +1006,12 @@
|
||||
toolStripLabel1,
|
||||
this.saveTex,
|
||||
this.texListShow,
|
||||
this.viewTexBuffer});
|
||||
this.viewTexBuffer,
|
||||
this.gotoLocationButton});
|
||||
this.actionsStrip.Location = new System.Drawing.Point(0, 25);
|
||||
this.actionsStrip.Margin = new System.Windows.Forms.Padding(0, 0, 12, 0);
|
||||
this.actionsStrip.Name = "actionsStrip";
|
||||
this.actionsStrip.Size = new System.Drawing.Size(114, 25);
|
||||
this.actionsStrip.Size = new System.Drawing.Size(168, 25);
|
||||
this.actionsStrip.TabIndex = 8;
|
||||
this.actionsStrip.Text = "toolStrip1";
|
||||
//
|
||||
@@ -1332,16 +1345,15 @@
|
||||
this.highlightedPixelDebugToolStripMenuItem.Text = "Highlighted Pixel &Debug";
|
||||
this.highlightedPixelDebugToolStripMenuItem.Click += new System.EventHandler(this.debugPixel_Click);
|
||||
//
|
||||
// imageInLayoutMenuItem
|
||||
// gotoLocationButton
|
||||
//
|
||||
this.imageInLayoutMenuItem.Name = "imageInLayoutMenuItem";
|
||||
this.imageInLayoutMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.imageInLayoutMenuItem.Text = "Image in layout <X>";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
|
||||
this.gotoLocationButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.gotoLocationButton.Image = global::renderdocui.Properties.Resources.find;
|
||||
this.gotoLocationButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.gotoLocationButton.Name = "gotoLocationButton";
|
||||
this.gotoLocationButton.Size = new System.Drawing.Size(23, 22);
|
||||
this.gotoLocationButton.Text = "Goto";
|
||||
this.gotoLocationButton.Click += new System.EventHandler(this.gotoLocationButton_Click);
|
||||
//
|
||||
// TextureViewer
|
||||
//
|
||||
@@ -1507,6 +1519,7 @@
|
||||
private System.Windows.Forms.ToolStripButton zoomExactSize;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem imageInLayoutMenuItem;
|
||||
private System.Windows.Forms.ToolStripButton gotoLocationButton;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,8 @@ namespace renderdocui.Windows
|
||||
|
||||
private ReplayOutput m_Output = null;
|
||||
|
||||
private Dialogs.TextureGoto m_Goto = null;
|
||||
|
||||
private TextureDisplay m_TexDisplay = new TextureDisplay();
|
||||
|
||||
private ToolStripControlHost depthStencilToolstrip = null;
|
||||
@@ -368,6 +370,8 @@ namespace renderdocui.Windows
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
m_Goto = new Dialogs.TextureGoto(GotoLocation);
|
||||
|
||||
textureList.Font =
|
||||
texturefilter.Font =
|
||||
rangeBlack.Font =
|
||||
@@ -403,7 +407,7 @@ namespace renderdocui.Windows
|
||||
render.Painting = true;
|
||||
pixelContext.Painting = true;
|
||||
|
||||
saveTex.Enabled = false;
|
||||
saveTex.Enabled = gotoLocationButton.Enabled = viewTexBuffer.Enabled = false;
|
||||
|
||||
DockHandler.GetPersistStringCallback = PersistString;
|
||||
|
||||
@@ -666,6 +670,30 @@ namespace renderdocui.Windows
|
||||
|
||||
private Dictionary<ResourceId, DockContent> lockedTabs = new Dictionary<ResourceId, DockContent>();
|
||||
|
||||
public void GotoLocation(int x, int y)
|
||||
{
|
||||
if(!m_Core.LogLoaded || CurrentTexture == null)
|
||||
return;
|
||||
|
||||
m_PickedPoint = new Point(x, y);
|
||||
|
||||
uint mipHeight = Math.Max(1, CurrentTexture.height >> (int)m_TexDisplay.mip);
|
||||
if (m_Core.APIProps.pipelineType == APIPipelineStateType.OpenGL)
|
||||
m_PickedPoint.Y = (int)(mipHeight - 1) - m_PickedPoint.Y;
|
||||
if (m_TexDisplay.FlipY)
|
||||
m_PickedPoint.Y = (int)(mipHeight - 1) - m_PickedPoint.Y;
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
|
||||
{
|
||||
if (m_Output != null)
|
||||
RT_PickPixelsAndUpdate(m_PickedPoint.X, m_PickedPoint.Y, true);
|
||||
|
||||
RT_UpdateAndDisplay(r);
|
||||
});
|
||||
|
||||
UI_UpdateStatusText();
|
||||
}
|
||||
|
||||
public void ViewTexture(ResourceId ID, bool focus)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
@@ -997,7 +1025,7 @@ namespace renderdocui.Windows
|
||||
var outConfig = new OutputConfig();
|
||||
outConfig.m_Type = OutputType.TexDisplay;
|
||||
|
||||
saveTex.Enabled = true;
|
||||
saveTex.Enabled = gotoLocationButton.Enabled = viewTexBuffer.Enabled = true;
|
||||
|
||||
m_Following = Following.Default;
|
||||
|
||||
@@ -1061,7 +1089,7 @@ namespace renderdocui.Windows
|
||||
m_PrevSize = PointF.Empty;
|
||||
m_HighWaterStatusLength = 0;
|
||||
|
||||
saveTex.Enabled = false;
|
||||
saveTex.Enabled = gotoLocationButton.Enabled = viewTexBuffer.Enabled = false;
|
||||
|
||||
rwPanel.ClearThumbnails();
|
||||
roPanel.ClearThumbnails();
|
||||
@@ -2616,6 +2644,23 @@ namespace renderdocui.Windows
|
||||
this.BeginInvoke(new Action(UI_UpdateStatusText));
|
||||
}
|
||||
|
||||
private void ShowGotoPopup()
|
||||
{
|
||||
if (CurrentTexture != null)
|
||||
{
|
||||
Point p = m_PickedPoint;
|
||||
|
||||
uint mipHeight = Math.Max(1, CurrentTexture.height >> (int)m_TexDisplay.mip);
|
||||
|
||||
if (m_Core.APIProps.pipelineType == APIPipelineStateType.OpenGL)
|
||||
p.Y = (int)(mipHeight - 1) - p.Y;
|
||||
if (m_TexDisplay.FlipY)
|
||||
p.Y = (int)(mipHeight - 1) - p.Y;
|
||||
|
||||
m_Goto.Show(render, p);
|
||||
}
|
||||
}
|
||||
|
||||
private void render_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
bool nudged = false;
|
||||
@@ -2645,6 +2690,12 @@ namespace renderdocui.Windows
|
||||
|
||||
if (!m_Core.LogLoaded) return;
|
||||
|
||||
if (e.KeyCode == Keys.G && e.Control)
|
||||
{
|
||||
ShowGotoPopup();
|
||||
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.Up && m_PickedPoint.Y > 0)
|
||||
{
|
||||
m_PickedPoint = new Point(m_PickedPoint.X, m_PickedPoint.Y - 1);
|
||||
@@ -3563,6 +3614,11 @@ namespace renderdocui.Windows
|
||||
ViewTexture(e.ID, false);
|
||||
}
|
||||
|
||||
private void gotoLocationButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowGotoPopup();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Thumbnail strip
|
||||
|
||||
@@ -259,6 +259,12 @@
|
||||
<Compile Include="Windows\Dialogs\SettingsDialog.Designer.cs">
|
||||
<DependentUpon>SettingsDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Dialogs\TextureGoto.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Dialogs\TextureGoto.Designer.cs">
|
||||
<DependentUpon>TextureGoto.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Dialogs\TextureSaveDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -412,6 +418,9 @@
|
||||
<EmbeddedResource Include="Windows\Dialogs\SettingsDialog.resx">
|
||||
<DependentUpon>SettingsDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\Dialogs\TextureGoto.resx">
|
||||
<DependentUpon>TextureGoto.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\Dialogs\TextureSaveDialog.resx">
|
||||
<DependentUpon>TextureSaveDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Reference in New Issue
Block a user