Added: GLDEFS support for 'attenuate 1' keyword

This commit is contained in:
ZZYZX 2017-01-20 00:27:36 +02:00
parent 30a5edfdfe
commit 49f55120ad
5 changed files with 27 additions and 9 deletions

View file

@ -10,11 +10,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
public int SecondaryRadius;
public int Interval;
public Vector3 Offset;
public bool Subtractive;
public DynamicLightRenderStyle Style;
public bool DontLightSelf;
public DynamicLightData()
{
Style = DynamicLightRenderStyle.NORMAL;
Color = new Color3();
Offset = new Vector3();
}

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2836")]
[assembly: AssemblyVersion("2.3.0.2837")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("819ef64")]
[assembly: AssemblyHash("30a5edf")]

View file

@ -737,7 +737,7 @@ namespace CodeImp.DoomBuilder.VisualModes
DynamicLightData light = General.Map.Data.GldefsEntries[thing.Type];
//apply settings
lightRenderStyle = light.Subtractive ? DynamicLightRenderStyle.NEGATIVE : DynamicLightRenderStyle.NORMAL;
lightRenderStyle = light.Style;
lightColor = new Color4((float)lightRenderStyle / 100.0f, light.Color.Red, light.Color.Green, light.Color.Blue);
Vector2D o = new Vector2D(light.Offset.X, light.Offset.Y).GetRotated(thing.Angle - Angle2D.PIHALF);
lightOffset = new Vector3(o.x, o.y, light.Offset.Z);

View file

@ -303,7 +303,24 @@ namespace CodeImp.DoomBuilder.ZDoom
return false;
}
light.Subtractive = (i == 1);
if (i == 1) light.Style = DynamicLightRenderStyle.NEGATIVE;
}
break;
case "attenuate":
{
SkipWhitespace(true);
token = ReadToken();
int i;
if (!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out i))
{
// Not numeric!
ReportError("expected Attenuate value, but got \"" + token + "\"");
return false;
}
if (i == 1) light.Style = DynamicLightRenderStyle.ATTENUATED;
}
break;

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2836")]
[assembly: AssemblyVersion("2.3.0.2837")]
[assembly: NeutralResourcesLanguageAttribute("en")]