Linedef Edit Form, Sector Edit Form: when several map elements with different textures are selected, the "texture stack" icon is shown in the texture selectors instead of the "missing texture" icon.

Error Checker mode: added "Check missing flats" check.
Error Checker mode: fixed several descriptions. 
Sprite patches for sprites defined in TEXTURES are now loaded from Sprites namespace.
Some of my older texture alignment code didn't work properly when strict texture/flat handling ("mixtextureflats" game configuration flag set to false) was enabled.
Fixed some incorrect checks for missing texture ("-").
This commit is contained in:
MaxED 2014-03-05 09:21:28 +00:00
parent 8599f18f4c
commit 7faf6bc13e
60 changed files with 373 additions and 157 deletions

View file

@ -949,6 +949,7 @@
<None Include="Resources\GZDB_Logo_small.png" />
<None Include="Resources\InfoLine.png" />
<None Include="Resources\Keyboard.png" />
<None Include="Resources\ImageStack.png" />
<Content Include="Resources\Light.png" />
<None Include="Resources\Lightbulb.png" />
<Content Include="Resources\Light_animate.png" />

View file

@ -41,10 +41,17 @@ namespace CodeImp.DoomBuilder.Controls
timer.Stop(); //mxd
// Check if name is a "none" texture
if((imagename.Length < 1) || (imagename == "-"))
if(string.IsNullOrEmpty(imagename))
{
DisplayImageSize(0, 0); //mxd
//mxd. Flat required?
return multipletextures ? Properties.Resources.ImageStack : Properties.Resources.MissingTexture;
}
else if(imagename == "-") //mxd
{
DisplayImageSize(0, 0);
// Flat required!
return Properties.Resources.MissingTexture;
}

View file

@ -519,7 +519,7 @@ namespace CodeImp.DoomBuilder.Controls
}
//mxd. This validates an item's texture size
private bool ValidateItemSize(ImageBrowserItem i, int w, int h) {
private static bool ValidateItemSize(ImageBrowserItem i, int w, int h) {
if (!i.icon.IsPreviewLoaded) return true;
if (w > 0 && i.icon.Width != w) return false;
if (h > 0 && i.icon.Height != h) return false;

View file

@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.Controls
}
// This clamps a value between 0 and 1
private float Saturate(float v)
private static float Saturate(float v)
{
if(v < 0f) return 0f; else if(v > 1f) return 1f; else return v;
}

View file

@ -38,12 +38,14 @@ namespace CodeImp.DoomBuilder.Controls
private bool ismouseinside;
private MouseButtons button;
private string previousImageName; //mxd
protected bool multipletextures; //mxd
#endregion
#region ================== Properties
public string TextureName { get { return name.Text; } set { name.Text = value; } }
public bool MultipleTextures { get { return multipletextures; } set { multipletextures = value; } }
#endregion
@ -241,7 +243,7 @@ namespace CodeImp.DoomBuilder.Controls
}
// This clamps a value between 0 and 1
private float Saturate(float v)
private static float Saturate(float v)
{
if(v < 0f) return 0f;
if(v > 1f) return 1f;

View file

@ -66,7 +66,7 @@ namespace CodeImp.DoomBuilder.Controls
ceilingname.Text = s.CeilTexture;
//mxd. Texture info
if ((s.FloorTexture.Length < 1) || (s.FloorTexture == "-")){
if (s.LongFloorTexture == MapSet.EmptyLongName){
labelFloorTextureSize.Visible = false;
General.DisplayZoomedImage(floortex, Properties.Resources.MissingTexture);
} else {
@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder.Controls
General.DisplayZoomedImage(floortex, floorImage.GetPreview());
}
if((s.CeilTexture.Length < 1) || (s.CeilTexture == "-")) {
if (s.LongCeilTexture == MapSet.EmptyLongName) {
labelCeilTextureSize.Visible = false;
General.DisplayZoomedImage(ceilingtex, Properties.Resources.MissingTexture);
} else {

View file

@ -47,9 +47,17 @@ namespace CodeImp.DoomBuilder.Controls
timer.Stop(); //mxd
// Check if name is a "none" texture
if((imagename.Length < 1) || (imagename == "-")) {
if(string.IsNullOrEmpty(imagename)) {
DisplayImageSize(0, 0); //mxd
//mxd. Determine image to show
if (multipletextures) return Properties.Resources.ImageStack;
return (required ? Properties.Resources.MissingTexture : null);
}
else if(imagename == "-") //mxd
{
DisplayImageSize(0, 0);
// Determine image to show
return (required ? Properties.Resources.MissingTexture : null);
}

View file

@ -1690,9 +1690,9 @@ namespace CodeImp.DoomBuilder.Data
foreach(Sidedef sd in General.Map.Map.Sidedefs)
{
// Add used textures to dictionary
if(sd.HighTexture.Length > 0) usedimages[sd.LongHighTexture] = 0;
if(sd.LowTexture.Length > 0) usedimages[sd.LongMiddleTexture] = 0;
if(sd.MiddleTexture.Length > 0) usedimages[sd.LongLowTexture] = 0;
if(sd.LongHighTexture != MapSet.EmptyLongName) usedimages[sd.LongHighTexture] = 0;
if(sd.LongMiddleTexture != MapSet.EmptyLongName) usedimages[sd.LongMiddleTexture] = 0;
if(sd.LongLowTexture != MapSet.EmptyLongName) usedimages[sd.LongLowTexture] = 0;
}
// Go through the map to find the used flats

View file

@ -34,13 +34,14 @@ namespace CodeImp.DoomBuilder.Data
private List<TexturePatch> patches;
private bool gotFullName;//mxd
private string type;
#endregion
#region ================== Constructor / Disposer
// Constructor
public HighResImage(string name, int width, int height, float scalex, float scaley, bool worldpanning)
public HighResImage(string name, string type, int width, int height, float scalex, float scaley, bool worldpanning)
{
// Initialize
this.width = width;
@ -49,6 +50,7 @@ namespace CodeImp.DoomBuilder.Data
this.scale.y = scaley;
this.worldpanning = worldpanning;
this.patches = new List<TexturePatch>();
this.type = type;
SetName(name);
// We have no destructor
@ -112,7 +114,15 @@ namespace CodeImp.DoomBuilder.Data
foreach(TexturePatch p in patches)
{
// Get the patch data stream
Stream patchdata = General.Map.Data.GetPatchData(p.lumpname);
Stream patchdata;
//mxd
if (type == "sprite") {
patchdata = General.Map.Data.GetSpriteData(p.lumpname);
} else {
patchdata = General.Map.Data.GetPatchData(p.lumpname);
}
if(patchdata != null)
{
// Copy patch data to memory

View file

@ -624,7 +624,7 @@ namespace CodeImp.DoomBuilder.Data
}
// This copies images from a collection unless they already exist in the list
private void AddImagesToList(Dictionary<long, ImageData> targetlist, ICollection<ImageData> sourcelist)
private static void AddImagesToList(Dictionary<long, ImageData> targetlist, ICollection<ImageData> sourcelist)
{
// Go for all source images
foreach(ImageData src in sourcelist)

View file

@ -575,7 +575,7 @@ namespace CodeImp.DoomBuilder.Editing
}
// This sets the view mode
private void SetViewMode(ViewMode mode)
private static void SetViewMode(ViewMode mode)
{
General.Map.CRenderer2D.SetViewMode(mode);
General.MainWindow.UpdateInterface();

View file

@ -66,7 +66,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
public delegate void AngleChangedDelegate();
public event AngleChangedDelegate AngleChanged;
private PointF DegreesToXY(float degrees, float radius, Point origin)
private static PointF DegreesToXY(float degrees, float radius, Point origin)
{
PointF xy = new PointF();
double radians = degrees * Math.PI / 180.0;
@ -77,7 +77,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
return xy;
}
private int XYToDegrees(Point xy, Point origin)
private static int XYToDegrees(Point xy, Point origin)
{
float xDiff = xy.X - origin.X;
float yDiff = xy.Y - origin.Y;

View file

@ -71,9 +71,9 @@ namespace CodeImp.DoomBuilder
#region ================== Methods
// Methods to find our way through the heap
private int ParentOf(int index) { return (index - 1) >> 1; }
private int LeftOf(int index) { return (index << 1) + 1; }
private int RightOf(int index) { return (index << 1) + 2; }
private static int ParentOf(int index) { return (index - 1) >> 1; }
private static int LeftOf(int index) { return (index << 1) + 1; }
private static int RightOf(int index) { return (index << 1) + 2; }
// This swaps two items in place
protected virtual void SwapItems(int index1, int index2)

View file

@ -695,9 +695,9 @@ namespace CodeImp.DoomBuilder.Geometry
// This applies defaults to a sidedef
private static void ApplyDefaultsToSidedef(Sidedef sd, SidedefSettings defaults)
{
if(sd.HighRequired() && sd.HighTexture.StartsWith("-")) sd.SetTextureHigh(defaults.newtexhigh);
if(sd.MiddleRequired() && sd.MiddleTexture.StartsWith("-")) sd.SetTextureMid(defaults.newtexmid);
if(sd.LowRequired() && sd.LowTexture.StartsWith("-")) sd.SetTextureLow(defaults.newtexlow);
if(sd.HighRequired() && sd.LongHighTexture == MapSet.EmptyLongName) sd.SetTextureHigh(defaults.newtexhigh); //mxd
if(sd.MiddleRequired() && sd.LongMiddleTexture == MapSet.EmptyLongName) sd.SetTextureMid(defaults.newtexmid); //mxd
if(sd.LowRequired() && sd.LongLowTexture == MapSet.EmptyLongName) sd.SetTextureLow(defaults.newtexlow); //mxd
}
// This applies defaults to a sector
@ -1470,12 +1470,12 @@ namespace CodeImp.DoomBuilder.Geometry
if(l.Front != null) {
ImageData texture = null;
if(l.Front.MiddleRequired() && l.Front.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.MiddleTexture)) {
texture = General.Map.Data.GetFlatImage(l.Front.MiddleTexture);
} else if(l.Front.HighRequired() && l.Front.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.HighTexture)) {
texture = General.Map.Data.GetFlatImage(l.Front.HighTexture);
} else if(l.Front.LowRequired() && l.Front.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.LowTexture)) {
texture = General.Map.Data.GetFlatImage(l.Front.LowTexture);
if(l.Front.MiddleRequired() && l.Front.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongMiddleTexture)) {
texture = General.Map.Data.GetTextureImage(l.Front.LongMiddleTexture);
} else if(l.Front.HighRequired() && l.Front.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongHighTexture)) {
texture = General.Map.Data.GetTextureImage(l.Front.LongHighTexture);
} else if(l.Front.LowRequired() && l.Front.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongLowTexture)) {
texture = General.Map.Data.GetTextureImage(l.Front.LongLowTexture);
}
if(texture != null)
@ -1485,12 +1485,12 @@ namespace CodeImp.DoomBuilder.Geometry
if(l.Back != null) {
ImageData texture = null;
if(l.Back.MiddleRequired() && l.Back.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.MiddleTexture)) {
texture = General.Map.Data.GetFlatImage(l.Back.MiddleTexture);
} else if(l.Back.HighRequired() && l.Back.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.HighTexture)) {
texture = General.Map.Data.GetFlatImage(l.Back.HighTexture);
} else if(l.Back.LowRequired() && l.Back.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.LowTexture)) {
texture = General.Map.Data.GetFlatImage(l.Back.LowTexture);
if(l.Back.MiddleRequired() && l.Back.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongMiddleTexture)) {
texture = General.Map.Data.GetTextureImage(l.Back.LongMiddleTexture);
} else if(l.Back.HighRequired() && l.Back.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongHighTexture)) {
texture = General.Map.Data.GetTextureImage(l.Back.LongHighTexture);
} else if(l.Back.LowRequired() && l.Back.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongLowTexture)) {
texture = General.Map.Data.GetTextureImage(l.Back.LongLowTexture);
}
if(texture != null)
@ -1507,22 +1507,22 @@ namespace CodeImp.DoomBuilder.Geometry
foreach(Linedef l in lines) {
if(l.Front != null) {
if(l.Front.MiddleRequired() && l.Front.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.MiddleTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Front.MiddleTexture);
if(l.Front.MiddleRequired() && l.Front.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongMiddleTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Front.LongMiddleTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Front.Fields, "offsetx_mid", offset);
}
if(l.Front.HighRequired() && l.Front.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.HighTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Front.HighTexture);
if(l.Front.HighRequired() && l.Front.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongHighTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Front.LongHighTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Front.Fields, "offsetx_top", offset);
}
if(l.Front.LowRequired() && l.Front.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Front.LowTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Front.LowTexture);
if(l.Front.LowRequired() && l.Front.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Front.LongLowTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Front.LongLowTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Front.Fields, "offsetx_bottom", offset);
@ -1530,22 +1530,22 @@ namespace CodeImp.DoomBuilder.Geometry
}
if(l.Back != null) {
if(l.Back.MiddleRequired() && l.Back.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.MiddleTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Back.MiddleTexture);
if(l.Back.MiddleRequired() && l.Back.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongMiddleTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Back.LongMiddleTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Back.Fields, "offsetx_mid", offset);
}
if(l.Back.HighRequired() && l.Back.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.HighTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Back.HighTexture);
if(l.Back.HighRequired() && l.Back.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongHighTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Back.LongHighTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Back.Fields, "offsetx_top", offset);
}
if(l.Back.LowRequired() && l.Back.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(l.Back.LowTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(l.Back.LowTexture);
if(l.Back.LowRequired() && l.Back.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(l.Back.LongLowTexture)) {
ImageData texture = General.Map.Data.GetTextureImage(l.Back.LongLowTexture);
float offset = (int)Math.Round((reversed ? totalLength - curLength - l.Length : curLength)) % texture.Width;
if(offset > 0) UDMFTools.SetFloat(l.Back.Fields, "offsetx_bottom", offset);
@ -1644,7 +1644,7 @@ namespace CodeImp.DoomBuilder.Geometry
// Apply texturing
if(j.sidedef.HighRequired() && j.sidedef.LongHighTexture == originaltexture) j.sidedef.SetTextureHigh(filltexture.Name);
if((((j.sidedef.MiddleTexture.Length > 0) && (j.sidedef.MiddleTexture != "-")) || j.sidedef.MiddleRequired()) &&
if((j.sidedef.LongMiddleTexture != MapSet.EmptyLongName || j.sidedef.MiddleRequired()) &&
(j.sidedef.LongMiddleTexture == originaltexture)) j.sidedef.SetTextureMid(filltexture.Name);
if(j.sidedef.LowRequired() && j.sidedef.LongLowTexture == originaltexture) j.sidedef.SetTextureLow(filltexture.Name);
j.sidedef.Marked = true;
@ -1715,7 +1715,7 @@ namespace CodeImp.DoomBuilder.Geometry
{
return ((sd.LongHighTexture == texturelongname) && sd.HighRequired()) ||
((sd.LongLowTexture == texturelongname) && sd.LowRequired()) ||
((sd.LongMiddleTexture == texturelongname) && (sd.MiddleRequired() || ((sd.MiddleTexture.Length > 0) && (sd.MiddleTexture != "-")))) ;
((sd.LongMiddleTexture == texturelongname) && (sd.MiddleRequired() || sd.LongMiddleTexture != MapSet.EmptyLongName)) ;
}
#endregion

View file

@ -289,7 +289,7 @@ namespace CodeImp.DoomBuilder.Geometry
// This recursively traces a path
// Returns the resulting TracePath when the search is complete
// or returns null when no path found.
private SidedefsTracePath DoTracePath(SidedefsTracePath history, Vertex fromhere, Vertex findme, Sector sector, Dictionary<Sidedef, bool> sides)
private static SidedefsTracePath DoTracePath(SidedefsTracePath history, Vertex fromhere, Vertex findme, Sector sector, Dictionary<Sidedef, bool> sides)
{
SidedefsTracePath nextpath;
SidedefsTracePath result;
@ -359,7 +359,7 @@ namespace CodeImp.DoomBuilder.Geometry
// This removes all sidedefs which has a sidedefs on the other side
// of the same line that refers to the same sector. These are removed
// because they are useless and make the triangulation inefficient.
private void RemoveDoubleSidedefReferences(Dictionary<Sidedef, bool> todosides, ICollection<Sidedef> sides)
private static void RemoveDoubleSidedefReferences(Dictionary<Sidedef, bool> todosides, ICollection<Sidedef> sides)
{
// Go for all sides
foreach(Sidedef sd in sides)
@ -378,7 +378,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This finds the right-most vertex to start tracing with
private Vertex FindRightMostVertex(Dictionary<Sidedef, bool> sides, Dictionary<Vertex, Vertex> ignores)
private static Vertex FindRightMostVertex(Dictionary<Sidedef, bool> sides, Dictionary<Vertex, Vertex> ignores)
{
Vertex found = null;
@ -480,7 +480,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This finds the right-most vertex in an inner polygon to use for cut startpoint.
private LinkedListNode<EarClipVertex> FindRightMostVertex(EarClipPolygon p)
private static LinkedListNode<EarClipVertex> FindRightMostVertex(EarClipPolygon p)
{
LinkedListNode<EarClipVertex> found = p.First;
LinkedListNode<EarClipVertex> v = found.Next;
@ -813,7 +813,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This returns the 3-vertex array triangle for an ear
private EarClipVertex[] GetTriangle(EarClipVertex v)
private static EarClipVertex[] GetTriangle(EarClipVertex v)
{
EarClipVertex[] t = new EarClipVertex[3];
t[0] = (v.MainListNode.Previous == null) ? v.MainListNode.List.Last.Value : v.MainListNode.Previous.Value;
@ -823,7 +823,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This checks if a vertex is reflex (corner > 180 deg) or convex (corner < 180 deg)
private bool IsReflex(EarClipVertex[] t)
private static bool IsReflex(EarClipVertex[] t)
{
// Return true when corner is > 180 deg
return (Line2D.GetSideOfLine(t[0].Position, t[2].Position, t[1].Position) < 0.0f);
@ -881,7 +881,7 @@ namespace CodeImp.DoomBuilder.Geometry
// This checks if a line is inside a triangle (touching the triangle is allowed)
// NOTE: We already know p1 is on an edge segment of the triangle
private bool LineInsideTriangle(EarClipVertex[] t, Vector2D p1, Vector2D p2)
private static bool LineInsideTriangle(EarClipVertex[] t, Vector2D p1, Vector2D p2)
{
float s01 = Line2D.GetSideOfLine(t[0].Position, t[1].Position, p2);
float s12 = Line2D.GetSideOfLine(t[1].Position, t[2].Position, p2);
@ -942,7 +942,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This checks if the triangle has an area greater than 0
private bool TriangleHasArea(EarClipVertex[] t)
private static bool TriangleHasArea(EarClipVertex[] t)
{
return ((t[0].Position.x * (t[1].Position.y - t[2].Position.y) +
t[1].Position.x * (t[2].Position.y - t[0].Position.y) +
@ -950,7 +950,7 @@ namespace CodeImp.DoomBuilder.Geometry
}
// This adds an array of vertices
private void AddTriangleToList(EarClipVertex[] triangle, List<Vector2D> verticeslist, List<Sidedef> sidedefslist, bool last)
private static void AddTriangleToList(EarClipVertex[] triangle, List<Vector2D> verticeslist, List<Sidedef> sidedefslist, bool last)
{
// Create triangle
verticeslist.Add(triangle[0].Position);

View file

@ -414,7 +414,7 @@ namespace CodeImp.DoomBuilder.IO
// This returns a string added with escape characters
private string EscapedString(string str)
private static string EscapedString(string str)
{
// Replace the \ with \\ first!
str = str.Replace("\\", "\\\\");

View file

@ -289,7 +289,7 @@ namespace CodeImp.DoomBuilder.IO
}
// This fixes a path so that it doesn't have the \ at the end
private string CorrectPath(string path)
private static string CorrectPath(string path)
{
if(path.Length > 0)
{

View file

@ -242,7 +242,7 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Methods
// This makes the path prefix for the given assembly
private string GetPluginPathPrefix(Assembly asm)
private static string GetPluginPathPrefix(Assembly asm)
{
Plugin p = General.Plugins.FindPluginByAssembly(asm);
return "plugins." + p.Name.ToLowerInvariant() + ".";

View file

@ -578,6 +578,7 @@ namespace CodeImp.DoomBuilder.Map
{
BeforePropsChange();
if(string.IsNullOrEmpty(name)) name = "-"; //mxd
floortexname = name;
longfloortexname = Lump.MakeLongName(name);
updateneeded = true;
@ -589,6 +590,7 @@ namespace CodeImp.DoomBuilder.Map
{
BeforePropsChange();
if(string.IsNullOrEmpty(name)) name = "-"; //mxd
ceiltexname = name;
longceiltexname = Lump.MakeLongName(name);
updateneeded = true;

View file

@ -535,6 +535,7 @@ namespace CodeImp.DoomBuilder.Map
{
BeforePropsChange();
if(string.IsNullOrEmpty(name)) name = "-"; //mxd
texnamehigh = name;
longtexnamehigh = Lump.MakeLongName(name);
General.Map.IsChanged = true;
@ -545,6 +546,7 @@ namespace CodeImp.DoomBuilder.Map
{
BeforePropsChange();
if (string.IsNullOrEmpty(name)) name = "-"; //mxd
texnamemid = name;
longtexnamemid = Lump.MakeLongName(name);
General.Map.IsChanged = true;
@ -555,6 +557,7 @@ namespace CodeImp.DoomBuilder.Map
{
BeforePropsChange();
if(string.IsNullOrEmpty(name)) name = "-"; //mxd
texnamelow = name;
longtexnamelow = Lump.MakeLongName(name);
General.Map.IsChanged = true;
@ -565,7 +568,7 @@ namespace CodeImp.DoomBuilder.Map
this.Fields.BeforeFieldsChange();
//top
if(HighTexture.Length > 1 && General.Map.Data.GetFlatExists(HighTexture)) {
if(LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetFlatExists(HighTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(HighTexture);
float scaleTop = Fields.GetValue("scalex_top", 1.0f);
@ -575,7 +578,7 @@ namespace CodeImp.DoomBuilder.Map
}
//middle
if(MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(MiddleTexture)) {
if(LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetFlatExists(MiddleTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(MiddleTexture);
float scaleMid = Fields.GetValue("scalex_mid", 1.0f);
@ -585,7 +588,7 @@ namespace CodeImp.DoomBuilder.Map
}
//bottom
if(LowTexture.Length > 1 && General.Map.Data.GetFlatExists(LowTexture)) {
if(LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetFlatExists(LowTexture)) {
ImageData texture = General.Map.Data.GetFlatImage(LowTexture);
float scaleLow = Fields.GetValue("scalex_bottom", 1.0f);

View file

@ -249,6 +249,13 @@ namespace CodeImp.DoomBuilder.Properties {
}
}
internal static System.Drawing.Bitmap ImageStack {
get {
object obj = ResourceManager.GetObject("ImageStack", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap InfoLine {
get {
object obj = ResourceManager.GetObject("InfoLine", resourceCulture);

View file

@ -418,4 +418,7 @@
<data name="Search" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ImageStack" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ImageStack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -95,7 +95,7 @@ namespace CodeImp.DoomBuilder.VisualModes
// This returns the key for a block at the given coordinates
// TODO: Could we just use the Point struct as key?
private ulong GetBlockKey(Point p)
private static ulong GetBlockKey(Point p)
{
return unchecked( ((ulong)(uint)p.X << 32) + (uint)p.Y );
}

View file

@ -754,6 +754,7 @@ namespace CodeImp.DoomBuilder.Windows
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Game Configurations";
this.Shown += new System.EventHandler(this.ConfigForm_Shown);
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.ConfigForm_HelpRequested);
this.tabs.ResumeLayout(false);
this.tabresources.ResumeLayout(false);

View file

@ -713,5 +713,12 @@ namespace CodeImp.DoomBuilder.Windows
configinfo.LinedefColorPresets = colorsControl.GetPresets();
configinfo.Changed = true; //mxd
}
//mxd
private void ConfigForm_Shown(object sender, EventArgs e) {
if (listconfigs.SelectedItems.Count > 0) {
listconfigs.SelectedItems[0].EnsureVisible();
}
}
}
}

View file

@ -212,7 +212,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA4
CAAAAk1TRnQBSQFMAwEBAAH0AQAB9AEAARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
CAAAAk1TRnQBSQFMAwEBAAH8AQAB/AEAARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUwDAAEQAwABAQEAAQgFAAHAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View file

@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
@ -119,7 +120,13 @@ namespace CodeImp.DoomBuilder.Windows
str.Append(c.Value);
}
}
Clipboard.SetText(str.ToString());
//mxd
try {
Clipboard.SetDataObject(str.ToString(), true);
} catch(ExternalException) {
General.Interface.DisplayStatus(StatusType.Warning, "Failed to perform a Clipboard operation...");
}
}
}

View file

@ -506,12 +506,22 @@ namespace CodeImp.DoomBuilder.Windows
// Front settings
if(l.Front != null)
{
if(fronthigh.TextureName != l.Front.HighTexture) fronthigh.TextureName = string.Empty;
if(frontmid.TextureName != l.Front.MiddleTexture) frontmid.TextureName = string.Empty;
if(frontlow.TextureName != l.Front.LowTexture) frontlow.TextureName = string.Empty;
if(fronthigh.Required != l.Front.HighRequired()) fronthigh.Required = false;
if(frontmid.Required != l.Front.MiddleRequired()) frontmid.Required = false;
if(frontlow.Required != l.Front.LowRequired()) frontlow.Required = false;
//mxd
if (fronthigh.TextureName != l.Front.HighTexture) {
if(!fronthigh.Required && l.Front.HighRequired()) fronthigh.Required = true;
fronthigh.MultipleTextures = true; //mxd
fronthigh.TextureName = string.Empty;
}
if (frontmid.TextureName != l.Front.MiddleTexture) {
if(!frontmid.Required && l.Front.MiddleRequired()) frontmid.Required = true;
frontmid.MultipleTextures = true; //mxd
frontmid.TextureName = string.Empty;
}
if (frontlow.TextureName != l.Front.LowTexture) {
if(!frontlow.Required && l.Front.LowRequired()) frontlow.Required = true;
frontlow.MultipleTextures = true; //mxd
frontlow.TextureName = string.Empty;
}
if(frontsector.Text != l.Front.Sector.Index.ToString()) frontsector.Text = string.Empty;
//mxd
@ -549,12 +559,22 @@ namespace CodeImp.DoomBuilder.Windows
// Back settings
if(l.Back != null)
{
if(backhigh.TextureName != l.Back.HighTexture) backhigh.TextureName = string.Empty;
if(backmid.TextureName != l.Back.MiddleTexture) backmid.TextureName = string.Empty;
if(backlow.TextureName != l.Back.LowTexture) backlow.TextureName = string.Empty;
if(backhigh.Required != l.Back.HighRequired()) backhigh.Required = false;
if(backmid.Required != l.Back.MiddleRequired()) backmid.Required = false;
if(backlow.Required != l.Back.LowRequired()) backlow.Required = false;
//mxd
if (backhigh.TextureName != l.Back.HighTexture) {
if(!backhigh.Required && l.Back.HighRequired()) backhigh.Required = true;
backhigh.MultipleTextures = true; //mxd
backhigh.TextureName = string.Empty;
}
if (backmid.TextureName != l.Back.MiddleTexture) {
if(!backmid.Required && l.Back.MiddleRequired()) backmid.Required = true;
backmid.MultipleTextures = true; //mxd
backmid.TextureName = string.Empty;
}
if (backlow.TextureName != l.Back.LowTexture) {
if(!backlow.Required && l.Back.LowRequired()) backlow.Required = true;
backlow.MultipleTextures = true; //mxd
backlow.TextureName = string.Empty;
}
if(backsector.Text != l.Back.Sector.Index.ToString()) backsector.Text = string.Empty;
//mxd

View file

@ -144,8 +144,14 @@ namespace CodeImp.DoomBuilder.Windows
// Floor/Ceiling
if(s.FloorHeight.ToString() != floorheight.Text) floorheight.Text = "";
if(s.CeilHeight.ToString() != ceilingheight.Text) ceilingheight.Text = "";
if(s.FloorTexture != floortex.TextureName) floortex.TextureName = "";
if(s.CeilTexture != ceilingtex.TextureName) ceilingtex.TextureName = "";
if (s.FloorTexture != floortex.TextureName) {
floortex.MultipleTextures = true; //mxd
floortex.TextureName = "";
}
if (s.CeilTexture != ceilingtex.TextureName) {
ceilingtex.MultipleTextures = true; //mxd
ceilingtex.TextureName = "";
}
// Action
if(s.Tag != sc.Tag) tagSelector.ClearTag(); //mxd

View file

@ -254,8 +254,14 @@ namespace CodeImp.DoomBuilder.Windows
// Floor/Ceiling
if(s.FloorHeight.ToString() != floorheight.Text) floorheight.Text = "";
if(s.CeilHeight.ToString() != ceilingheight.Text) ceilingheight.Text = "";
if(s.FloorTexture != floortex.TextureName) floortex.TextureName = "";
if(s.CeilTexture != ceilingtex.TextureName) ceilingtex.TextureName = "";
if (s.FloorTexture != floortex.TextureName) {
floortex.MultipleTextures = true; //mxd
floortex.TextureName = "";
}
if (s.CeilTexture != ceilingtex.TextureName) {
ceilingtex.MultipleTextures = true; //mxd
ceilingtex.TextureName = "";
}
//mxd. UDMF stuff
//Texture offsets

View file

@ -210,7 +210,7 @@ namespace CodeImp.DoomBuilder.ZDoom
#region ================== Methods
// This reads the next token and sets a floating point value, returns false when failed
private bool ReadTokenFloat(TexturesParser parser, string propertyname, out float value)
private static bool ReadTokenFloat(TexturesParser parser, string propertyname, out float value)
{
// Next token is the property value to set
parser.SkipWhitespace(true);
@ -234,7 +234,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
// This reads the next token and sets an integral value, returns false when failed
private bool ReadTokenInt(TexturesParser parser, string propertyname, out int value)
private static bool ReadTokenInt(TexturesParser parser, string propertyname, out int value)
{
// Next token is the property value to set
parser.SkipWhitespace(true);
@ -259,7 +259,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
//mxd. This reads the next token and sets a string value, returns false when failed
private bool ReadTokenString(TexturesParser parser, string propertyname, out string value) {
private static bool ReadTokenString(TexturesParser parser, string propertyname, out string value) {
parser.SkipWhitespace(true);
value = parser.StripTokenQuotes(parser.ReadToken());
@ -272,7 +272,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
//mxd. This reads the next token and sets a PixelColor value, returns false when failed
private bool ReadTokenColor(TexturesParser parser, string propertyname, out int value) {
private static bool ReadTokenColor(TexturesParser parser, string propertyname, out int value) {
parser.SkipWhitespace(true);
string strvalue = parser.StripTokenQuotes(parser.ReadToken());
value = 0;

View file

@ -194,7 +194,7 @@ namespace CodeImp.DoomBuilder.ZDoom
#region ================== Methods
// This reads the next token and sets a floating point value, returns false when failed
private bool ReadTokenFloat(TexturesParser parser, string propertyname, out float value)
private static bool ReadTokenFloat(TexturesParser parser, string propertyname, out float value)
{
// Next token is the property value to set
parser.SkipWhitespace(true);
@ -223,7 +223,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
// This reads the next token and sets an integral value, returns false when failed
private bool ReadTokenInt(TexturesParser parser, string propertyname, out int value)
private static bool ReadTokenInt(TexturesParser parser, string propertyname, out int value)
{
// Next token is the property value to set
parser.SkipWhitespace(true);
@ -264,7 +264,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if(yscale == 0.0f) scaley = defaultscale; else scaley = 1f / yscale;
// Make texture
HighResImage tex = new HighResImage(name, width, height, scalex, scaley, worldpanning);
HighResImage tex = new HighResImage(name, typename, width, height, scalex, scaley, worldpanning);
// Add patches
foreach(PatchStructure p in patches)

View file

@ -228,6 +228,7 @@
<Compile Include="ClassicModes\DrawRectangleMode.cs" />
<Compile Include="ClassicModes\FlatAlignMode.cs" />
<Compile Include="ClassicModes\FloorAlignMode.cs" />
<Compile Include="ErrorChecks\CheckMissingFlats.cs" />
<Compile Include="ErrorChecks\CheckMissingTextures.cs" />
<Compile Include="ErrorChecks\CheckOverlappingVertices.cs" />
<Compile Include="ErrorChecks\CheckStrayVertices.cs" />
@ -235,11 +236,12 @@
<Compile Include="ErrorChecks\CheckUnknownTextures.cs" />
<Compile Include="ErrorChecks\CheckUnknownThings.cs" />
<Compile Include="ErrorChecks\CheckUnusedTextures.cs" />
<Compile Include="ErrorChecks\ResultMissingFlat.cs" />
<Compile Include="ErrorChecks\ResultNoErrors.cs" />
<Compile Include="ErrorChecks\ResultSectorInvalid.cs" />
<Compile Include="ErrorChecks\ResultStrayVertex.cs" />
<Compile Include="ErrorChecks\ResultStuckThingInThing.cs" />
<Compile Include="ErrorChecks\ResultTextureMissing.cs" />
<Compile Include="ErrorChecks\ResultMissingTexture.cs" />
<Compile Include="ErrorChecks\ResultUnknownFlat.cs" />
<Compile Include="ErrorChecks\ResultUnknownTexture.cs" />
<Compile Include="ErrorChecks\ResultUnknownThing.cs" />

View file

@ -409,7 +409,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
s.Fields.BeforeFieldsChange();
//update ceiling offset
if(s.CeilTexture.Length > 1) {
if(s.LongCeilTexture != MapSet.EmptyLongName) {
ImageData texture = General.Map.Data.GetFlatImage(s.CeilTexture);
if(texture != null) {
@ -438,7 +438,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//update floor offset
if(s.FloorTexture.Length > 1) {
if(s.LongFloorTexture != MapSet.EmptyLongName) {
ImageData texture = General.Map.Data.GetFlatImage(s.FloorTexture);
if(texture != null) {

View file

@ -1487,10 +1487,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd. Check textures.
if(lines[i].Front.MiddleRequired() && (lines[i].Front.MiddleTexture.Length == 0 || lines[i].Front.MiddleTexture == "-")) {
if(lines[i].Front.HighTexture.Length > 0 && lines[i].Front.HighTexture != "-") {
if(lines[i].Front.MiddleRequired() && lines[i].Front.LongMiddleTexture == MapSet.EmptyLongName) {
if(lines[i].Front.LongHighTexture != MapSet.EmptyLongName) {
lines[i].Front.SetTextureMid(lines[i].Front.HighTexture);
} else if(lines[i].Front.LowTexture.Length > 0 && lines[i].Front.LowTexture != "-") {
} else if(lines[i].Front.LongLowTexture != MapSet.EmptyLongName) {
lines[i].Front.SetTextureMid(lines[i].Front.LowTexture);
}
}

View file

@ -0,0 +1,57 @@
#region ================== Namespaces
using CodeImp.DoomBuilder.Map;
using System.Threading;
#endregion
namespace CodeImp.DoomBuilder.BuilderModes
{
[ErrorChecker("Check missing flats", true, 40)]
public class CheckMissingFlats : ErrorChecker
{
#region ================== Constants
private int PROGRESS_STEP = 1000;
#endregion
#region ================== Constructor / Destructor
// Constructor
public CheckMissingFlats() {
// Total progress is done when all sectors are checked
SetTotalProgress(General.Map.Map.Sectors.Count / PROGRESS_STEP);
}
#endregion
#region ================== Methods
// This runs the check
public override void Run() {
int progress = 0;
int stepprogress = 0;
// Go for all the sectors
foreach(Sector s in General.Map.Map.Sectors) {
// Check floor texture
if(s.LongFloorTexture == MapSet.EmptyLongName) SubmitResult(new ResultMissingFlat(s, false));
// Check ceiling texture
if(s.LongCeilTexture == MapSet.EmptyLongName) SubmitResult(new ResultMissingFlat(s, true));
// Handle thread interruption
try { Thread.Sleep(0); } catch(ThreadInterruptedException) { return; }
// We are making progress!
if((++progress / PROGRESS_STEP) > stepprogress) {
stepprogress = (progress / PROGRESS_STEP);
AddProgress(1);
}
}
}
#endregion
}
}

View file

@ -55,11 +55,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Sector s in General.Map.Map.Sectors)
{
// Check floor texture
if(!General.Map.Data.GetFlatExists(s.FloorTexture))
if(s.LongFloorTexture != MapSet.EmptyLongName && !General.Map.Data.GetFlatExists(s.FloorTexture))
SubmitResult(new ResultUnknownFlat(s, false));
// Check ceiling texture
if(!General.Map.Data.GetFlatExists(s.CeilTexture))
if(s.LongCeilTexture != MapSet.EmptyLongName && !General.Map.Data.GetFlatExists(s.CeilTexture))
SubmitResult(new ResultUnknownFlat(s, true));
// Handle thread interruption

View file

@ -55,24 +55,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Sidedef sd in General.Map.Map.Sidedefs)
{
// Check upper texture
if(sd.HighRequired() && ((sd.HighTexture.Length < 1) || (sd.HighTexture != "-")))
if(sd.HighRequired() && sd.LongHighTexture != MapSet.EmptyLongName && !General.Map.Data.GetTextureExists(sd.LongHighTexture))
{
if(!General.Map.Data.GetTextureExists(sd.LongHighTexture))
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Upper));
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Upper));
}
// Check middle texture
if(sd.MiddleRequired() && ((sd.MiddleTexture.Length < 1) || (sd.MiddleTexture != "-")))
if(sd.MiddleRequired() && sd.LongMiddleTexture != MapSet.EmptyLongName && !General.Map.Data.GetTextureExists(sd.LongMiddleTexture))
{
if(!General.Map.Data.GetTextureExists(sd.LongMiddleTexture))
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Middle));
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Middle));
}
// Check lower texture
if(sd.LowRequired() && ((sd.LowTexture.Length < 1) || (sd.LowTexture != "-")))
if(sd.LowRequired() && sd.LongLowTexture != MapSet.EmptyLongName && !General.Map.Data.GetTextureExists(sd.LongLowTexture))
{
if(!General.Map.Data.GetTextureExists(sd.LongLowTexture))
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Lower));
SubmitResult(new ResultUnknownTexture(sd, SidedefPart.Lower));
}
// Handle thread interruption

View file

@ -39,13 +39,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Sidedef sd in General.Map.Map.Sidedefs)
{
// Check upper texture
if(!sd.HighRequired() && ((sd.HighTexture.Length > 1) || (sd.HighTexture != "-")))
if(!sd.HighRequired() && sd.LongHighTexture != MapSet.EmptyLongName)
{
SubmitResult(new ResultUnusedTexture(sd, SidedefPart.Upper));
}
// Check lower texture
if(!sd.LowRequired() && ((sd.LowTexture.Length > 1) || (sd.LowTexture != "-")))
if(!sd.LowRequired() && sd.LongLowTexture != MapSet.EmptyLongName)
{
SubmitResult(new ResultUnusedTexture(sd, SidedefPart.Lower));
}

View file

@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.viewobjects.Add(l);
this.description = "This linedef has a back sidedef, but is missing a front sidedef. " +
"A line must have at least a front side and optionally a back side! " +
"Click Flip Linedef if the line is supposed to be single-sided.";
"Click 'Flip Linedef' button if the line is supposed to be single-sided.";
// One solution is to flip the sidedefs
buttons = 1;

View file

@ -51,7 +51,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Initialize
this.line = l;
this.viewobjects.Add(l);
this.description = "This linedef is marked as double-sided, but is missing the back sidedef. Click Make Single-Sided to remove the double-sided flag from the line.";
this.description = "This linedef is marked as double-sided, but is missing the back sidedef. Click 'Make Single-Sided' button to remove the double-sided flag from the line.";
// One solution is to remove the double-sided flag
buttons = 1;

View file

@ -47,8 +47,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Initialize
this.line = l;
this.viewobjects.Add(l);
this.description = "This linedef is marked as single-sided, but has both a front and a back sidedef. Click Make Double-Sided to flag the line as double-sided." +
" Or click Remove Sidedef to remove the sidedef on the back side (making the line really single-sided).";
this.description = "This linedef is marked as single-sided, but has both a front and a back sidedef. Click 'Make Double-Sided' button to flag the line as double-sided." +
" Or click 'Remove Sidedef' button to remove the sidedef on the back side (making the line really single-sided).";
}
#endregion

View file

@ -0,0 +1,79 @@
#region ================== Namespaces
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
#endregion
namespace CodeImp.DoomBuilder.BuilderModes
{
public class ResultMissingFlat : ErrorResult
{
#region ================== Variables
private Sector sector;
private bool ceiling;
#endregion
#region ================== Properties
public override int Buttons { get { return 1; } }
public override string Button1Text { get { return "Add Default Flat"; } }
#endregion
#region ================== Constructor / Destructor
// Constructor
public ResultMissingFlat(Sector s, bool ceiling)
{
// Initialize
this.sector = s;
this.ceiling = ceiling;
this.viewobjects.Add(s);
string objname = ceiling ? "ceiling" : "floor";
this.description = "This sector's " + objname + " is missing a flat where it is required and could cause a 'Hall Of Mirrors' visual problem in the map. Click the 'Add Default Flat' button to add a flat to the sector.";
}
#endregion
#region ================== Methods
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Sector " + sector.Index + " has no " + (ceiling ? "ceiling" : "floor") + " flat.";
}
// Rendering
public override void PlotSelection(IRenderer2D renderer)
{
renderer.PlotSector(sector, General.Colors.Selection);
}
//mxd. More rendering
public override void RenderOverlaySelection(IRenderer2D renderer) {
if(!BuilderPlug.Me.UseHighlight) return;
renderer.RenderHighlight(sector.FlatVertices, General.Colors.Selection.WithAlpha(64).ToInt());
}
// Fix by setting default flat
public override bool Button1Click(bool batchMode)
{
if(!batchMode) General.Map.UndoRedo.CreateUndo("Missing flat correction");
General.Settings.FindDefaultDrawSettings();
if(ceiling)
sector.SetCeilTexture(General.Map.Options.DefaultCeilingTexture);
else
sector.SetFloorTexture(General.Map.Options.DefaultFloorTexture);
General.Map.Map.Update();
return true;
}
#endregion
}
}

View file

@ -48,7 +48,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.side = sd;
this.part = part;
this.viewobjects.Add(sd);
this.description = "This sidedef is missing a texture where it is required and could cause a 'Hall Of Mirrors' visual problem in the map. Click the Add Default Texture button to add a texture to the line.";
this.description = "This sidedef is missing a texture where it is required and could cause a 'Hall Of Mirrors' visual problem in the map. Click the 'Add Default Texture' button to add a texture to the line.";
}
#endregion

View file

@ -50,7 +50,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.viewobjects.Add(s);
string objname = ceiling ? "ceiling" : "floor";
this.description = "This sector " + objname + " uses an unknown flat. This could be the result of missing resources, or a mistyped flat name. Click the Add Default Flat button to use a known flat instead.";
this.description = "This sector's " + objname + " uses an unknown flat. This could be the result of missing resources, or a mistyped flat name. Click the 'Add Default Flat' button to use a known flat instead.";
}
#endregion

View file

@ -49,7 +49,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.side = sd;
this.part = part;
this.viewobjects.Add(sd);
this.description = "This sidedef uses an unknown texture. This could be the result of missing resources, or a mistyped texture name. Click the Remove Texture button to remove the texture or click on Add Default Texture to use a known texture instead.";
this.description = "This sidedef uses an unknown texture. This could be the result of missing resources, or a mistyped texture name. Click the 'Remove Texture' button to remove the texture or click on 'Add Default Texture' to use a known texture instead.";
}
#endregion

View file

@ -124,9 +124,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
public override int MinimumRevision { get { return Assembly.GetExecutingAssembly().GetName().Version.Revision; } }
public MenusForm MenusForm { get { return menusform; } }
public CurveLinedefsForm CurveLinedefsForm { get { return curvelinedefsform; } }
public FindReplaceForm FindReplaceForm { get { return findreplaceform; } }
public ErrorCheckForm ErrorCheckForm { get { return errorcheckform; } }
public CurveLinedefsForm CurveLinedefsForm { get { return curvelinedefsform ?? (curvelinedefsform = new CurveLinedefsForm()); } }
public FindReplaceForm FindReplaceForm { get { return findreplaceform ?? (findreplaceform = new FindReplaceForm()); } }
public ErrorCheckForm ErrorCheckForm { get { return errorcheckform ?? (errorcheckform = new ErrorCheckForm()); } }
public PreferencesForm PreferencesForm { get { return preferencesform; } }
// Settings
@ -192,15 +192,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
menusform.Register();
menusform.TextureOffsetLock.Checked = lockSectorTextureOffsetsWhileDragging; //mxd
// Load curve linedefs form
curvelinedefsform = new CurveLinedefsForm();
// Load find/replace form
findreplaceform = new FindReplaceForm();
// Load error checking form
errorcheckform = new ErrorCheckForm();
// Load Undo\Redo docker
undoredopanel = new UndoRedoPanel();
undoredodocker = new Docker("undoredo", "Undo / Redo", undoredopanel);
@ -490,12 +481,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
//get texture
ImageData texture = null;
if(newline.Front.MiddleRequired() && newline.Front.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Front.MiddleTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Front.MiddleTexture);
} else if(newline.Front.HighRequired() && newline.Front.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Front.HighTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Front.HighTexture);
} else if(newline.Front.LowRequired() && newline.Front.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Front.LowTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Front.LowTexture);
if(newline.Front.MiddleRequired() && newline.Front.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Front.LongMiddleTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Front.MiddleTexture);
} else if(newline.Front.HighRequired() && newline.Front.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Front.LongHighTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Front.HighTexture);
} else if(newline.Front.LowRequired() && newline.Front.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Front.LongLowTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Front.LowTexture);
}
//clamp offsetX
@ -506,12 +497,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
//get texture
ImageData texture = null;
if(newline.Back.MiddleRequired() && newline.Back.MiddleTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Back.MiddleTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Back.MiddleTexture);
} else if(newline.Back.HighRequired() && newline.Back.HighTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Back.HighTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Back.HighTexture);
} else if(newline.Back.LowRequired() && newline.Back.LowTexture.Length > 1 && General.Map.Data.GetFlatExists(newline.Back.LowTexture)) {
texture = General.Map.Data.GetFlatImage(newline.Back.LowTexture);
if(newline.Back.MiddleRequired() && newline.Back.LongMiddleTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Back.LongMiddleTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Back.MiddleTexture);
} else if(newline.Back.HighRequired() && newline.Back.LongHighTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Back.LongHighTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Back.HighTexture);
} else if(newline.Back.LowRequired() && newline.Back.LongLowTexture != MapSet.EmptyLongName && General.Map.Data.GetTextureExists(newline.Back.LongLowTexture)) {
texture = General.Map.Data.GetTextureImage(newline.Back.LowTexture);
}
//clamp offsetX

View file

@ -3299,7 +3299,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
bool matchtop = (!j.sidedef.Marked && (j.sidedef.LongHighTexture == texture.LongName) && j.sidedef.HighRequired());
bool matchbottom = (!j.sidedef.Marked && (j.sidedef.LongLowTexture == texture.LongName) && j.sidedef.LowRequired());
bool matchmid = ((j.controlSide.LongMiddleTexture == texture.LongName) && (j.controlSide.MiddleRequired() || ((j.controlSide.MiddleTexture.Length > 0) && (j.controlSide.MiddleTexture != "-")))); //mxd
bool matchmid = ((j.controlSide.LongMiddleTexture == texture.LongName) && (j.controlSide.MiddleRequired() || j.controlSide.LongMiddleTexture != MapSet.EmptyLongName)); //mxd
//mxd. If there's a selection, check if matched part is actually selected
if(checkSelectedSidedefParts && !singleselection) {

View file

@ -363,7 +363,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd
private bool checkFloorVertices(WorldVertex[] verts, Plane plane) {
private static bool checkFloorVertices(WorldVertex[] verts, Plane plane) {
for(int c = 0; c < verts.Length; c++) {
if(plane.GetZ(new Vector2D(verts[c].x, verts[c].y)) > verts[c].z)
return true;
@ -371,7 +371,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
return false;
}
//mxd
private bool checkCeilingVertices(WorldVertex[] verts, Plane plane) {
private static bool checkCeilingVertices(WorldVertex[] verts, Plane plane) {
for(int c = 0; c < verts.Length; c++) {
if(plane.GetZ(new Vector2D(verts[c].x, verts[c].y)) < verts[c].z)
return true;

View file

@ -89,7 +89,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
s.Fields.GetValue("yscaleceiling", 1.0f));
//Load ceiling texture
if((s.CeilTexture.Length > 0) && (s.CeilTexture != "-")) {
if(s.LongCeilTexture != MapSet.EmptyLongName) {
base.Texture = General.Map.Data.GetFlatImage(s.LongCeilTexture);
if(base.Texture == null || base.Texture is UnknownImage) {
base.Texture = General.Map.Data.UnknownTexture3D;

View file

@ -89,7 +89,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
s.Fields.GetValue("yscalefloor", 1.0f));
//Load floor texture
if ((s.FloorTexture.Length > 0) && (s.FloorTexture != "-"))
if (s.LongFloorTexture != MapSet.EmptyLongName)
{
base.Texture = General.Map.Data.GetFlatImage(s.LongFloorTexture);
if(base.Texture == null || base.Texture is UnknownImage)

View file

@ -91,7 +91,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(!osd.Updated) osd.Update();
// Texture given?
if((Sidedef.LowTexture.Length > 0) && (Sidedef.LowTexture != "-"))
if(Sidedef.LongLowTexture != MapSet.EmptyLongName)
{
// Load texture
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongLowTexture);

View file

@ -97,12 +97,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd. which texture we must use?
long textureLong = 0;
if((sourceside.Line.Args[2] & (int)Effect3DFloor.Flags.UseUpperTexture) != 0) {
if(Sidedef.HighTexture.Length > 0 && Sidedef.HighTexture != "-")
if(Sidedef.LongHighTexture != MapSet.EmptyLongName)
textureLong = Sidedef.LongHighTexture;
} else if((sourceside.Line.Args[2] & (int)Effect3DFloor.Flags.UseLowerTexture) != 0) {
if(Sidedef.LowTexture.Length > 0 && Sidedef.LowTexture != "-")
if(Sidedef.LongLowTexture != MapSet.EmptyLongName)
textureLong = Sidedef.LongLowTexture;
} else if((sourceside.MiddleTexture.Length > 0) && (sourceside.MiddleTexture != "-")) {
} else if(sourceside.LongMiddleTexture != MapSet.EmptyLongName) {
textureLong = sourceside.LongMiddleTexture;
}

View file

@ -75,12 +75,12 @@ namespace CodeImp.DoomBuilder.BuilderModes {
//mxd. which texture we must use?
long textureLong = 0;
if ((sourceside.Line.Args[2] & (int)Effect3DFloor.Flags.UseUpperTexture) != 0) {
if (Sidedef.Other.HighTexture.Length > 0 && Sidedef.Other.HighTexture != "-")
if (Sidedef.Other.LongHighTexture != MapSet.EmptyLongName)
textureLong = Sidedef.Other.LongHighTexture;
} else if ((sourceside.Line.Args[2] & (int)Effect3DFloor.Flags.UseLowerTexture) != 0) {
if(Sidedef.Other.LowTexture.Length > 0 && Sidedef.Other.LowTexture != "-")
if(Sidedef.Other.LongLowTexture != MapSet.EmptyLongName)
textureLong = Sidedef.Other.LongLowTexture;
} else if ((sourceside.MiddleTexture.Length > 0) && (sourceside.MiddleTexture != "-")) {
} else if ((sourceside.LongMiddleTexture != MapSet.EmptyLongName)) {
textureLong = sourceside.LongMiddleTexture;
}

View file

@ -68,7 +68,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public override bool Setup()
{
//mxd
if(Sidedef.MiddleTexture.Length == 0 || Sidedef.MiddleTexture == "-") return false;
if(Sidedef.LongMiddleTexture == MapSet.EmptyLongName) return false;
Vector2D vl, vr;
@ -98,7 +98,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(!osd.Updated) osd.Update();
// Load texture
if ((Sidedef.MiddleTexture.Length > 0) && (Sidedef.MiddleTexture != "-")){
if(Sidedef.LongMiddleTexture != MapSet.EmptyLongName) {
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongMiddleTexture);
if(base.Texture == null || base.Texture is UnknownImage) {
base.Texture = General.Map.Data.UnknownTexture3D;

View file

@ -89,7 +89,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SectorData sd = mode.GetSectorData(Sidedef.Sector);
// Texture given?
if((Sidedef.MiddleTexture.Length > 0) && (Sidedef.MiddleTexture != "-"))
if(Sidedef.LongMiddleTexture != MapSet.EmptyLongName)
{
// Load texture
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongMiddleTexture);

View file

@ -91,7 +91,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(!osd.Updated) osd.Update();
// Texture given?
if((Sidedef.HighTexture.Length > 0) && (Sidedef.HighTexture != "-"))
if((Sidedef.LongHighTexture != MapSet.EmptyLongName))
{
// Load texture
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongHighTexture);

View file

@ -141,7 +141,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
return combineName(comment.Length == 0 ? NodeInfoDefaultName.LINEDEF : comment, l.Tag, l.Action, l.Index, sortMode, isDefaultName);
}
private string combineName(string name, int tag, int action, int index, string sortMode, bool isDefaultName) {
private static string combineName(string name, int tag, int action, int index, string sortMode, bool isDefaultName) {
switch (sortMode) {
case SortMode.SORT_BY_ACTION:
return (tag > 0 ? "Tag:" + tag + "; " : "") + name + (isDefaultName ? " " + index : "");

View file

@ -85,7 +85,7 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
}
// This composes point values
private uint MakePointValue(uint vp, uint ds, uint ss, uint op)
private static uint MakePointValue(uint vp, uint ds, uint ss, uint op)
{
unchecked
{