Fixed, Texture Browser window: in some cases navigating the textures list using up/down arrows caused an exception.

Fixed, Map Analysis window: fixed an exception on copying warnings to clipboard when the clipboard was used by other application.
Fixed, TEXTURES parser: added special handling for "TNT1A0" sprite name so a texture with this sprite as a single patch is no longer treated as failed loading.
Fixed, Visual mode: in some cases (like line slopes used in several adjacent sectors) sector effect updates were triggered multiple times for the same sector, resulting in noticeable slowdowns and in some cases in infinite recursion.
Updated ZDoom ACC.
This commit is contained in:
MaxED 2016-02-15 14:06:46 +00:00 committed by spherallic
parent eadb0f4bf0
commit c12afe5bc7
11 changed files with 123 additions and 71 deletions

Binary file not shown.

View file

@ -24,12 +24,12 @@ special
17:Thing_Raise(1),
18:StartConversation(1,2),
19:Thing_Stop(1),
20:Floor_LowerByValue(3),
21:Floor_LowerToLowest(2),
22:Floor_LowerToNearest(2),
23:Floor_RaiseByValue(3),
24:Floor_RaiseToHighest(2),
25:Floor_RaiseToNearest(2),
20:Floor_LowerByValue(3,4),
21:Floor_LowerToLowest(2,3),
22:Floor_LowerToNearest(2,3),
23:Floor_RaiseByValue(3,5),
24:Floor_RaiseToHighest(2,5),
25:Floor_RaiseToNearest(2,4),
26:Stairs_BuildDown(5),
27:Stairs_BuildUp(5),
28:Floor_RaiseAndCrush(3,4),
@ -39,19 +39,19 @@ special
32:Stairs_BuildUpSync(4),
33:ForceField(0),
34:ClearForceField(1),
35:Floor_RaiseByValueTimes8(3),
36:Floor_LowerByValueTimes8(3),
37:Floor_MoveToValue(3,4),
35:Floor_RaiseByValueTimes8(3,5),
36:Floor_LowerByValueTimes8(3,4),
37:Floor_MoveToValue(3,5),
38:Ceiling_Waggle(5),
39:Teleport_ZombieChanger(2),
40:Ceiling_LowerByValue(3),
41:Ceiling_RaiseByValue(3),
40:Ceiling_LowerByValue(3,4),
41:Ceiling_RaiseByValue(3,4),
42:Ceiling_CrushAndRaise(3,4),
43:Ceiling_LowerAndCrush(3,4),
44:Ceiling_CrushStop(1),
45:Ceiling_CrushRaiseAndStay(3,4),
46:Floor_CrushStop(1),
47:Ceiling_MoveToValue(3,4),
47:Ceiling_MoveToValue(3,5),
// 48:Sector_Attach3dMidtex
49:GlassBreak(0,1),
// 50:ExtraFloor_LightOnly
@ -70,10 +70,10 @@ special
63:Plat_DownByValue(4),
64:Plat_UpWaitDownStay(3),
65:Plat_UpByValue(4),
66:Floor_LowerInstant(3),
67:Floor_RaiseInstant(3),
68:Floor_MoveToValueTimes8(4),
69:Ceiling_MoveToValueTimes8(4),
66:Floor_LowerInstant(3,4),
67:Floor_RaiseInstant(3,5),
68:Floor_MoveToValueTimes8(4,5),
69:Ceiling_MoveToValueTimes8(4,5),
70:Teleport(1,3),
71:Teleport_NoFog(1,4),
72:ThrustThing(2,4),
@ -109,6 +109,9 @@ special
// 102:Scroll_Texture_Up
// 103:Scroll_Texture_Down
104:Ceiling_CrushAndRaiseSilentDist(4,5),
105:Door_WaitRaise(4,5),
106:Door_WaitClose(3,4),
107:Line_SetPortalTarget(2),
109:Light_ForceLightning(1),
110:Light_RaiseByValue(2),
@ -177,14 +180,14 @@ special
188:Sector_SetCeilingScale(5),
189:Sector_SetFloorScale(5),
191:SetPlayerProperty(3),
192:Ceiling_LowerToHighestFloor(2),
193:Ceiling_LowerInstant(3),
194:Ceiling_RaiseInstant(3),
192:Ceiling_LowerToHighestFloor(2,4),
193:Ceiling_LowerInstant(3,5),
194:Ceiling_RaiseInstant(3,4),
195:Ceiling_CrushRaiseAndStayA(4,5),
196:Ceiling_CrushAndRaiseA(4,5),
197:Ceiling_CrushAndRaiseSilentA(4,5),
198:Ceiling_RaiseByValueTimes8(3),
199:Ceiling_LowerByValueTimes8(3),
198:Ceiling_RaiseByValueTimes8(3,4),
199:Ceiling_LowerByValueTimes8(3,4),
200:Generic_Floor(5),
201:Generic_Ceiling(5),
202:Generic_Door(5),
@ -223,9 +226,9 @@ special
235:Floor_TransferTrigger(1),
236:Floor_TransferNumeric(1),
237:ChangeCamera(3),
238:Floor_RaiseToLowestCeiling(2),
238:Floor_RaiseToLowestCeiling(2,4),
239:Floor_RaiseByValueTxTy(3),
240:Floor_RaiseByTexture(2),
240:Floor_RaiseByTexture(2,4),
241:Floor_LowerToLowestTxTy(2),
242:Floor_LowerToHighest(3,4),
243:Exit_Normal(1),
@ -237,10 +240,31 @@ special
249:Door_CloseWaitOpen(3, 4),
250:Floor_Donut(3),
251:FloorAndCeiling_LowerRaise(3,4),
252:Ceiling_RaiseToNearest(2),
253:Ceiling_LowerToLowest(2),
254:Ceiling_LowerToFloor(2),
252:Ceiling_RaiseToNearest(2,3),
253:Ceiling_LowerToLowest(2,4),
254:Ceiling_LowerToFloor(2,4),
255:Ceiling_CrushRaiseAndStaySilA(4,5),
// These are specialized versions of the Generic_* specials which are defined for EE Extradata.
256:Floor_LowerToHighestEE(2, 3),
257:Floor_RaiseToLowest(2, 3),
258:Floor_LowerToLowestCeiling(2,3),
259:Floor_RaiseToCeiling(2, 4),
260:Floor_ToCeilingInstant(1, 3),
261:Floor_LowerByTexture(2, 3),
262:Ceiling_RaiseToHighest(2, 3),
263:Ceiling_ToHighestInstant(1, 3),
264:Ceiling_LowerToNearest(2, 4),
265:Ceiling_RaiseToLowest(2, 3),
266:Ceiling_RaiseToHighestFloor(2, 3),
267:Ceiling_ToFloorInstant(1, 3),
268:Ceiling_RaiseByTexture(2, 3),
269:Ceiling_LowerByTexture(2, 4),
270:Stairs_BuildDownDoom(5),
271:Stairs_BuildUpDoomSync(4),
272:Stairs_BuildDownDoomSync(4),
// internal functions have negative values
-1:GetLineUDMFInt(2),

View file

@ -408,7 +408,7 @@ namespace CodeImp.DoomBuilder.Controls
int index = list.SelectedItems[0].Index;
int targetindex = -1;
ListViewGroup startgroup = list.SelectedItems[0].Group;
Rectangle startrect = list.GetItemRect(index, ItemBoundsPortion.Entire);
Rectangle startrect = list.SelectedItems[0].GetBounds(ItemBoundsPortion.Entire);
switch(dir)
{
@ -446,11 +446,15 @@ namespace CodeImp.DoomBuilder.Controls
case SearchDirectionHint.Up:
while(--index > -1)
{
Rectangle rect = list.GetItemRect(index, ItemBoundsPortion.Entire);
if(list.Items[index].Group == startgroup && rect.X == startrect.X && rect.Y < startrect.Y)
ListViewItem item = list.Items[index];
if(item != null && item.Group == startgroup)
{
targetindex = index;
break;
Rectangle rect = item.GetBounds(ItemBoundsPortion.Entire);
if(rect.X == startrect.X && rect.Y < startrect.Y)
{
targetindex = index;
break;
}
}
}
break;
@ -461,11 +465,15 @@ namespace CodeImp.DoomBuilder.Controls
{
while(++index < list.Items.Count)
{
Rectangle rect = list.GetItemRect(index, ItemBoundsPortion.Entire);
if(list.Items[index].Group == startgroup && rect.X == startrect.X && rect.Y > startrect.Y)
ListViewItem item = list.Items[index];
if(item != null && item.Group == startgroup)
{
targetindex = index;
break;
Rectangle rect = item.GetBounds(ItemBoundsPortion.Entire);
if(rect.X == startrect.X && rect.Y > startrect.Y)
{
targetindex = index;
break;
}
}
}
}

View file

@ -125,17 +125,26 @@ namespace CodeImp.DoomBuilder.Data
catch(Exception e)
{
// Unable to make bitmap
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image '" + this.Name + "'. " + e.GetType().Name + ": " + e.Message);
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message);
loadfailed = true;
}
int missingpatches = 0; //mxd
if(!loadfailed)
if(patches.Count == 0) //mxd
{
// No patches!
General.ErrorLogger.Add(ErrorType.Warning, "No patches are defined for texture \"" + this.Name + "\"");
loadfailed = true;
}
else if(!loadfailed)
{
// Go for all patches
foreach(TexturePatch p in patches)
{
//mxd. Some patches (like "TNT1A0") should be skipped
if(p.skip) continue;
// Get the patch data stream
Stream patchdata = General.Map.Data.GetPatchData(p.lumpname, p.haslongname);
@ -161,7 +170,7 @@ namespace CodeImp.DoomBuilder.Data
if(reader is UnknownImageReader)
{
// Data is in an unknown format!
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'");
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\"");
missingpatches++; //mxd
}
}
@ -175,7 +184,7 @@ namespace CodeImp.DoomBuilder.Data
catch(InvalidDataException)
{
// Data cannot be read!
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'");
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\"");
missingpatches++; //mxd
}
@ -217,7 +226,7 @@ namespace CodeImp.DoomBuilder.Data
}
// Missing a patch lump!
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump '" + p.lumpname + "' while loading texture '" + this.Name + "'");
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump \"" + p.lumpname + "\" while loading texture \"" + this.Name + "\"");
missingpatches++; //mxd
}
}
@ -282,7 +291,7 @@ namespace CodeImp.DoomBuilder.Data
}
catch(Exception e)
{
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + p.lumpname + "' for alpha adjustment. " + e.GetType().Name + ": " + e.Message);
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + p.lumpname + "\" for alpha adjustment. " + e.GetType().Name + ": " + e.Message);
}
if(bmpdata != null)
@ -347,7 +356,7 @@ namespace CodeImp.DoomBuilder.Data
}
catch(Exception e)
{
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock texture '" + this.Name + "' to apply render style. " + e.GetType().Name + ": " + e.Message);
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock texture \"" + this.Name + "\" to apply render style. " + e.GetType().Name + ": " + e.Message);
}
if(texturebmpdata != null)

View file

@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.Data
public readonly TexturePathRenderStyle style;
public readonly TexturePathBlendStyle blendstyle; //mxd
public readonly float tintammount;//mxd
public readonly bool skip; //mxd
// Constructor for simple patches
public TexturePatch(string lumpname, int x, int y)
@ -76,6 +77,7 @@ namespace CodeImp.DoomBuilder.Data
this.blendstyle = TexturePathBlendStyle.None;//mxd
this.tintammount = 0; //mxd
this.haslongname = false; //mxd
this.skip = false; //mxd
}
//mxd. Constructor for hires patches
@ -94,6 +96,7 @@ namespace CodeImp.DoomBuilder.Data
this.blendstyle = patch.BlendStyle;
this.tintammount = patch.TintAmmount;
this.haslongname = (Path.GetFileNameWithoutExtension(this.lumpname) != this.lumpname);
this.skip = patch.Skip;
//mxd. Check data so we don't perform unneeded operations later on
if(this.alpha == 1.0f)

View file

@ -67,8 +67,7 @@ namespace CodeImp.DoomBuilder.Windows
// This copies the version number to clipboard
private void copyversion_Click(object sender, EventArgs e)
{
Clipboard.Clear();
Clipboard.SetText(Application.ProductVersion);
Clipboard.SetDataObject(Application.ProductVersion, true, 5, 200); //mxd
}
}
}

View file

@ -30,23 +30,27 @@ namespace CodeImp.DoomBuilder.ZDoom
{
#region ================== Constants
// Some odd things in ZDoom
private const string IGNORE_SPRITE = "TNT1A0";
#endregion
#region ================== Variables
// Declaration
private string name;
private int offsetx;
private int offsety;
private bool flipx;
private bool flipy;
private float alpha;
private int rotation; //mxd
private TexturePathRenderStyle renderStyle; //mxd
private PixelColor blendColor; //mxd
private TexturePathBlendStyle blendStyle; //mxd
private float tintAmmount; //mxd
private static string[] renderStyles = { "copy", "translucent", "add", "subtract", "reversesubtract", "modulate", "copyalpha", "copynewalpha", "overlay" }; //mxd
private readonly string name;
private readonly int offsetx;
private readonly int offsety;
private readonly bool flipx;
private readonly bool flipy;
private readonly float alpha;
private readonly int rotation; //mxd
private readonly TexturePathRenderStyle renderStyle; //mxd
private readonly PixelColor blendColor; //mxd
private readonly TexturePathBlendStyle blendStyle; //mxd
private readonly float tintAmmount; //mxd
private static readonly string[] renderStyles = { "copy", "translucent", "add", "subtract", "reversesubtract", "modulate", "copyalpha", "copynewalpha", "overlay" }; //mxd
private readonly bool skip; //mxd
#endregion
@ -63,6 +67,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public TexturePathBlendStyle BlendStyle { get { return blendStyle; } }
public float TintAmmount { get { return tintAmmount; } }
public PixelColor BlendColor { get { return blendColor; } }//mxd
public bool Skip { get { return skip; } } //mxd
#endregion
@ -88,6 +93,9 @@ namespace CodeImp.DoomBuilder.ZDoom
return;
}
//mxd. Skip what must be skipped
skip = (name.ToUpperInvariant() == IGNORE_SPRITE);
//mxd
name = name.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);

View file

@ -28,9 +28,6 @@ namespace CodeImp.DoomBuilder.ZDoom
{
#region ================== Constants
// Some odd thing in ZDoom
private const string IGNORE_SPRITE = "TNT1A0";
#endregion
#region ================== Variables
@ -169,9 +166,6 @@ namespace CodeImp.DoomBuilder.ZDoom
PatchStructure pt = new PatchStructure(parser);
if(parser.HasError) break;
//mxd. Let's ignore TNT1A0
if(pt.Name == IGNORE_SPRITE) break;
// Add the patch
patches.Add(pt);
break;
@ -200,7 +194,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// Try parsing as value
if(!float.TryParse(strvalue, NumberStyles.Float, CultureInfo.InvariantCulture, out value))
{
parser.ReportError("Expected numeric value for property '" + propertyname + "'");
parser.ReportError("Expected numeric value for property \"" + propertyname + "\"");
return false;
}
@ -209,7 +203,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
// Can't find the property value!
parser.ReportError("Expected a value for property '" + propertyname + "'");
parser.ReportError("Expected a value for property \"" + propertyname + "\"");
value = 0.0f;
return false;
}
@ -225,7 +219,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// Try parsing as value
if(!int.TryParse(strvalue, NumberStyles.Integer, CultureInfo.InvariantCulture, out value))
{
parser.ReportError("Expected integral value for property '" + propertyname + "'");
parser.ReportError("Expected integral value for property \"" + propertyname + "\"");
return false;
}
@ -234,7 +228,7 @@ namespace CodeImp.DoomBuilder.ZDoom
}
// Can't find the property value!
parser.ReportError("Expected a value for property '" + propertyname + "'");
parser.ReportError("Expected a value for property \"" + propertyname + "\"");
value = 0;
return false;
}

View file

@ -749,7 +749,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(ErrorResult result in results.SelectedItems) sb.AppendLine(result.ToString());
// Set on clipboard
Clipboard.SetText(sb.ToString());
Clipboard.SetDataObject(sb.ToString(), true, 5, 200); //mxd
// Inform the user
General.Interface.DisplayStatus(StatusType.Info, "Analysis results copied to clipboard.");

View file

@ -35,14 +35,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Variables
private BaseVisualMode mode;
private readonly BaseVisualMode mode;
private VisualFloor floor;
private VisualCeiling ceiling;
private List<VisualFloor> extrafloors;
private List<VisualCeiling> extraceilings;
private List<VisualFloor> extrabackfloors; //mxd
private List<VisualCeiling> extrabackceilings; //mxd
private readonly List<VisualFloor> extrabackfloors; //mxd
private readonly List<VisualCeiling> extrabackceilings; //mxd
private Dictionary<Sidedef, VisualSidedefParts> sides;
// If this is set to true, the sector will be rebuilt after the action is performed.
@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(mode.VisualSectorExists(s.Key))
{
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s.Key);
vs.UpdateSectorGeometry(s.Value);
vs.Changed = true;
}
}

View file

@ -113,6 +113,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
Effect3DFloor e = new Effect3DFloor(this, sourcelinedef);
extrafloors.Add(e);
alleffects.Add(e);
//mxd. Extrafloor neighbours should be updated when extrafloor is changed
foreach(Sidedef sd in this.Sector.Sidedefs)
{
if(sd.Other != null && sd.Other.Sector != null)
AddUpdateSector(sd.Other.Sector, false);
}
}
// Brightness level effect