2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using CodeImp.DoomBuilder.IO;
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
2013-09-05 13:03:17 +00:00
|
|
|
using CodeImp.DoomBuilder.Data;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Map
|
|
|
|
{
|
|
|
|
public sealed class Sidedef : MapElement
|
|
|
|
{
|
|
|
|
#region ================== Variables
|
|
|
|
|
|
|
|
// Map
|
|
|
|
private MapSet map;
|
|
|
|
|
|
|
|
// List items
|
|
|
|
private LinkedListNode<Sidedef> sectorlistitem;
|
|
|
|
|
|
|
|
// Owner
|
|
|
|
private Linedef linedef;
|
|
|
|
|
|
|
|
// Sector
|
|
|
|
private Sector sector;
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
private int offsetx;
|
|
|
|
private int offsety;
|
|
|
|
private string texnamehigh;
|
|
|
|
private string texnamemid;
|
|
|
|
private string texnamelow;
|
|
|
|
private long longtexnamehigh;
|
|
|
|
private long longtexnamemid;
|
|
|
|
private long longtexnamelow;
|
|
|
|
|
2013-07-19 15:30:58 +00:00
|
|
|
//mxd. UDMF properties
|
|
|
|
private Dictionary<string, bool> flags;
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Clone
|
|
|
|
private int serializedindex;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Properties
|
|
|
|
|
|
|
|
public MapSet Map { get { return map; } }
|
2014-09-16 20:26:42 +00:00
|
|
|
public bool IsFront { get { return (linedef != null) && (this == linedef.Front); } }
|
2009-04-19 18:07:22 +00:00
|
|
|
public Linedef Line { get { return linedef; } }
|
2014-09-16 20:26:42 +00:00
|
|
|
public Sidedef Other { get { return (this == linedef.Front ? linedef.Back : linedef.Front); } }
|
2009-04-19 18:07:22 +00:00
|
|
|
public Sector Sector { get { return sector; } }
|
2013-07-19 15:30:58 +00:00
|
|
|
internal Dictionary<string, bool> Flags { get { return flags; } } //mxd
|
2014-09-16 20:26:42 +00:00
|
|
|
public float Angle { get { return (IsFront ? linedef.Angle : Angle2D.Normalized(linedef.Angle + Angle2D.PI)); } }
|
2009-06-11 21:21:20 +00:00
|
|
|
public int OffsetX { get { return offsetx; } set { BeforePropsChange(); offsetx = value; } }
|
|
|
|
public int OffsetY { get { return offsety; } set { BeforePropsChange(); offsety = value; } }
|
2009-04-19 18:07:22 +00:00
|
|
|
public string HighTexture { get { return texnamehigh; } }
|
|
|
|
public string MiddleTexture { get { return texnamemid; } }
|
|
|
|
public string LowTexture { get { return texnamelow; } }
|
|
|
|
public long LongHighTexture { get { return longtexnamehigh; } }
|
|
|
|
public long LongMiddleTexture { get { return longtexnamemid; } }
|
|
|
|
public long LongLowTexture { get { return longtexnamelow; } }
|
|
|
|
internal int SerializedIndex { get { return serializedindex; } set { serializedindex = value; } }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
|
|
|
|
// Constructor
|
2009-06-05 19:03:56 +00:00
|
|
|
internal Sidedef(MapSet map, int listindex, Linedef l, bool front, Sector s)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
// Initialize
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
this.elementtype = MapElementType.SIDEDEF; //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
this.map = map;
|
2009-06-05 19:03:56 +00:00
|
|
|
this.listindex = listindex;
|
2009-04-19 18:07:22 +00:00
|
|
|
this.texnamehigh = "-";
|
|
|
|
this.texnamemid = "-";
|
|
|
|
this.texnamelow = "-";
|
|
|
|
this.longtexnamehigh = MapSet.EmptyLongName;
|
|
|
|
this.longtexnamemid = MapSet.EmptyLongName;
|
|
|
|
this.longtexnamelow = MapSet.EmptyLongName;
|
2014-02-26 14:11:06 +00:00
|
|
|
this.flags = new Dictionary<string, bool>(StringComparer.Ordinal); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// Attach linedef
|
2009-04-19 18:07:22 +00:00
|
|
|
this.linedef = l;
|
2009-06-11 21:21:20 +00:00
|
|
|
if(l != null)
|
|
|
|
{
|
|
|
|
if(front)
|
|
|
|
l.AttachFrontP(this);
|
|
|
|
else
|
|
|
|
l.AttachBackP(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Attach sector
|
|
|
|
SetSectorP(s);
|
|
|
|
|
|
|
|
if(map == General.Map.Map)
|
|
|
|
General.Map.UndoRedo.RecAddSidedef(this);
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// We have no destructor
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Disposer
|
|
|
|
public override void Dispose()
|
|
|
|
{
|
|
|
|
// Not already disposed?
|
|
|
|
if(!isdisposed)
|
|
|
|
{
|
|
|
|
// Already set isdisposed so that changes can be prohibited
|
|
|
|
isdisposed = true;
|
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
if(map == General.Map.Map)
|
|
|
|
General.Map.UndoRedo.RecRemSidedef(this);
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Remove from main list
|
2009-06-05 19:03:56 +00:00
|
|
|
map.RemoveSidedef(listindex);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Detach from linedef
|
2009-06-11 21:21:20 +00:00
|
|
|
if(linedef != null) linedef.DetachSidedefP(this);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Detach from sector
|
2009-06-11 21:21:20 +00:00
|
|
|
SetSectorP(null);
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Clean up
|
|
|
|
sectorlistitem = null;
|
|
|
|
linedef = null;
|
|
|
|
map = null;
|
|
|
|
sector = null;
|
|
|
|
|
2015-09-16 20:22:20 +00:00
|
|
|
//mxd. Restore isdisposed so base classes can do their disposal job
|
|
|
|
isdisposed = false;
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Dispose base
|
|
|
|
base.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Management
|
2009-06-11 21:21:20 +00:00
|
|
|
|
|
|
|
// Call this before changing properties
|
|
|
|
protected override void BeforePropsChange()
|
|
|
|
{
|
|
|
|
if(map == General.Map.Map)
|
|
|
|
General.Map.UndoRedo.RecPrpSidedef(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Serialize / deserialize (passive: this doesn't record)
|
2013-03-18 13:52:27 +00:00
|
|
|
new internal void ReadWrite(IReadWriteStream s)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
if(!s.IsWriting) BeforePropsChange();
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
base.ReadWrite(s);
|
|
|
|
|
2013-07-19 15:30:58 +00:00
|
|
|
//mxd
|
2014-12-03 09:06:05 +00:00
|
|
|
if(s.IsWriting)
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
s.wInt(flags.Count);
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
foreach(KeyValuePair<string, bool> f in flags)
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
s.wString(f.Key);
|
|
|
|
s.wBool(f.Value);
|
|
|
|
}
|
2014-12-03 09:06:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
int c;
|
|
|
|
s.rInt(out c);
|
|
|
|
|
2014-02-26 14:11:06 +00:00
|
|
|
flags = new Dictionary<string, bool>(c, StringComparer.Ordinal);
|
2014-12-03 09:06:05 +00:00
|
|
|
for(int i = 0; i < c; i++)
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
string t;
|
|
|
|
s.rString(out t);
|
|
|
|
bool b;
|
|
|
|
s.rBool(out b);
|
|
|
|
flags.Add(t, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
s.rwInt(ref offsetx);
|
|
|
|
s.rwInt(ref offsety);
|
|
|
|
s.rwString(ref texnamehigh);
|
|
|
|
s.rwString(ref texnamemid);
|
|
|
|
s.rwString(ref texnamelow);
|
2009-06-11 21:21:20 +00:00
|
|
|
s.rwLong(ref longtexnamehigh);
|
|
|
|
s.rwLong(ref longtexnamemid);
|
|
|
|
s.rwLong(ref longtexnamelow);
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This copies all properties to another sidedef
|
|
|
|
public void CopyPropertiesTo(Sidedef s)
|
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
s.BeforePropsChange();
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Copy properties
|
|
|
|
s.offsetx = offsetx;
|
|
|
|
s.offsety = offsety;
|
|
|
|
s.texnamehigh = texnamehigh;
|
|
|
|
s.texnamemid = texnamemid;
|
|
|
|
s.texnamelow = texnamelow;
|
|
|
|
s.longtexnamehigh = longtexnamehigh;
|
|
|
|
s.longtexnamemid = longtexnamemid;
|
|
|
|
s.longtexnamelow = longtexnamelow;
|
2013-07-19 15:30:58 +00:00
|
|
|
s.flags = new Dictionary<string, bool>(flags); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
base.CopyPropertiesTo(s);
|
|
|
|
}
|
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// This changes sector
|
|
|
|
public void SetSector(Sector newsector)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
if(map == General.Map.Map)
|
|
|
|
General.Map.UndoRedo.RecRefSidedefSector(this);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// Change sector
|
|
|
|
SetSectorP(newsector);
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
internal void SetSectorP(Sector newsector)
|
|
|
|
{
|
|
|
|
// Detach from sector
|
2013-07-05 09:07:49 +00:00
|
|
|
if(sector != null && !sector.IsDisposed) //mxd
|
|
|
|
sector.DetachSidedefP(sectorlistitem);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// Change sector
|
|
|
|
sector = newsector;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// Attach to sector
|
2013-07-05 09:07:49 +00:00
|
|
|
if(sector != null && !sector.IsDisposed) //mxd
|
2009-06-11 21:21:20 +00:00
|
|
|
sectorlistitem = sector.AttachSidedefP(this);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// This sets the linedef
|
|
|
|
public void SetLinedef(Linedef ld, bool front)
|
|
|
|
{
|
|
|
|
if(linedef != null) linedef.DetachSidedefP(this);
|
|
|
|
|
|
|
|
if(ld != null)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
if(front)
|
|
|
|
ld.AttachFront(this);
|
|
|
|
else
|
|
|
|
ld.AttachBack(this);
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
2009-06-11 21:21:20 +00:00
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// This sets the linedef (passive: this doesn't tell the linedef and doesn't record)
|
|
|
|
internal void SetLinedefP(Linedef ld)
|
|
|
|
{
|
|
|
|
linedef = ld;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
2014-09-16 20:26:42 +00:00
|
|
|
|
|
|
|
//mxd. This translates UDMF fields back into the normal flags and activations
|
|
|
|
internal void TranslateFromUDMF()
|
|
|
|
{
|
|
|
|
// Try to translate UDMF texture offsets to regular ones
|
2015-12-28 15:01:53 +00:00
|
|
|
if(longtexnamemid != MapSet.EmptyLongName && MiddleRequired())
|
2014-09-16 20:26:42 +00:00
|
|
|
{
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
offsetx += (int)UniFields.GetFloat(this.Fields, "offsetx_mid");
|
|
|
|
offsety += (int)UniFields.GetFloat(this.Fields, "offsety_mid");
|
2014-09-16 20:26:42 +00:00
|
|
|
}
|
2015-12-28 15:01:53 +00:00
|
|
|
else if(longtexnamehigh != MapSet.EmptyLongName && HighRequired())
|
2014-09-16 20:26:42 +00:00
|
|
|
{
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
offsetx += (int)UniFields.GetFloat(this.Fields, "offsetx_top");
|
|
|
|
offsety += (int)UniFields.GetFloat(this.Fields, "offsety_top");
|
2014-09-16 20:26:42 +00:00
|
|
|
}
|
2015-12-28 15:01:53 +00:00
|
|
|
else if(longtexnamelow != MapSet.EmptyLongName && LowRequired())
|
2014-09-16 20:26:42 +00:00
|
|
|
{
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
offsetx += (int)UniFields.GetFloat(this.Fields, "offsetx_bottom");
|
|
|
|
offsety += (int)UniFields.GetFloat(this.Fields, "offsety_bottom");
|
2014-09-16 20:26:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Clear UDMF-related properties
|
|
|
|
this.Fields.Clear();
|
|
|
|
this.Flags.Clear();
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Methods
|
2013-07-19 15:30:58 +00:00
|
|
|
|
|
|
|
// This checks and returns a flag without creating it
|
2013-12-17 13:18:44 +00:00
|
|
|
public bool IsFlagSet(string flagname)
|
|
|
|
{
|
|
|
|
return (flags.ContainsKey(flagname) && flags[flagname]);
|
2013-07-19 15:30:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This sets a flag
|
2013-12-17 13:18:44 +00:00
|
|
|
public void SetFlag(string flagname, bool value)
|
|
|
|
{
|
2014-12-03 09:06:05 +00:00
|
|
|
if(!flags.ContainsKey(flagname) || (IsFlagSet(flagname) != value))
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
flags[flagname] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This returns a copy of the flags dictionary
|
2013-12-17 13:18:44 +00:00
|
|
|
public Dictionary<string, bool> GetFlags()
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
return new Dictionary<string, bool>(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This clears all flags
|
2013-12-17 13:18:44 +00:00
|
|
|
public void ClearFlags()
|
|
|
|
{
|
2013-07-19 15:30:58 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
flags.Clear();
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// This removes textures that are not required
|
|
|
|
public void RemoveUnneededTextures(bool removemiddle)
|
|
|
|
{
|
2014-03-19 13:03:47 +00:00
|
|
|
RemoveUnneededTextures(removemiddle, false, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This removes textures that are not required
|
|
|
|
public void RemoveUnneededTextures(bool removemiddle, bool force)
|
|
|
|
{
|
|
|
|
RemoveUnneededTextures(removemiddle, force, false);
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This removes textures that are not required
|
2014-03-19 13:03:47 +00:00
|
|
|
public void RemoveUnneededTextures(bool removemiddle, bool force, bool shiftmiddle)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2013-12-17 13:18:44 +00:00
|
|
|
bool changed = false; //mxd
|
2009-05-06 14:50:17 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Check if the line or sectors have no action or tags because
|
|
|
|
// if they do, any texture on this side could be needed
|
2015-07-28 15:04:21 +00:00
|
|
|
if(force || ((linedef.Tag == 0) && (linedef.Action == 0) && (sector.Tag == 0) &&
|
|
|
|
((Other == null) || (Other.sector.Tag == 0))))
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
if(!HighRequired())
|
|
|
|
{
|
2014-03-19 13:03:47 +00:00
|
|
|
BeforePropsChange(); //mxd
|
|
|
|
changed = true;
|
2014-01-13 08:06:56 +00:00
|
|
|
this.texnamehigh = "-";
|
|
|
|
this.longtexnamehigh = MapSet.EmptyLongName;
|
|
|
|
General.Map.IsChanged = true;
|
2014-03-19 13:03:47 +00:00
|
|
|
}
|
|
|
|
else if(shiftmiddle && this.longtexnamehigh == MapSet.EmptyLongName) //mxd
|
|
|
|
{
|
|
|
|
SetTextureHigh(this.texnamemid);
|
|
|
|
changed = true;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!LowRequired())
|
|
|
|
{
|
2015-03-17 14:54:49 +00:00
|
|
|
if(!changed) //mxd
|
|
|
|
{
|
2014-03-19 13:03:47 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
changed = true;
|
|
|
|
}
|
2014-01-13 08:06:56 +00:00
|
|
|
this.texnamelow = "-";
|
|
|
|
this.longtexnamelow = MapSet.EmptyLongName;
|
|
|
|
General.Map.IsChanged = true;
|
2014-03-19 13:03:47 +00:00
|
|
|
}
|
|
|
|
else if(shiftmiddle && this.longtexnamelow == MapSet.EmptyLongName) //mxd
|
|
|
|
{
|
|
|
|
SetTextureLow(this.texnamemid);
|
|
|
|
changed = true;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
2014-03-19 13:03:47 +00:00
|
|
|
|
|
|
|
// The middle texture can be removed regardless of any sector tag or linedef action
|
2014-12-03 09:06:05 +00:00
|
|
|
if(!MiddleRequired() && removemiddle)
|
|
|
|
{
|
2014-03-19 13:03:47 +00:00
|
|
|
if(!changed) BeforePropsChange(); //mxd
|
|
|
|
this.texnamemid = "-";
|
|
|
|
this.longtexnamemid = MapSet.EmptyLongName;
|
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
2009-07-29 16:34:17 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This checks if a texture is required
|
|
|
|
/// </summary>
|
2009-04-19 18:07:22 +00:00
|
|
|
public bool HighRequired()
|
|
|
|
{
|
|
|
|
// Doublesided?
|
|
|
|
if(Other != null)
|
|
|
|
{
|
2015-03-17 14:54:49 +00:00
|
|
|
//mxd. Check sloped ceilings...
|
|
|
|
if(General.Map.UDMF && this.sector != Other.Sector)
|
|
|
|
{
|
|
|
|
float thisstartz = this.sector.CeilHeight;
|
|
|
|
float thisendz = this.sector.CeilHeight;
|
|
|
|
float otherstartz = Other.sector.CeilHeight;
|
|
|
|
float otherendz = Other.sector.CeilHeight;
|
|
|
|
|
|
|
|
// Check if this side is affected by UDMF slope (it overrides vertex heights, riiiiiight?..) TODO: check this!
|
|
|
|
if(this.sector.CeilSlope.GetLengthSq() > 0)
|
|
|
|
{
|
|
|
|
Plane ceil = new Plane(this.sector.CeilSlope, this.sector.CeilSlopeOffset);
|
|
|
|
thisstartz = ceil.GetZ(this.Line.Start.Position);
|
|
|
|
thisendz = ceil.GetZ(this.Line.End.Position);
|
|
|
|
}
|
|
|
|
else if(this.sector.Sidedefs.Count == 3) // Check vertex heights on this side
|
|
|
|
{
|
|
|
|
if(!float.IsNaN(this.Line.Start.ZCeiling)) thisstartz = this.Line.Start.ZCeiling;
|
|
|
|
if(!float.IsNaN(this.Line.End.ZCeiling)) thisendz = this.Line.End.ZCeiling;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if other side is affected by UDMF slope (it overrides vertex heights, riiiiiight?..) TODO: check this!
|
|
|
|
if(Other.sector.CeilSlope.GetLengthSq() > 0)
|
|
|
|
{
|
|
|
|
Plane ceil = new Plane(Other.sector.CeilSlope, Other.sector.CeilSlopeOffset);
|
|
|
|
otherstartz = ceil.GetZ(this.Line.Start.Position);
|
|
|
|
otherendz = ceil.GetZ(this.Line.End.Position);
|
|
|
|
}
|
|
|
|
else if(Other.sector.Sidedefs.Count == 3) // Check other line's vertex heights
|
|
|
|
{
|
|
|
|
if(!float.IsNaN(this.Line.Start.ZCeiling)) otherstartz = this.Line.Start.ZCeiling;
|
|
|
|
if(!float.IsNaN(this.Line.End.ZCeiling)) otherendz = this.Line.End.ZCeiling;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Texture is required when our start or end vertex is higher than on the other side.
|
|
|
|
if(thisstartz > otherstartz || thisendz > otherendz) return true;
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Texture is required when ceiling of other side is lower
|
|
|
|
return (Other.sector.CeilHeight < this.sector.CeilHeight);
|
|
|
|
}
|
2013-12-17 13:18:44 +00:00
|
|
|
|
|
|
|
return false;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
2009-07-29 16:34:17 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This checks if a texture is required
|
|
|
|
/// </summary>
|
2009-04-19 18:07:22 +00:00
|
|
|
public bool MiddleRequired()
|
|
|
|
{
|
|
|
|
// Texture is required when the line is singlesided
|
|
|
|
return (Other == null);
|
|
|
|
}
|
|
|
|
|
2009-07-29 16:34:17 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This checks if a texture is required
|
|
|
|
/// </summary>
|
2009-04-19 18:07:22 +00:00
|
|
|
public bool LowRequired()
|
|
|
|
{
|
|
|
|
// Doublesided?
|
|
|
|
if(Other != null)
|
|
|
|
{
|
2015-03-17 14:54:49 +00:00
|
|
|
//mxd. Check sloped floors...
|
|
|
|
if(General.Map.UDMF && this.sector != Other.Sector)
|
|
|
|
{
|
|
|
|
float thisstartz = this.sector.FloorHeight;
|
|
|
|
float thisendz = this.sector.FloorHeight;
|
|
|
|
float otherstartz = Other.sector.FloorHeight;
|
|
|
|
float otherendz = Other.sector.FloorHeight;
|
|
|
|
|
|
|
|
// Check if this side is affected by UDMF slope (it overrides vertex heights, riiiiiight?..) TODO: check this!
|
|
|
|
if(this.sector.FloorSlope.GetLengthSq() > 0)
|
|
|
|
{
|
|
|
|
Plane floor = new Plane(this.sector.FloorSlope, this.sector.FloorSlopeOffset);
|
|
|
|
thisstartz = floor.GetZ(this.Line.Start.Position);
|
|
|
|
thisendz = floor.GetZ(this.Line.End.Position);
|
|
|
|
}
|
|
|
|
else if(this.sector.Sidedefs.Count == 3) // Check vertex heights on this side
|
|
|
|
{
|
|
|
|
if(!float.IsNaN(this.Line.Start.ZFloor)) thisstartz = this.Line.Start.ZFloor;
|
|
|
|
if(!float.IsNaN(this.Line.End.ZFloor)) thisendz = this.Line.End.ZFloor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if other side is affected by UDMF slope (it overrides vertex heights, riiiiiight?..) TODO: check this!
|
|
|
|
if(Other.sector.FloorSlope.GetLengthSq() > 0)
|
|
|
|
{
|
|
|
|
Plane floor = new Plane(Other.sector.FloorSlope, Other.sector.FloorSlopeOffset);
|
|
|
|
otherstartz = floor.GetZ(this.Line.Start.Position);
|
|
|
|
otherendz = floor.GetZ(this.Line.End.Position);
|
|
|
|
}
|
|
|
|
else if(Other.sector.Sidedefs.Count == 3) // Check other line's vertex heights
|
|
|
|
{
|
|
|
|
if(!float.IsNaN(this.Line.Start.ZFloor)) otherstartz = this.Line.Start.ZFloor;
|
|
|
|
if(!float.IsNaN(this.Line.End.ZFloor)) otherendz = this.Line.End.ZFloor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Texture is required when our start or end vertex is lower than on the other side.
|
|
|
|
if(thisstartz < otherstartz || thisendz < otherendz) return true;
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Texture is required when floor of other side is higher
|
|
|
|
return (Other.sector.FloorHeight > this.sector.FloorHeight);
|
|
|
|
}
|
2013-12-17 13:18:44 +00:00
|
|
|
|
|
|
|
return false;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
2009-06-11 21:21:20 +00:00
|
|
|
|
2009-07-29 16:34:17 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This returns the height of the upper wall part. Returns 0 when no upper part exists.
|
|
|
|
/// </summary>
|
|
|
|
public int GetHighHeight()
|
|
|
|
{
|
|
|
|
Sidedef other = this.Other;
|
|
|
|
if(other != null)
|
|
|
|
{
|
|
|
|
int top = this.sector.CeilHeight;
|
|
|
|
int bottom = other.sector.CeilHeight;
|
|
|
|
int height = top - bottom;
|
|
|
|
return (height > 0) ? height : 0;
|
|
|
|
}
|
2013-12-17 13:18:44 +00:00
|
|
|
|
|
|
|
return 0;
|
2009-07-29 16:34:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This returns the height of the middle wall part.
|
|
|
|
/// </summary>
|
|
|
|
public int GetMiddleHeight()
|
|
|
|
{
|
|
|
|
Sidedef other = this.Other;
|
|
|
|
if(other != null)
|
|
|
|
{
|
|
|
|
int top = Math.Min(this.Sector.CeilHeight, other.Sector.CeilHeight);
|
|
|
|
int bottom = Math.Max(this.Sector.FloorHeight, other.Sector.FloorHeight);
|
|
|
|
int height = top - bottom;
|
|
|
|
return (height > 0) ? height : 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int top = this.Sector.CeilHeight;
|
|
|
|
int bottom = this.Sector.FloorHeight;
|
|
|
|
int height = top - bottom;
|
|
|
|
return (height > 0) ? height : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This returns the height of the lower wall part. Returns 0 when no lower part exists.
|
|
|
|
/// </summary>
|
|
|
|
public int GetLowHeight()
|
|
|
|
{
|
|
|
|
Sidedef other = this.Other;
|
|
|
|
if(other != null)
|
|
|
|
{
|
|
|
|
int top = other.sector.FloorHeight;
|
|
|
|
int bottom = this.sector.FloorHeight;
|
|
|
|
int height = top - bottom;
|
|
|
|
return (height > 0) ? height : 0;
|
|
|
|
}
|
2013-12-17 13:18:44 +00:00
|
|
|
|
|
|
|
return 0;
|
2009-07-29 16:34:17 +00:00
|
|
|
}
|
|
|
|
|
2009-06-11 21:21:20 +00:00
|
|
|
// This creates a checksum from the sidedef properties
|
|
|
|
// Used for faster sidedefs compression
|
|
|
|
public uint GetChecksum()
|
|
|
|
{
|
|
|
|
CRC crc = new CRC();
|
|
|
|
crc.Add(sector.FixedIndex);
|
|
|
|
crc.Add(offsetx);
|
|
|
|
crc.Add(offsety);
|
|
|
|
crc.Add(longtexnamehigh);
|
|
|
|
crc.Add(longtexnamelow);
|
|
|
|
crc.Add(longtexnamemid);
|
|
|
|
return (uint)(crc.Value & 0x00000000FFFFFFFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This copies textures to another sidedef
|
|
|
|
// And possibly also the offsets
|
|
|
|
public void AddTexturesTo(Sidedef s)
|
|
|
|
{
|
|
|
|
int copyoffsets = 0;
|
|
|
|
|
|
|
|
// s cannot be null
|
|
|
|
if(s == null) return;
|
|
|
|
|
|
|
|
s.BeforePropsChange();
|
|
|
|
|
|
|
|
// Upper texture set?
|
2013-07-31 12:38:47 +00:00
|
|
|
if((texnamehigh.Length > 0) && (texnamehigh != "-"))
|
2009-06-11 21:21:20 +00:00
|
|
|
{
|
|
|
|
// Copy upper texture
|
|
|
|
s.texnamehigh = texnamehigh;
|
|
|
|
s.longtexnamehigh = longtexnamehigh;
|
|
|
|
|
|
|
|
// Counts as a half coice for copying offsets
|
|
|
|
copyoffsets += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Middle texture set?
|
2013-07-31 12:38:47 +00:00
|
|
|
if((texnamemid.Length > 0) && (texnamemid != "-"))
|
2009-06-11 21:21:20 +00:00
|
|
|
{
|
|
|
|
// Copy middle texture
|
|
|
|
s.texnamemid = texnamemid;
|
|
|
|
s.longtexnamemid = longtexnamemid;
|
|
|
|
|
|
|
|
// Counts for copying offsets
|
|
|
|
copyoffsets += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Lower texture set?
|
2013-07-31 12:38:47 +00:00
|
|
|
if((texnamelow.Length > 0) && (texnamelow != "-"))
|
2009-06-11 21:21:20 +00:00
|
|
|
{
|
|
|
|
// Copy middle texture
|
|
|
|
s.texnamelow = texnamelow;
|
|
|
|
s.longtexnamelow = longtexnamelow;
|
|
|
|
|
|
|
|
// Counts as a half coice for copying offsets
|
|
|
|
copyoffsets += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy offsets also?
|
|
|
|
if(copyoffsets >= 2)
|
|
|
|
{
|
|
|
|
// Copy offsets
|
|
|
|
s.offsetx = offsetx;
|
|
|
|
s.offsety = offsety;
|
|
|
|
}
|
|
|
|
|
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Changes
|
|
|
|
|
|
|
|
// This updates all properties
|
2014-12-03 23:15:26 +00:00
|
|
|
public void Update(int offsetx, int offsety, string thigh, string tmid, string tlow)
|
|
|
|
{
|
2014-02-26 14:11:06 +00:00
|
|
|
Update(offsetx, offsety, thigh, tmid, tlow, new Dictionary<string, bool>(StringComparer.Ordinal));
|
2013-07-19 15:30:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. This updates all properties (UDMF version)
|
|
|
|
public void Update(int offsetx, int offsety, string thigh, string tmid, string tlow, Dictionary<string, bool> flags)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Apply changes
|
|
|
|
this.offsetx = offsetx;
|
|
|
|
this.offsety = offsety;
|
2013-07-19 15:30:58 +00:00
|
|
|
this.flags = new Dictionary<string, bool>(flags); //mxd
|
2014-12-03 09:06:05 +00:00
|
|
|
//SetTextureMid(tmid);
|
|
|
|
//SetTextureLow(tlow);
|
|
|
|
//SetTextureHigh(thigh);
|
|
|
|
|
|
|
|
//mxd. Set mid texture
|
|
|
|
texnamemid = string.IsNullOrEmpty(tmid) ? "-" : tmid;
|
|
|
|
longtexnamemid = Lump.MakeLongName(tmid);
|
|
|
|
|
|
|
|
//mxd. Set low texture
|
|
|
|
texnamelow = string.IsNullOrEmpty(tlow) ? "-" : tlow;
|
|
|
|
longtexnamelow = Lump.MakeLongName(tlow);
|
|
|
|
|
|
|
|
//mxd. Set high texture
|
|
|
|
texnamehigh = string.IsNullOrEmpty(thigh) ? "-" : thigh;
|
|
|
|
longtexnamehigh = Lump.MakeLongName(texnamehigh);
|
|
|
|
|
|
|
|
//mxd. Map is changed
|
|
|
|
General.Map.IsChanged = true;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This sets texture
|
|
|
|
public void SetTextureHigh(string name)
|
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
texnamehigh = string.IsNullOrEmpty(name) ? "-" : name; //mxd
|
|
|
|
longtexnamehigh = General.Map.Data.GetFullLongTextureName(Lump.MakeLongName(name)); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This sets texture
|
|
|
|
public void SetTextureMid(string name)
|
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
texnamemid = string.IsNullOrEmpty(name) ? "-" : name; //mxd;
|
|
|
|
longtexnamemid = General.Map.Data.GetFullLongTextureName(Lump.MakeLongName(name)); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This sets texture
|
|
|
|
public void SetTextureLow(string name)
|
|
|
|
{
|
2009-06-11 21:21:20 +00:00
|
|
|
BeforePropsChange();
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
texnamelow = string.IsNullOrEmpty(name) ? "-" : name; //mxd;
|
|
|
|
longtexnamelow = General.Map.Data.GetFullLongTextureName(Lump.MakeLongName(name)); //mxd
|
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. This sets texture lookup
|
|
|
|
public void SetTextureHigh(long hash)
|
|
|
|
{
|
|
|
|
BeforePropsChange();
|
|
|
|
|
|
|
|
longtexnamehigh = hash;
|
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. This sets texture lookup
|
|
|
|
public void SetTextureMid(long hash)
|
|
|
|
{
|
|
|
|
BeforePropsChange();
|
|
|
|
|
|
|
|
longtexnamemid = hash;
|
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. This sets texture lookup
|
|
|
|
public void SetTextureLow(long hash)
|
|
|
|
{
|
|
|
|
BeforePropsChange();
|
|
|
|
|
|
|
|
longtexnamelow = hash;
|
2009-04-19 18:07:22 +00:00
|
|
|
General.Map.IsChanged = true;
|
|
|
|
}
|
2013-09-05 13:03:17 +00:00
|
|
|
|
|
|
|
// This sets udmf texture offset
|
2014-12-03 23:15:26 +00:00
|
|
|
public void SetUdmfTextureOffsetX(int offset)
|
|
|
|
{
|
2013-09-05 13:03:17 +00:00
|
|
|
this.Fields.BeforeFieldsChange();
|
|
|
|
|
|
|
|
//top
|
2015-01-16 13:14:57 +00:00
|
|
|
if(longtexnamehigh != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(texnamehigh))
|
2014-12-03 23:15:26 +00:00
|
|
|
{
|
2015-01-16 13:14:57 +00:00
|
|
|
ImageData texture = General.Map.Data.GetTextureImage(texnamehigh);
|
2013-09-05 13:03:17 +00:00
|
|
|
float scaleTop = Fields.GetValue("scalex_top", 1.0f);
|
|
|
|
|
|
|
|
float value = Fields.GetValue("offsetx_top", 0f);
|
|
|
|
float result = (float)(Math.Round(value + offset * scaleTop) % texture.Width);
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
UniFields.SetFloat(Fields, "offsetx_top", result);
|
2013-09-05 13:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//middle
|
2015-01-16 13:14:57 +00:00
|
|
|
if(longtexnamemid != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(texnamemid))
|
2014-12-03 23:15:26 +00:00
|
|
|
{
|
2015-01-16 13:14:57 +00:00
|
|
|
ImageData texture = General.Map.Data.GetTextureImage(texnamemid);
|
2013-09-05 13:03:17 +00:00
|
|
|
float scaleMid = Fields.GetValue("scalex_mid", 1.0f);
|
|
|
|
|
|
|
|
float value = Fields.GetValue("offsetx_mid", 0f);
|
|
|
|
float result = (float)(Math.Round(value + offset * scaleMid) % texture.Width);
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
UniFields.SetFloat(Fields, "offsetx_mid", result);
|
2013-09-05 13:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//bottom
|
2015-01-16 13:14:57 +00:00
|
|
|
if(longtexnamelow != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(texnamelow))
|
2014-12-03 23:15:26 +00:00
|
|
|
{
|
2015-01-16 13:14:57 +00:00
|
|
|
ImageData texture = General.Map.Data.GetTextureImage(texnamelow);
|
2013-09-05 13:03:17 +00:00
|
|
|
float scaleLow = Fields.GetValue("scalex_bottom", 1.0f);
|
|
|
|
|
|
|
|
float value = Fields.GetValue("offsetx_bottom", 0f);
|
|
|
|
float result = (float)(Math.Round(value + offset * scaleLow) % texture.Width);
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
UniFields.SetFloat(Fields, "offsetx_bottom", result);
|
2013-09-05 13:03:17 +00:00
|
|
|
}
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|