Preferences: removed "Square Things" setting. Square things are now the only option.

Changed, Things mode: things are now rendered with a bit of transparency, so things beneath other things are now visible.
Fixed, Things mode: in some cases it was impossible to highlight a thing beneath other thing when their positions were the same.
Changed, 2D modes: changed thing bounding box and arrow image.
Fixed, cosmetic, 2D modes: in some cases thing arrows were rendered bigger than thing bounding boxes.
This commit is contained in:
MaxED 2015-08-03 22:02:39 +00:00
parent 39beaf2cdb
commit ce7510c153
38 changed files with 99 additions and 170 deletions

View file

@ -663,13 +663,12 @@
</EmbeddedResource>
<EmbeddedResource Include="Resources\Actions.cfg" />
<EmbeddedResource Include="Resources\display2d.fx" />
<EmbeddedResource Include="Resources\Thing2D_1.png" />
<EmbeddedResource Include="Resources\Thing2D.png" />
<EmbeddedResource Include="Resources\things2d.fx" />
<EmbeddedResource Include="Resources\world3d.fx" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\MissingTexture3D.png" />
<EmbeddedResource Include="Resources\Thing2D_0.png" />
</ItemGroup>
<ItemGroup>
<None Include="app.manifest" />
@ -1126,7 +1125,6 @@
<None Include="Resources\Monster2.png" />
<None Include="Resources\Prefab2.png" />
<None Include="Resources\Prefab.png" />
<EmbeddedResource Include="Resources\ThingBox.png" />
<EmbeddedResource Include="Resources\Nothing.png" />
<EmbeddedResource Include="Resources\UnknownThing.png" />
<Compile Include="IO\DirectoryFileEntry.cs" />

View file

@ -53,7 +53,6 @@ namespace CodeImp.DoomBuilder.Config
private byte doublesidedalphabyte;
private float backgroundalpha;
private bool qualitydisplay;
private bool squarethings;
private bool testmonsters;
private int defaultviewmode;
private bool classicbilinear;
@ -141,7 +140,6 @@ namespace CodeImp.DoomBuilder.Config
public float VisualMouseSensX { get { return visualmousesensx; } internal set { visualmousesensx = value; } }
public float VisualMouseSensY { get { return visualmousesensy; } internal set { visualmousesensy = value; } }
public bool QualityDisplay { get { return qualitydisplay; } internal set { qualitydisplay = value; } }
public bool SquareThings { get { return squarethings; } internal set { squarethings = value; } }
public bool TestMonsters { get { return testmonsters; } internal set { testmonsters = value; } }
public int DefaultViewMode { get { return defaultviewmode; } internal set { defaultviewmode = value; } }
public bool ClassicBilinear { get { return classicbilinear; } internal set { classicbilinear = value; } }
@ -252,7 +250,6 @@ namespace CodeImp.DoomBuilder.Config
doublesidedalphabyte = (byte)(doublesidedalpha * 255f);
backgroundalpha = cfg.ReadSetting("backgroundalpha", 1.0f);
qualitydisplay = cfg.ReadSetting("qualitydisplay", true);
squarethings = cfg.ReadSetting("squarethings", false);
testmonsters = cfg.ReadSetting("testmonsters", true);
defaultviewmode = cfg.ReadSetting("defaultviewmode", (int)ViewMode.Normal);
classicbilinear = cfg.ReadSetting("classicbilinear", false);
@ -343,7 +340,6 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("visualmousesensy", visualmousesensy);
cfg.WriteSetting("imagebrightness", imagebrightness);
cfg.WriteSetting("qualitydisplay", qualitydisplay);
cfg.WriteSetting("squarethings", squarethings);
cfg.WriteSetting("testmonsters", testmonsters);
cfg.WriteSetting("doublesidedalpha", doublesidedalpha);
cfg.WriteSetting("backgroundalpha", backgroundalpha);

View file

@ -2745,7 +2745,8 @@ namespace CodeImp.DoomBuilder.Map
RectangleF range = RectangleF.FromLTRB(pos.x - maxrange, pos.y - maxrange, pos.x + maxrange, pos.y + maxrange);
Thing closest = null;
float distance = float.MaxValue;
float d, px, py;
float size = float.MaxValue; //mxd
float d, px, py, s;
// Go for all things in selection
foreach(Thing t in selection)
@ -2756,13 +2757,15 @@ namespace CodeImp.DoomBuilder.Map
//mxd. Within range?
if(px < range.Left - t.Size || px > range.Right + t.Size || py < range.Top - t.Size || py > range.Bottom + t.Size) continue;
// Close than previous find?
// Closer than previous find? mxd. Or smaller when distance is the same?
d = Math.Abs(px - pos.x) + Math.Abs(py - pos.y);
if(d < distance)
s = ((t.FixedSize && General.Map.Renderer2D.Scale > 1.0f) ? t.Size / General.Map.Renderer2D.Scale : t.Size); //mxd
if(d < distance || (d == distance && s < size))
{
// This one is closer
closest = t;
distance = d;
size = s; //mxd
}
}

View file

@ -67,6 +67,7 @@ namespace CodeImp.DoomBuilder.Map
private float pitchrad; //mxd
private float rollrad; //mxd
private bool isModel; //mxd
private bool highlighted; //mxd
// Configuration
private float size;
@ -102,6 +103,7 @@ namespace CodeImp.DoomBuilder.Map
public Sector Sector { get { return sector; } }
public bool IsModel { get { return isModel; } } //mxd
public bool IsDirectional { get { return directional; } } //mxd
public bool Highlighted { get { return highlighted; } set { highlighted = value; } } //mxd
#endregion

View file

@ -30,6 +30,7 @@ namespace CodeImp.DoomBuilder.Rendering
// Constants for static instances
public const float THINGS_BACK_ALPHA = 0.3f;
public const float THINGS_HIDDEN_ALPHA = 0.66f;
public const float THINGS_ALPHA = 0.8f; //mxd
// Static instances
private static Presentation standard;

View file

@ -45,8 +45,8 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Constants
private const float FSAA_FACTOR = 0.6f;
private const float THING_ARROW_SIZE = 1.5f;
private const float THING_ARROW_SHRINK = 2f;
private const float THING_ARROW_SIZE = 1.4f;
//private const float THING_ARROW_SHRINK = 2f;
//private const float THING_CIRCLE_SIZE = 1f;
private const float THING_SPRITE_SHRINK = 2f;
private const int THING_BUFFER_SIZE = 100;
@ -57,7 +57,6 @@ namespace CodeImp.DoomBuilder.Rendering
private const int FONT_WIDTH = 0;
private const int FONT_HEIGHT = 0;
private const int NUM_THING_TEXTURES = 2;
internal const int NUM_VIEW_MODES = 4;
#endregion
@ -103,7 +102,7 @@ namespace CodeImp.DoomBuilder.Rendering
private SurfaceManager surfaces;
// Images
private ResourceImage[] thingtexture;
private ResourceImage thingtexture;
// View settings (world coordinates)
private ViewMode viewmode;
@ -146,15 +145,10 @@ namespace CodeImp.DoomBuilder.Rendering
// Constructor
internal Renderer2D(D3DDevice graphics) : base(graphics)
{
// Load thing textures
thingtexture = new ResourceImage[NUM_THING_TEXTURES];
for(int i = 0; i < NUM_THING_TEXTURES; i++)
{
thingtexture[i] = new ResourceImage("CodeImp.DoomBuilder.Resources.Thing2D_" + i.ToString(CultureInfo.InvariantCulture) + ".png");
thingtexture[i].UseColorCorrection = false;
thingtexture[i].LoadImage();
thingtexture[i].CreateTexture();
}
//mxd. Load thing texture
thingtexture = new ResourceImage("CodeImp.DoomBuilder.Resources.Thing2D.png") { UseColorCorrection = false };
thingtexture.LoadImage();
thingtexture.CreateTexture();
// Create surface manager
surfaces = new SurfaceManager();
@ -174,7 +168,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
// Destroy rendertargets
DestroyRendertargets();
foreach(ResourceImage i in thingtexture) i.Dispose();
thingtexture.Dispose(); //mxd
// Dispose surface manager
surfaces.Dispose();
@ -996,7 +990,7 @@ namespace CodeImp.DoomBuilder.Rendering
private void CreateThingArrowVerts(Thing t, ref FlatVertex[] verts, Vector2D screenpos, int offset)
{
// Determine size
float arrowsize = (t.FixedSize && (scale > 1.0f) ? (t.Size - THING_ARROW_SHRINK) * THING_ARROW_SIZE : (t.Size - THING_ARROW_SHRINK) * scale * THING_ARROW_SIZE);
float arrowsize = (t.FixedSize && (scale > 1.0f) ? t.Size : t.Size * scale) * THING_ARROW_SIZE; //mxd
// Setup rotated rect for arrow
float sinarrowsize = (float)Math.Sin(t.Angle + Angle2D.PI * 0.25f) * arrowsize;
@ -1005,20 +999,20 @@ namespace CodeImp.DoomBuilder.Rendering
verts[offset].x = screenpos.x + sinarrowsize;
verts[offset].y = screenpos.y + cosarrowsize;
verts[offset].c = -1;
verts[offset].u = 0.51f;
verts[offset].v = 0.01f;
verts[offset].u = 0.501f;
verts[offset].v = 0.001f;
offset++;
verts[offset].x = screenpos.x - cosarrowsize;
verts[offset].y = screenpos.y + sinarrowsize;
verts[offset].c = -1;
verts[offset].u = 0.99f;
verts[offset].v = 0.01f;
verts[offset].u = 0.999f;
verts[offset].v = 0.001f;
offset++;
verts[offset].x = screenpos.x + cosarrowsize;
verts[offset].y = screenpos.y - sinarrowsize;
verts[offset].c = -1;
verts[offset].u = 0.51f;
verts[offset].v = 0.99f;
verts[offset].u = 0.501f;
verts[offset].v = 0.999f;
offset++;
verts[offset] = verts[offset - 2];
offset++;
@ -1027,8 +1021,8 @@ namespace CodeImp.DoomBuilder.Rendering
verts[offset].x = screenpos.x - sinarrowsize;
verts[offset].y = screenpos.y - cosarrowsize;
verts[offset].c = -1;
verts[offset].u = 0.99f;
verts[offset].v = 0.99f;
verts[offset].u = 0.999f;
verts[offset].v = 0.999f;
}
//mxd
@ -1067,13 +1061,12 @@ namespace CodeImp.DoomBuilder.Rendering
// This draws a set of things
private void RenderThingsBatch(ICollection<Thing> things, float alpha, bool fixedcolor, PixelColor c)
{
int thingtextureindex = 0;
PixelColor tc;
DataStream stream;
// Anything to render?
if(things.Count > 0)
{
PixelColor tc;
DataStream stream;
// Make alpha color
Color4 alphacolor = new Color4(alpha, 1.0f, 1.0f, 1.0f);
@ -1088,10 +1081,9 @@ namespace CodeImp.DoomBuilder.Rendering
graphics.Device.SetRenderState(RenderState.TextureFactor, alphacolor.ToArgb());
graphics.Device.SetStreamSource(0, thingsvertices, 0, FlatVertex.Stride);
// Determine things texture to use
if(General.Settings.SquareThings) thingtextureindex = 1;
graphics.Device.SetTexture(0, thingtexture[thingtextureindex].Texture);
graphics.Shaders.Things2D.Texture1 = thingtexture[thingtextureindex].Texture;
// Set things texture
graphics.Device.SetTexture(0, thingtexture.Texture);
graphics.Shaders.Things2D.Texture1 = thingtexture.Texture;
SetWorldTransformation(false);
graphics.Shaders.Things2D.SetSettings(alpha);
@ -1113,6 +1105,9 @@ namespace CodeImp.DoomBuilder.Rendering
int totalcount = 0;
foreach(Thing t in things)
{
//mxd. Highlighted thing should be rendered separately
if(!fixedcolor && t.Highlighted) continue;
//collect models
if (t.IsModel)
{
@ -1167,7 +1162,6 @@ namespace CodeImp.DoomBuilder.Rendering
//mxd. Render sprites
int selectionColor = General.Colors.Selection.ToInt();
graphics.Shaders.Things2D.BeginPass(1);
float spriteShrink = General.Settings.SquareThings ? THING_SPRITE_SHRINK : THING_SPRITE_SHRINK * 2;
foreach(KeyValuePair<int, List<Thing>> group in thingsByType)
{
@ -1202,17 +1196,17 @@ namespace CodeImp.DoomBuilder.Rendering
if(sprite.Width > sprite.Height)
{
spriteWidth = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteWidth = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale;
spriteHeight = spriteWidth * ((float)sprite.Height / sprite.Width);
}
else if(sprite.Width < sprite.Height)
{
spriteHeight = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteHeight = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale;
spriteWidth = spriteHeight * ((float)sprite.Width / sprite.Height);
}
else
{
spriteWidth = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteWidth = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale;
spriteHeight = spriteWidth;
}
@ -1260,8 +1254,8 @@ namespace CodeImp.DoomBuilder.Rendering
graphics.Shaders.Things2D.EndPass();
//mxd. Render thing arrows
graphics.Device.SetTexture(0, thingtexture[thingtextureindex].Texture);
graphics.Shaders.Things2D.Texture1 = thingtexture[thingtextureindex].Texture;
graphics.Device.SetTexture(0, thingtexture.Texture);
graphics.Shaders.Things2D.Texture1 = thingtexture.Texture;
graphics.Shaders.Things2D.BeginPass(0);
// Determine next lock size

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

View file

@ -79,7 +79,6 @@ namespace CodeImp.DoomBuilder.Windows
this.colorhighlight = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorlinedefs = new CodeImp.DoomBuilder.Controls.ColorControl();
this.cbStretchView = new System.Windows.Forms.CheckBox();
this.squarethings = new System.Windows.Forms.CheckBox();
this.qualitydisplay = new System.Windows.Forms.CheckBox();
this.cancel = new System.Windows.Forms.Button();
this.apply = new System.Windows.Forms.Button();
@ -751,16 +750,6 @@ namespace CodeImp.DoomBuilder.Windows
"g\r\nvertical scale of the world geometry and \r\nsprites by 15%.\r\n");
this.cbStretchView.UseVisualStyleBackColor = true;
//
// squarethings
//
this.squarethings.AutoSize = true;
this.squarethings.Location = new System.Drawing.Point(25, 170);
this.squarethings.Name = "squarethings";
this.squarethings.Size = new System.Drawing.Size(91, 17);
this.squarethings.TabIndex = 8;
this.squarethings.Text = "Square things";
this.squarethings.UseVisualStyleBackColor = true;
//
// qualitydisplay
//
this.qualitydisplay.AutoSize = true;
@ -1432,7 +1421,6 @@ namespace CodeImp.DoomBuilder.Windows
this.appearancegroup1.Controls.Add(label21);
this.appearancegroup1.Controls.Add(this.labelDynLightIntensity);
this.appearancegroup1.Controls.Add(this.cbStretchView);
this.appearancegroup1.Controls.Add(this.squarethings);
this.appearancegroup1.Controls.Add(this.tbDynLightIntensity);
this.appearancegroup1.Controls.Add(label20);
this.appearancegroup1.Controls.Add(this.qualitydisplay);
@ -1458,7 +1446,7 @@ namespace CodeImp.DoomBuilder.Windows
// capitalizetexturenames
//
this.capitalizetexturenames.AutoSize = true;
this.capitalizetexturenames.Location = new System.Drawing.Point(236, 212);
this.capitalizetexturenames.Location = new System.Drawing.Point(236, 191);
this.capitalizetexturenames.Name = "capitalizetexturenames";
this.capitalizetexturenames.Size = new System.Drawing.Size(140, 17);
this.capitalizetexturenames.TabIndex = 36;
@ -1482,7 +1470,7 @@ namespace CodeImp.DoomBuilder.Windows
// cbOldHighlightMode
//
this.cbOldHighlightMode.AutoSize = true;
this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 254);
this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 233);
this.cbOldHighlightMode.Name = "cbOldHighlightMode";
this.cbOldHighlightMode.Size = new System.Drawing.Size(207, 17);
this.cbOldHighlightMode.TabIndex = 33;
@ -1560,7 +1548,7 @@ namespace CodeImp.DoomBuilder.Windows
// animatevisualselection
//
this.animatevisualselection.AutoSize = true;
this.animatevisualselection.Location = new System.Drawing.Point(236, 233);
this.animatevisualselection.Location = new System.Drawing.Point(236, 212);
this.animatevisualselection.Name = "animatevisualselection";
this.animatevisualselection.Size = new System.Drawing.Size(184, 17);
this.animatevisualselection.TabIndex = 23;
@ -1570,7 +1558,7 @@ namespace CodeImp.DoomBuilder.Windows
// blackbrowsers
//
this.blackbrowsers.AutoSize = true;
this.blackbrowsers.Location = new System.Drawing.Point(236, 191);
this.blackbrowsers.Location = new System.Drawing.Point(25, 170);
this.blackbrowsers.Name = "blackbrowsers";
this.blackbrowsers.Size = new System.Drawing.Size(195, 17);
this.blackbrowsers.TabIndex = 4;
@ -2025,7 +2013,6 @@ namespace CodeImp.DoomBuilder.Windows
private Dotnetrix.Controls.TrackBar previewsize;
private System.Windows.Forms.Label previewsizelabel;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.CheckBox squarethings;
private Dotnetrix.Controls.TrackBar autoscrollspeed;
private System.Windows.Forms.Label autoscrollspeedlabel;
private System.Windows.Forms.Label label15;

View file

@ -63,7 +63,6 @@ namespace CodeImp.DoomBuilder.Windows
// Interface
imagebrightness.Value = General.Settings.ImageBrightness;
squarethings.Checked = General.Settings.SquareThings;
doublesidedalpha.Value = General.Clamp((int)((1.0f - General.Settings.DoubleSidedAlpha) * 10.0f), doublesidedalpha.Minimum, doublesidedalpha.Maximum);
defaultviewmode.SelectedIndex = General.Settings.DefaultViewMode;
fieldofview.Value = General.Clamp(General.Settings.VisualFOV / 10, fieldofview.Minimum, fieldofview.Maximum);
@ -232,7 +231,6 @@ namespace CodeImp.DoomBuilder.Windows
// Apply interface
General.Settings.ImageBrightness = imagebrightness.Value;
General.Settings.SquareThings = squarethings.Checked;
General.Settings.DoubleSidedAlpha = 1.0f - (doublesidedalpha.Value * 0.1f);
General.Settings.DefaultViewMode = defaultviewmode.SelectedIndex;
General.Settings.VisualFOV = fieldofview.Value * 10;

View file

@ -374,7 +374,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
// Render things
if (renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -248,7 +248,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -127,7 +127,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Start rendering things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}
}
@ -159,8 +159,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(unselectedthings, 1.0f);
renderer.RenderThingSet(selectedthings, 1.0f);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}
}
@ -171,8 +171,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(unselectedthings, 1.0f);
renderer.RenderThingSet(selectedthings, 1.0f);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -312,13 +312,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Render things
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(unselectedthings, 1.0f);
renderer.RenderThingSet(selectedthings, 1.0f);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
// Draw the dragged item highlighted
// This is important to know, because this item is used
// for snapping to the grid and snapping to nearest items
renderer.RenderThing(dragitem, General.Colors.Highlight, 1.0f);
renderer.RenderThing(dragitem, General.Colors.Highlight, Presentation.THINGS_ALPHA);
// Done
renderer.Finish();

View file

@ -115,7 +115,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}
}
@ -147,8 +147,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(unselectedthings, 1.0f);
renderer.RenderThingSet(selectedthings, 1.0f);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -560,7 +560,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -343,7 +343,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if(renderer.StartThings(false))
{
renderer.RenderThing((highlighted as Thing), renderer.DetermineThingColor((highlighted as Thing)), 1.0f);
renderer.RenderThing((highlighted as Thing), renderer.DetermineThingColor((highlighted as Thing)), Presentation.THINGS_ALPHA);
renderer.Finish();
}
}
@ -367,7 +367,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if(renderer.StartThings(false))
{
renderer.RenderThing((highlighted as Thing), General.Colors.Highlight, 1.0f);
renderer.RenderThing((highlighted as Thing), General.Colors.Highlight, Presentation.THINGS_ALPHA);
renderer.Finish();
}
}
@ -1561,8 +1561,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
if(highlighted is Thing) renderer.RenderThing((highlighted as Thing), General.Colors.Highlight, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
if(highlighted is Thing) renderer.RenderThing((highlighted as Thing), General.Colors.Highlight, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -136,7 +136,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
foreach(ErrorResult result in selection) result.RenderThingsSelection(renderer); //mxd
renderer.Finish();
}

View file

@ -139,7 +139,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
if(BuilderPlug.Me.FindReplaceForm.Finder != null)
BuilderPlug.Me.FindReplaceForm.Finder.RenderThingsSelection(renderer, selection);
renderer.Finish();

View file

@ -876,7 +876,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -407,7 +407,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -357,7 +357,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -752,7 +752,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -148,6 +148,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
highlighted.Selected = true;
}
}
}
else if(highlighted != null) //mxd
{
highlighted.Highlighted = false;
}
// Hide highlight info and tooltip
@ -177,12 +181,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
for(int i = 0; i < Thing.NUM_ARGS; i++) BuilderPlug.RenderAssociations(renderer, association[i], eventlines);
if((highlighted != null) && !highlighted.IsDisposed)
{
renderer.RenderThing(highlighted, General.Colors.Highlight, 1.0f);
renderer.RenderThing(highlighted, General.Colors.Highlight, Presentation.THINGS_ALPHA);
BuilderPlug.RenderReverseAssociations(renderer, highlightasso, eventlines); //mxd
}
@ -222,15 +226,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This highlights a new item
protected void Highlight(Thing t)
{
bool completeredraw = false;
LinedefActionInfo action = null;
// Often we can get away by simply undrawing the previous
// highlight and drawing the new highlight. But if associations
// are or were drawn we need to redraw the entire display.
// Previous association highlights something?
if((highlighted != null) && (highlighted.Tag != 0)) completeredraw = true;
// Set highlight association
if(t != null && t.Tag != 0)
@ -238,11 +234,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
else
highlightasso.Set(new Vector2D(), 0, 0);
// New association highlights something?
if((t != null) && (t.Tag != 0)) completeredraw = true;
if(highlighted != null) highlighted.Highlighted = false; //mxd
if(t != null)
{
t.Highlighted = true; //mxd
// Check if we can find the linedefs action
if((t.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(t.Action))
action = General.Map.Config.LinedefActions[t.Action];
@ -251,63 +248,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Determine linedef associations
for(int i = 0; i < Thing.NUM_ARGS; i++)
{
// Previous association highlights something?
if((association[i].Type == UniversalType.SectorTag) ||
(association[i].Type == UniversalType.LinedefTag) ||
(association[i].Type == UniversalType.ThingTag)) completeredraw = true;
// Make new association
if(action != null)
association[i].Set(t.Position, t.Args[i], action.Args[i].Type);
else
association[i].Set(new Vector2D(), 0, 0);
// New association highlights something?
if((association[i].Type == UniversalType.SectorTag) ||
(association[i].Type == UniversalType.LinedefTag) ||
(association[i].Type == UniversalType.ThingTag)) completeredraw = true;
}
// If we're changing associations, then we
// need to redraw the entire display
if(completeredraw)
{
// Set new highlight and redraw completely
highlighted = t;
General.Interface.RedrawDisplay();
}
else
{
// Update display
if(renderer.StartThings(false))
{
// Undraw previous highlight
Thing possiblecommentthing = t ?? highlighted; //mxd
if((highlighted != null) && !highlighted.IsDisposed)
renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), 1.0f);
// Set new highlight
highlighted = t;
// Render highlighted item
if((highlighted != null) && !highlighted.IsDisposed)
renderer.RenderThing(highlighted, General.Colors.Highlight, 1.0f);
// Done with highlight
renderer.Finish();
//mxd. Update comment highlight?
if(General.Map.UDMF && General.Settings.RenderComments
&& possiblecommentthing != null && !possiblecommentthing.IsDisposed
&& renderer.StartOverlay(false))
{
RenderComment(possiblecommentthing);
renderer.Finish();
}
renderer.Present();
}
}
// Set new highlight and redraw display
highlighted = t;
General.Interface.RedrawDisplay();
// Show highlight info
if((highlighted != null) && !highlighted.IsDisposed)
@ -339,7 +289,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(false))
{
// Redraw highlight to show selection
renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), 1.0f);
renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), Presentation.THINGS_ALPHA);
renderer.Finish();
renderer.Present();
}
@ -364,7 +314,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(false))
{
// Render highlighted item
renderer.RenderThing(highlighted, General.Colors.Highlight, 1.0f);
renderer.RenderThing(highlighted, General.Colors.Highlight, Presentation.THINGS_ALPHA);
renderer.Finish();
renderer.Present();
}
@ -407,7 +357,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(false))
{
// Redraw highlight to show selection
renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), 1.0f);
renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), Presentation.THINGS_ALPHA);
renderer.Finish();
renderer.Present();
}

View file

@ -155,7 +155,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer)
{
renderer.RenderThing(thing, General.Colors.Selection, 0.8f);
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// mxd. More rencering

View file

@ -84,8 +84,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer)
{
renderer.RenderThing(thing1, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing2, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing1, General.Colors.Selection, Presentation.THINGS_ALPHA);
renderer.RenderThing(thing2, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// This removes the first thing

View file

@ -73,7 +73,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer)
{
renderer.RenderThing(thing, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// This removes the thing

View file

@ -57,7 +57,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer)
{
renderer.RenderThing(thing, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// This removes the thing

View file

@ -59,7 +59,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer)
{
renderer.RenderThing(thing, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// This removes the thing

View file

@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public override void RenderThingsSelection(IRenderer2D renderer, FindReplaceObject[] selection)
{
foreach(FindReplaceObject o in selection)
renderer.RenderThing(o.Thing, General.Colors.Selection, 1.0f);
renderer.RenderThing(o.Thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
// Edit objects

View file

@ -568,7 +568,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Thing t in General.Map.Map.Things)
{
if(!asso.Tags.Contains(t.Tag)) continue;
renderer.RenderThing(t, General.Colors.Indication, 1.0f);
renderer.RenderThing(t, General.Colors.Indication, Presentation.THINGS_ALPHA);
if(General.Settings.GZShowEventLines) eventlines.Add(new Line3D(asso.Center, t.Position)); //mxd
}
break;
@ -646,7 +646,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
((action.Args[3].Type == (int)asso.Type) && (asso.Tags.Contains(t.Args[3]))) ||
((action.Args[4].Type == (int)asso.Type) && (asso.Tags.Contains(t.Args[4]))))
{
renderer.RenderThing(t, General.Colors.Indication, 1.0f);
renderer.RenderThing(t, General.Colors.Indication, Presentation.THINGS_ALPHA);
if(General.Settings.GZShowEventLines) eventlines.Add(new Line3D(t.Position, asso.Center)); //mxd
}
}

View file

@ -312,12 +312,12 @@ namespace CodeImp.DoomBuilder.SoundPropagationMode
{
foreach (SoundEnvironment se in BuilderPlug.Me.SoundEnvironments)
{
if (se.Things.Count > 0) renderer.RenderThingSet(se.Things, 1.0f);
if(se.Things.Count > 0) renderer.RenderThingSet(se.Things, Presentation.THINGS_ALPHA);
}
}
//mxd. Render highlighted thing
if(highlightedthing != null) renderer.RenderThing(highlightedthing, General.Colors.Selection, 1.0f);
if(highlightedthing != null) renderer.RenderThing(highlightedthing, General.Colors.Selection, Presentation.THINGS_ALPHA);
renderer.Finish();
}

View file

@ -280,7 +280,7 @@ namespace CodeImp.DoomBuilder.SoundPropagationMode
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_HIDDEN_ALPHA);
foreach (Thing thing in huntingThings)
{
renderer.RenderThing(thing, General.Colors.Selection, 1.0f);
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}
renderer.Finish();

View file

@ -1416,7 +1416,7 @@ namespace CodeImp.DoomBuilder.StairSectorBuilderMode
// Render things
if (renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.RenderThingSet(General.Map.Map.Things, Presentation.THINGS_ALPHA);
renderer.Finish();
}