Visual mode: fixed incorrect vertical texture offsets of middle parts of double sided linedefs.

ACS support: script numbers/names without space between them and script arguments (like 'script 999(void)' or 'script "test"(void)') were not parsed.
This commit is contained in:
MaxED 2013-08-07 09:25:37 +00:00
parent f35e39de01
commit 0a5ff0bdaf
4 changed files with 18 additions and 11 deletions

View file

@ -67,10 +67,17 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
//is it named script?
if (token.IndexOf('"') != -1) {
//check if we have something like '"mycoolscript"(void)' as a token
if(token.LastIndexOf('"') != token.Length - 1)
token = token.Substring(0, token.LastIndexOf('"'));
token = StripTokenQuotes(token);
ScriptItem i = new ScriptItem(0, token, startPos, (int)stream.Position-1);
namedScripts.Add(i);
} else { //should be numbered script
//check if we have something like "999(void)" as a token
if (token.Contains("(")) token = token.Substring(0, token.IndexOf("("));
int n = 0;
if (int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out n)) {
int endPos = (int)stream.Position - 1;
@ -88,7 +95,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
int commentStart = token.IndexOf("//");
if (commentStart != -1) { //found comment
commentStart += 2;
name = token.Substring(commentStart, token.Length - commentStart);
name = token.Substring(commentStart, token.Length - commentStart).Trim();
}
}

View file

@ -3130,7 +3130,7 @@ namespace CodeImp.DoomBuilder.Windows
if (!this.Disposing && blinkTimer != null) {
try {
this.Invoke(new CallBlink(blink));
} catch(ObjectDisposedException oe) { } //la-la-la. We don't care.
} catch(ObjectDisposedException) { } //la-la-la. We don't care.
}
} else {
//get rid of timer

View file

@ -183,9 +183,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Determine color
int lightlevel = lightabsolute ? lightvalue : l.brightnessbelow + lightvalue;
//mxd
//PixelColor wallbrightness = PixelColor.FromInt(mode.CalculateBrightness(lightlevel));
PixelColor wallbrightness = PixelColor.FromInt(mode.CalculateBrightness(lightlevel, Sidedef));
PixelColor wallbrightness = PixelColor.FromInt(mode.CalculateBrightness(lightlevel, Sidedef)); //mxd
PixelColor wallcolor = PixelColor.Modulate(l.colorbelow, wallbrightness);
np.color = wallcolor.WithAlpha(255).ToInt();

View file

@ -102,9 +102,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (base.Texture == null){
base.Texture = General.Map.Data.UnknownTexture3D;
setuponloadedtexture = Sidedef.LongMiddleTexture;
} else {
if (!base.Texture.IsImageLoaded)
setuponloadedtexture = Sidedef.LongMiddleTexture;
} else if (!base.Texture.IsImageLoaded) {
setuponloadedtexture = Sidedef.LongMiddleTexture;
}
} else {
// Use missing texture
@ -133,10 +132,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
float floorbias = (Sidedef.Sector.CeilHeight == Sidedef.Sector.FloorHeight) ? 1.0f : 0.0f;
float geotop = (float)Math.Min(Sidedef.Sector.CeilHeight, Sidedef.Other.Sector.CeilHeight);
float geobottom = (float)Math.Max(Sidedef.Sector.FloorHeight, Sidedef.Other.Sector.FloorHeight);
if(Sidedef.Line.IsFlagSet(General.Map.Config.LowerUnpeggedFlag)) {
// When lower unpegged is set, the middle texture is bound to the bottom
float zoffset = Sidedef.Sector.CeilHeight - Sidedef.Other.Sector.CeilHeight; //mxd
// When lower unpegged is set, the middle texture is bound to the bottom
if(Sidedef.Line.IsFlagSet(General.Map.Config.LowerUnpeggedFlag))
tp.tlt.y = tsz.y - (float)(geotop - geobottom);
}
if (zoffset > 0) tp.tlt.y -= zoffset; //mxd
tp.trb.x = tp.tlt.x + Sidedef.Line.Length;
tp.trb.y = tp.tlt.y + ((float)Sidedef.Sector.CeilHeight - ((float)Sidedef.Sector.FloorHeight + floorbias));