mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Fixed, Visual mode: GLDEFS glow color was incorrectly interpolated on sidedefs.
Fixed, Visual mode: in some cases GLDEFS glow effect was not updated after changing floor/ceiling texture. Fixed, Draw Rectangle and Draw Ellipse modes: in some cases pressing "Reset" button did not update the shape preview. Fixed, DB2 bug: sector geometry was not updated after undoing "Flip Sidedefs" action.
This commit is contained in:
parent
a6b70e54a0
commit
f048600bbf
9 changed files with 63 additions and 53 deletions
|
@ -1116,8 +1116,12 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
Sidedef sd = (sindex >= 0) ? General.Map.Map.GetSidedefByIndex(sindex) : null;
|
||||
l.AttachFront(sd);
|
||||
l.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null) sd.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null)
|
||||
{
|
||||
sd.Marked = true;
|
||||
if(sd.Sector != null) sd.Sector.UpdateNeeded = true; //mxd. Sector needs to be updated as well...
|
||||
}
|
||||
geometrychanged = true;
|
||||
}
|
||||
|
||||
|
@ -1141,8 +1145,12 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
Sidedef sd = (sindex >= 0) ? General.Map.Map.GetSidedefByIndex(sindex) : null;
|
||||
l.AttachBack(sd);
|
||||
l.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null) sd.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null)
|
||||
{
|
||||
sd.Marked = true;
|
||||
if(sd.Sector != null) sd.Sector.UpdateNeeded = true; //mxd. Sector needs to be updated as well...
|
||||
}
|
||||
geometrychanged = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2236,7 +2236,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
/// <summary>Flips sector linedefs so they all face either inward or outward.</summary>
|
||||
public static void FlipSectorLinedefs(ICollection<Sector> sectors, bool selectedlinesonly)
|
||||
{
|
||||
Dictionary<Linedef, bool> processed = new Dictionary<Linedef, bool>();
|
||||
HashSet<Linedef> processed = new HashSet<Linedef>();
|
||||
|
||||
foreach(Sector s in sectors)
|
||||
{
|
||||
|
@ -2248,7 +2248,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
//sort lines
|
||||
foreach(Sidedef side in s.Sidedefs)
|
||||
{
|
||||
if(processed.ContainsKey(side.Line)) continue;
|
||||
if(processed.Contains(side.Line)) continue;
|
||||
if(selectedlinesonly && !side.Line.Selected)
|
||||
{
|
||||
if(side == side.Line.Front) unselectedfrontlines++;
|
||||
|
@ -2261,7 +2261,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
else
|
||||
backlines.Add(side.Line);
|
||||
|
||||
processed.Add(side.Line, false);
|
||||
processed.Add(side.Line);
|
||||
}
|
||||
|
||||
//flip lines
|
||||
|
|
|
@ -168,8 +168,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
device.SetRenderState(RenderState.NormalizeNormals, false);
|
||||
device.SetRenderState(RenderState.PointSpriteEnable, false);
|
||||
device.SetRenderState(RenderState.RangeFogEnable, false);
|
||||
device.SetRenderState(RenderState.ShadeMode, ShadeMode.Flat); //mxd
|
||||
device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
|
||||
device.SetRenderState(RenderState.ShadeMode, ShadeMode.Gouraud);
|
||||
device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
|
||||
device.SetRenderState(RenderState.SpecularEnable, false);
|
||||
device.SetRenderState(RenderState.StencilEnable, false);
|
||||
device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
|
|
|
@ -60,11 +60,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
private void reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Reset values
|
||||
blockevents = true;
|
||||
spikiness.Value = 0;
|
||||
angle.Value = 0;
|
||||
blockevents = false;
|
||||
subdivs.Value = 6;
|
||||
blockevents = false;
|
||||
|
||||
// Dispatch event
|
||||
OnValueChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void continuousdrawing_CheckedChanged(object sender, EventArgs e)
|
||||
|
|
|
@ -54,10 +54,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
private void reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Reset values
|
||||
blockevents = true;
|
||||
radius.Value = 0;
|
||||
blockevents = false;
|
||||
subdivs.Value = 0;
|
||||
blockevents = false;
|
||||
|
||||
// Dispatch event
|
||||
OnValueChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void continuousdrawing_CheckedChanged(object sender, EventArgs e)
|
||||
|
|
|
@ -263,9 +263,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
this.autodrawonedit.AutoSize = true;
|
||||
this.autodrawonedit.Location = new System.Drawing.Point(13, 24);
|
||||
this.autodrawonedit.Name = "autodrawonedit";
|
||||
this.autodrawonedit.Size = new System.Drawing.Size(346, 17);
|
||||
this.autodrawonedit.Size = new System.Drawing.Size(353, 30);
|
||||
this.autodrawonedit.TabIndex = 11;
|
||||
this.autodrawonedit.Text = "Start drawing when Edit pressed over empty space in Classic modes";
|
||||
this.autodrawonedit.Text = "Start drawing when Edit pressed over empty space in Classic modes\r\nInsert new thi" +
|
||||
"ng when Edit pressed over empty space in Things mode";
|
||||
this.autodrawonedit.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// syncSelection
|
||||
|
@ -331,7 +332,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// editnewthing
|
||||
//
|
||||
this.editnewthing.AutoSize = true;
|
||||
this.editnewthing.Location = new System.Drawing.Point(13, 49);
|
||||
this.editnewthing.Location = new System.Drawing.Point(13, 62);
|
||||
this.editnewthing.Name = "editnewthing";
|
||||
this.editnewthing.Size = new System.Drawing.Size(248, 17);
|
||||
this.editnewthing.TabIndex = 1;
|
||||
|
@ -341,7 +342,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// editnewsector
|
||||
//
|
||||
this.editnewsector.AutoSize = true;
|
||||
this.editnewsector.Location = new System.Drawing.Point(13, 74);
|
||||
this.editnewsector.Location = new System.Drawing.Point(13, 87);
|
||||
this.editnewsector.Name = "editnewsector";
|
||||
this.editnewsector.Size = new System.Drawing.Size(258, 17);
|
||||
this.editnewsector.TabIndex = 2;
|
||||
|
@ -351,7 +352,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// additiveselect
|
||||
//
|
||||
this.additiveselect.AutoSize = true;
|
||||
this.additiveselect.Location = new System.Drawing.Point(13, 99);
|
||||
this.additiveselect.Location = new System.Drawing.Point(13, 112);
|
||||
this.additiveselect.Name = "additiveselect";
|
||||
this.additiveselect.Size = new System.Drawing.Size(205, 17);
|
||||
this.additiveselect.TabIndex = 3;
|
||||
|
|
|
@ -3030,7 +3030,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.SetCrosshairBusy(true);
|
||||
General.Interface.RedrawDisplay();
|
||||
GetTargetEventReceiver(false).OnSelectTexture();
|
||||
UpdateChangedObjects();
|
||||
RebuildElementData(); //mxd. Extrafloors or Glow effects may've been changed
|
||||
renderer.SetCrosshairBusy(false);
|
||||
PostAction();
|
||||
|
|
|
@ -369,27 +369,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
if(BuilderPlug.Me.CopiedFlat != null)
|
||||
{
|
||||
mode.CreateUndo("Paste ceiling '" + BuilderPlug.Me.CopiedFlat + "'");
|
||||
mode.SetActionResult("Pasted flat '" + BuilderPlug.Me.CopiedFlat + "' on ceiling.");
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
bool prevtextureglows = General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongCeilTexture);
|
||||
mode.CreateUndo("Paste ceiling \"" + BuilderPlug.Me.CopiedFlat + "\"");
|
||||
mode.SetActionResult("Pasted flat \"" + BuilderPlug.Me.CopiedFlat + "\" on ceiling.");
|
||||
|
||||
SetTexture(BuilderPlug.Me.CopiedFlat);
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
if(prevtextureglows && !General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongCeilTexture))
|
||||
{
|
||||
SectorData sd = mode.GetSectorData(level.sector);
|
||||
sd.UpdateForced();
|
||||
|
||||
if(mode.VisualSectorExists(level.sector))
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
|
||||
vs.UpdateSectorGeometry(false);
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. 3D floors may need updating...
|
||||
OnTextureChanged();
|
||||
}
|
||||
|
@ -591,7 +575,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This changes the texture
|
||||
protected override void SetTexture(string texturename)
|
||||
{
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
bool prevtextureglows = General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongCeilTexture);
|
||||
|
||||
// Set new texture
|
||||
level.sector.SetCeilTexture(texturename);
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
if(prevtextureglows
|
||||
&& !General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongCeilTexture)
|
||||
&& mode.VisualSectorExists(level.sector))
|
||||
{
|
||||
((BaseVisualSector)mode.GetVisualSector(level.sector)).Changed = true;
|
||||
}
|
||||
|
||||
General.Map.Data.UpdateUsedTextures();
|
||||
}
|
||||
|
||||
|
|
|
@ -368,27 +368,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
if(BuilderPlug.Me.CopiedFlat != null)
|
||||
{
|
||||
mode.CreateUndo("Paste floor '" + BuilderPlug.Me.CopiedFlat + "'");
|
||||
mode.SetActionResult("Pasted flat '" + BuilderPlug.Me.CopiedFlat + "' on floor.");
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
bool prevtextureglows = General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongFloorTexture);
|
||||
mode.CreateUndo("Paste floor \"" + BuilderPlug.Me.CopiedFlat + "\"");
|
||||
mode.SetActionResult("Pasted flat \"" + BuilderPlug.Me.CopiedFlat + "\" on floor.");
|
||||
|
||||
SetTexture(BuilderPlug.Me.CopiedFlat);
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
if(prevtextureglows && !General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongFloorTexture))
|
||||
{
|
||||
SectorData sd = mode.GetSectorData(level.sector);
|
||||
sd.UpdateForced();
|
||||
|
||||
if(mode.VisualSectorExists(level.sector))
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
|
||||
vs.UpdateSectorGeometry(false);
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. 3D floors may need updating...
|
||||
OnTextureChanged();
|
||||
}
|
||||
|
@ -562,7 +546,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This changes the texture
|
||||
protected override void SetTexture(string texturename)
|
||||
{
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
bool prevtextureglows = General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongFloorTexture);
|
||||
|
||||
// Set new texture
|
||||
level.sector.SetFloorTexture(texturename);
|
||||
|
||||
//mxd. Glow effect may require SectorData and geometry update
|
||||
if(prevtextureglows
|
||||
&& !General.Map.Data.GlowingFlats.ContainsKey(Sector.Sector.LongFloorTexture)
|
||||
&& mode.VisualSectorExists(level.sector))
|
||||
{
|
||||
((BaseVisualSector)mode.GetVisualSector(level.sector)).Changed = true;
|
||||
}
|
||||
|
||||
General.Map.Data.UpdateUsedTextures();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue