mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Added: GLDEFS support for 'attenuate 1' keyword
This commit is contained in:
parent
30a5edfdfe
commit
49f55120ad
5 changed files with 27 additions and 9 deletions
|
@ -10,11 +10,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
public int SecondaryRadius;
|
public int SecondaryRadius;
|
||||||
public int Interval;
|
public int Interval;
|
||||||
public Vector3 Offset;
|
public Vector3 Offset;
|
||||||
public bool Subtractive;
|
public DynamicLightRenderStyle Style;
|
||||||
public bool DontLightSelf;
|
public bool DontLightSelf;
|
||||||
|
|
||||||
public DynamicLightData()
|
public DynamicLightData()
|
||||||
{
|
{
|
||||||
|
Style = DynamicLightRenderStyle.NORMAL;
|
||||||
Color = new Color3();
|
Color = new Color3();
|
||||||
Offset = new Vector3();
|
Offset = new Vector3();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.3.0.2836")]
|
[assembly: AssemblyVersion("2.3.0.2837")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute("en")]
|
[assembly: NeutralResourcesLanguageAttribute("en")]
|
||||||
[assembly: AssemblyHash("819ef64")]
|
[assembly: AssemblyHash("30a5edf")]
|
||||||
|
|
|
@ -737,7 +737,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
DynamicLightData light = General.Map.Data.GldefsEntries[thing.Type];
|
DynamicLightData light = General.Map.Data.GldefsEntries[thing.Type];
|
||||||
|
|
||||||
//apply settings
|
//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);
|
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);
|
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);
|
lightOffset = new Vector3(o.x, o.y, light.Offset.Z);
|
||||||
|
|
|
@ -303,7 +303,24 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
return false;
|
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;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -29,5 +29,5 @@ using System.Resources;
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.3.0.2836")]
|
[assembly: AssemblyVersion("2.3.0.2837")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute("en")]
|
[assembly: NeutralResourcesLanguageAttribute("en")]
|
||||||
|
|
Loading…
Reference in a new issue