diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index e75046695f48771848a6d3532ce129f966f633c7..e0938d0551a240d85ac53279c1a0b0eec8be080e 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -103,6 +103,8 @@ namespace CodeImp.DoomBuilder.Config private bool gzDrawFog; private bool gzToolbarGZDoom; private int gzMaxDynamicLights; + private float gzDynamicLightRadius; + private float gzDynamicLightIntensity; // These are not stored in the configuration, only used at runtime private string defaulttexture; @@ -175,6 +177,8 @@ namespace CodeImp.DoomBuilder.Config public bool GZDrawFog { get { return gzDrawFog; } internal set { gzDrawFog = value; } } public bool GZToolbarGZDoom { get { return gzToolbarGZDoom; } internal set { gzToolbarGZDoom = value; } } public int GZMaxDynamicLights { get { return gzMaxDynamicLights; } internal set { gzMaxDynamicLights = value; } } + public float GZDynamicLightRadius { get { return gzDynamicLightRadius; } internal set { gzDynamicLightRadius = value; } } + public float GZDynamicLightIntensity { get { return gzDynamicLightIntensity; } internal set { gzDynamicLightIntensity = value; } } public string DefaultTexture { get { return defaulttexture; } set { defaulttexture = value; } } public string DefaultFloorTexture { get { return defaultfloortexture; } set { defaultfloortexture = value; } } @@ -264,6 +268,8 @@ namespace CodeImp.DoomBuilder.Config gzDrawFog = cfg.ReadSetting("gzdrawfog", false); gzToolbarGZDoom = cfg.ReadSetting("gztoolbargzdoom", true); gzMaxDynamicLights = cfg.ReadSetting("gzmaxdynamiclights", 16); + gzDynamicLightRadius = cfg.ReadSetting("gzdynamiclightradius", 1.0f); + gzDynamicLightIntensity = cfg.ReadSetting("gzdynamiclightintensity", 1.0f); // Success return true; @@ -334,6 +340,8 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("gzanimatelights", gzAnimateLights); cfg.WriteSetting("gzdrawfog", gzDrawFog); cfg.WriteSetting("gzmaxdynamiclights", gzMaxDynamicLights); + cfg.WriteSetting("gzdynamiclightradius", gzDynamicLightRadius); + cfg.WriteSetting("gzdynamiclightintensity", gzDynamicLightIntensity); // Save settings configuration General.WriteLogLine("Saving program configuration..."); diff --git a/Source/Core/GZBuilder/Data/GZDoomLight.cs b/Source/Core/GZBuilder/Data/GZDoomLight.cs index 895cab63587b6c432145a6b713501469740442f8..c680c4ae6e476967006c37ab14dc4ee3ec80e0e4 100644 --- a/Source/Core/GZBuilder/Data/GZDoomLight.cs +++ b/Source/Core/GZBuilder/Data/GZDoomLight.cs @@ -28,7 +28,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data //divide these by 100 to get light color alpha public enum GZDoomLightRenderStyle : int { - NORMAL = 75, + NORMAL = 99, + VAVOOM = 50, ADDITIVE = 25, NEGATIVE = 100 } diff --git a/Source/Core/GZBuilder/GZGeneral.cs b/Source/Core/GZBuilder/GZGeneral.cs index 3a7ab838e5e901b5df30172a38bdcfe2460908d1..523898e803826b4f889ee5dec11f61414093d631 100644 --- a/Source/Core/GZBuilder/GZGeneral.cs +++ b/Source/Core/GZBuilder/GZGeneral.cs @@ -30,7 +30,7 @@ namespace CodeImp.DoomBuilder.GZBuilder public static int[] GZ_LIGHT_TYPES { get { return gz_lightTypes; } } //version - public const string Version = "1.03"; + public const string Version = "1.04"; //debug form #if DEBUG diff --git a/Source/Core/Rendering/Renderer3D.cs b/Source/Core/Rendering/Renderer3D.cs index d06abc12202373001217d3c5099aeea7c6c734bd..57f0cf82b7abc8c05e2244c22082662d7393391d 100644 --- a/Source/Core/Rendering/Renderer3D.cs +++ b/Source/Core/Rendering/Renderer3D.cs @@ -598,8 +598,8 @@ namespace CodeImp.DoomBuilder.Rendering thingsWithLight.Sort(sortThingsByLightRenderStyle); lightOffsets = new int[3]; foreach (VisualThing t in thingsWithLight) { - //add light to apropriate array. can't clear lights now, since it's Count is used to check if dynamic light rendering pass is needed and I don't want to add special variable for that... - if (t.LightRenderStyle == (int)GZDoomLightRenderStyle.NORMAL) + //add light to apropriate array. + if (t.LightRenderStyle == (int)GZDoomLightRenderStyle.NORMAL || t.LightRenderStyle == (int)GZDoomLightRenderStyle.VAVOOM) lightOffsets[0]++; else if (t.LightRenderStyle == (int)GZDoomLightRenderStyle.ADDITIVE) lightOffsets[1]++; @@ -906,9 +906,6 @@ namespace CodeImp.DoomBuilder.Rendering for (i = 0; i < count; i++) { if (checkBBoxIntersection(g.BoundingBox, lights[i].BoundingBox)) { - //dbg - //totalGeo++; - lpr = lights[i].LightPositionAndRadius; if (lpr.W == 0) continue; @@ -927,9 +924,6 @@ namespace CodeImp.DoomBuilder.Rendering for (i = lightOffsets[0]; i < count; i++) { if (checkBBoxIntersection(g.BoundingBox, lights[i].BoundingBox)) { - //dbg - //totalGeo++; - lpr = lights[i].LightPositionAndRadius; if (lpr.W == 0) continue; @@ -948,14 +942,11 @@ namespace CodeImp.DoomBuilder.Rendering for (i = lightOffsets[0] + lightOffsets[1]; i < count; i++) { if (checkBBoxIntersection(g.BoundingBox, lights[i].BoundingBox)) { - //dbg - //totalGeo++; - lpr = lights[i].LightPositionAndRadius; if (lpr.W == 0) continue; Color4 lc = lights[i].LightColor; - graphics.Shaders.World3D.LightColor = new Color4(1.0f, (lc.Green + lc.Blue) / 2, (lc.Red + lc.Blue) / 2, (lc.Green + lc.Red) / 2); + graphics.Shaders.World3D.LightColor = new Color4(lc.Alpha, (lc.Green + lc.Blue) / 2, (lc.Red + lc.Blue) / 2, (lc.Green + lc.Red) / 2); graphics.Shaders.World3D.LightPositionAndRadius = lights[i].LightPositionAndRadius; graphics.Shaders.World3D.ApplySettings(); graphics.Device.DrawPrimitives(PrimitiveType.TriangleList, g.VertexOffset, g.Triangles); @@ -1036,8 +1027,8 @@ namespace CodeImp.DoomBuilder.Rendering //so use visualThing.PositionV3 instead private Color4 getLitColor(Vector3 thingPosition) { Color4 litColor = new Color4(); - float distSquared, scaler; - int radius, radiusSquared, sign; + float radius, radiusSquared, distSquared, scaler; + int sign; for (int i = 0; i < thingsWithLight.Count; i++ ) { distSquared = Vector3.DistanceSquared(thingsWithLight[i].Center, thingPosition); @@ -1045,7 +1036,7 @@ namespace CodeImp.DoomBuilder.Rendering radiusSquared = radius * radius; if (distSquared < radiusSquared) { sign = thingsWithLight[i].LightRenderStyle == (int)GZDoomLightRenderStyle.NEGATIVE ? -1 : 1; - scaler = 1 - distSquared / radiusSquared; + scaler = 1 - distSquared / radiusSquared * thingsWithLight[i].LightColor.Alpha; litColor.Red += thingsWithLight[i].LightColor.Red * scaler * sign; litColor.Green += thingsWithLight[i].LightColor.Green * scaler * sign; litColor.Blue += thingsWithLight[i].LightColor.Blue * scaler * sign; @@ -1209,39 +1200,39 @@ namespace CodeImp.DoomBuilder.Rendering public void RenderCrosshair() { // Set renderstates - graphics.Device.SetRenderState(RenderState.CullMode, Cull.None); - graphics.Device.SetRenderState(RenderState.ZEnable, false); - graphics.Device.SetRenderState(RenderState.AlphaBlendEnable, true); - graphics.Device.SetRenderState(RenderState.AlphaTestEnable, false); - graphics.Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); - graphics.Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha); - graphics.Device.SetRenderState(RenderState.TextureFactor, -1); - graphics.Device.SetTransform(TransformState.World, Matrix.Identity); - graphics.Device.SetTransform(TransformState.Projection, Matrix.Identity); - ApplyMatrices2D(); + graphics.Device.SetRenderState(RenderState.CullMode, Cull.None); + graphics.Device.SetRenderState(RenderState.ZEnable, false); + graphics.Device.SetRenderState(RenderState.AlphaBlendEnable, true); + graphics.Device.SetRenderState(RenderState.AlphaTestEnable, false); + graphics.Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); + graphics.Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha); + graphics.Device.SetRenderState(RenderState.TextureFactor, -1); + graphics.Device.SetTransform(TransformState.World, Matrix.Identity); + graphics.Device.SetTransform(TransformState.Projection, Matrix.Identity); + ApplyMatrices2D(); - // Texture - if(crosshairbusy) - { - if(General.Map.Data.CrosshairBusy3D.Texture == null) General.Map.Data.CrosshairBusy3D.CreateTexture(); - graphics.Device.SetTexture(0, General.Map.Data.CrosshairBusy3D.Texture); - graphics.Shaders.Display2D.Texture1 = General.Map.Data.CrosshairBusy3D.Texture; - } - else - { - if(General.Map.Data.Crosshair3D.Texture == null) General.Map.Data.Crosshair3D.CreateTexture(); - graphics.Device.SetTexture(0, General.Map.Data.Crosshair3D.Texture); - graphics.Shaders.Display2D.Texture1 = General.Map.Data.Crosshair3D.Texture; - } + // Texture + if(crosshairbusy) + { + if(General.Map.Data.CrosshairBusy3D.Texture == null) General.Map.Data.CrosshairBusy3D.CreateTexture(); + graphics.Device.SetTexture(0, General.Map.Data.CrosshairBusy3D.Texture); + graphics.Shaders.Display2D.Texture1 = General.Map.Data.CrosshairBusy3D.Texture; + } + else + { + if(General.Map.Data.Crosshair3D.Texture == null) General.Map.Data.Crosshair3D.CreateTexture(); + graphics.Device.SetTexture(0, General.Map.Data.Crosshair3D.Texture); + graphics.Shaders.Display2D.Texture1 = General.Map.Data.Crosshair3D.Texture; + } - // Draw - graphics.Shaders.Display2D.Begin(); - graphics.Shaders.Display2D.SetSettings(1.0f, 1.0f, 0.0f, 1.0f, true); - graphics.Shaders.Display2D.BeginPass(1); - graphics.Device.DrawUserPrimitives<FlatVertex>(PrimitiveType.TriangleStrip, 0, 2, crosshairverts); - graphics.Shaders.Display2D.EndPass(); - graphics.Shaders.Display2D.End(); - } + // Draw + graphics.Shaders.Display2D.Begin(); + graphics.Shaders.Display2D.SetSettings(1.0f, 1.0f, 0.0f, 1.0f, true); + graphics.Shaders.Display2D.BeginPass(1); + graphics.Device.DrawUserPrimitives<FlatVertex>(PrimitiveType.TriangleStrip, 0, 2, crosshairverts); + graphics.Shaders.Display2D.EndPass(); + graphics.Shaders.Display2D.End(); + } // This switches fog on and off public void SetFogMode(bool usefog) diff --git a/Source/Core/Resources/Splash3_trans.png b/Source/Core/Resources/Splash3_trans.png index 4e2ca777deb1bd95650ce518cefa7c1eaa3840a8..e57db6f847aa9f9e73ae427c117db05576c58aea 100644 Binary files a/Source/Core/Resources/Splash3_trans.png and b/Source/Core/Resources/Splash3_trans.png differ diff --git a/Source/Core/Resources/world3d.fx b/Source/Core/Resources/world3d.fx index 983440391cbf851757c6e8e3c0ba5ad2312d330d..d07d34f40352ecb5efa82712b656123693e594f7 100644 --- a/Source/Core/Resources/world3d.fx +++ b/Source/Core/Resources/world3d.fx @@ -153,9 +153,9 @@ float4 ps_constant_color(PixelData pd) : COLOR { //mxd. dynamic light pixel shader pass, dood! float4 ps_lightpass(LitPixelData pd) : COLOR { //is face facing away from light source? - if(dot(pd.normal, (lightPosAndRadius.xyz - pd.pos_w)) <= 0) // (lightPosAndRadius.xyz - pd.pos_w) == direction from light to current pixel + if(dot(pd.normal, (lightPosAndRadius.xyz - pd.pos_w)) < -0.1f) // (lightPosAndRadius.xyz - pd.pos_w) == direction from light to current pixel clip(-1); - + //is pixel in light range? float dist = distance(pd.pos_w, lightPosAndRadius.xyz); if(dist > lightPosAndRadius.w) @@ -171,11 +171,9 @@ float4 ps_lightpass(LitPixelData pd) : COLOR { lightColorMod.rgb = lightColor.rgb * max(lightPosAndRadius.w - dist, 0.0f) / lightPosAndRadius.w; if(lightColorMod.r > 0.0f || lightColorMod.g > 0.0f || lightColorMod.b > 0.0f){ - if(lightColor.a == 1.0f){ //Normal or negative light - lightColorMod.rgb *= 0.9f; + lightColorMod.rgb *= lightColor.a; + if(lightColor.a > 0.4f) //Normal, vavoom or negative light return tcolor * lightColorMod; - } - lightColorMod.rgb *= 0.25f; return lightColorMod; //Additive light } clip(-1); @@ -226,7 +224,7 @@ technique SM20 { VertexShader = compile vs_2_0 vs_customvertexcolor(); PixelShader = compile ps_2_0 ps_main_highlight(); } - + // Full brightness mode with highlight pass p7 { VertexShader = compile vs_2_0 vs_customvertexcolor(); diff --git a/Source/Core/VisualModes/VisualThing.cs b/Source/Core/VisualModes/VisualThing.cs index eb643936fae85188791cb3dab6c225018df85868..3195846c4d3020347e055ea9d43e1b3cec9df6ab 100644 --- a/Source/Core/VisualModes/VisualThing.cs +++ b/Source/Core/VisualModes/VisualThing.cs @@ -87,9 +87,9 @@ namespace CodeImp.DoomBuilder.VisualModes private int lightType; private int lightRenderStyle; private Color4 lightColor; - private int lightRadius; //current radius. used in light animation - private int lightRadiusMin; - private int lightRadiusMax; + private float lightRadius; //current radius. used in light animation + private float lightRadiusMin; + private float lightRadiusMax; private Vector3 position_v3; private float lightDelta; //used in light animation private Vector3[] boundingBox; @@ -119,7 +119,7 @@ namespace CodeImp.DoomBuilder.VisualModes public Vector3[] BoundingBox { get { return boundingBox; } } //mxd. light properties public int LightType { get { return lightType; } } - public int LightRadius { get { return lightRadius; } } + public float LightRadius { get { return lightRadius; } } public int LightRenderStyle { get { return lightRenderStyle; } } public Color4 LightColor { get { return lightColor; } } public Vector4 LightPositionAndRadius { get { return new Vector4(Center, lightRadius);} } @@ -353,45 +353,48 @@ namespace CodeImp.DoomBuilder.VisualModes //mxd update light info private void updateLight(int light_id) { + float scaled_intensity = 255.0f / General.Settings.GZDynamicLightIntensity; + if (light_id < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[2]) { //if it's gzdoom light int n; if (light_id < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[0]) { n = 0; lightRenderStyle = (int)GZDoomLightRenderStyle.NORMAL; //lightColor.Alpha used in shader to perform some calculations based on light type - lightColor = new Color4(1.0f, (float)thing.Args[0] / 255, (float)thing.Args[1] / 255, (float)thing.Args[2] / 255); + lightColor = new Color4((float)lightRenderStyle / 100.0f, (float)thing.Args[0] / scaled_intensity, (float)thing.Args[1] / scaled_intensity, (float)thing.Args[2] / scaled_intensity); } else if (light_id < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[1]) { n = 10; lightRenderStyle = (int)GZDoomLightRenderStyle.ADDITIVE; - lightColor = new Color4(0.0f, (float)thing.Args[0] / 255, (float)thing.Args[1] / 255, (float)thing.Args[2] / 255); + lightColor = new Color4((float)lightRenderStyle / 100.0f, (float)thing.Args[0] / scaled_intensity, (float)thing.Args[1] / scaled_intensity, (float)thing.Args[2] / scaled_intensity); } else { n = 20; lightRenderStyle = (int)GZDoomLightRenderStyle.NEGATIVE; - lightColor = new Color4(1.0f, (float)thing.Args[0] / 255, (float)thing.Args[1] / 255, (float)thing.Args[2] / 255); + lightColor = new Color4((float)lightRenderStyle / 100.0f, (float)thing.Args[0] / scaled_intensity, (float)thing.Args[1] / scaled_intensity, (float)thing.Args[2] / scaled_intensity); } lightType = thing.Type - 9800 - n; if (lightType == (int)GZDoomLightType.SECTOR) { - lightRadiusMin = thing.Args[3] * 4; + lightRadiusMin = (float)(thing.Args[3] * 4) * General.Settings.GZDynamicLightRadius; } else { - lightRadiusMin = thing.Args[3] * 2; //works... that.. way in GZDoom - if (lightType > 0) - lightRadiusMax = thing.Args[4] * 2; - - if (lightRadiusMin > lightRadiusMax) { //swap them - int lrm = lightRadiusMin; - lightRadiusMin = lightRadiusMax; - lightRadiusMax = lrm; + lightRadiusMin = (float)(thing.Args[3] * 2) * General.Settings.GZDynamicLightRadius; //works... that.. way in GZDoom + if (lightType > 0) { + lightRadiusMax = (float)(thing.Args[4] * 2) * General.Settings.GZDynamicLightRadius; + + if (lightRadiusMin > lightRadiusMax) { //swap them + float lrm = lightRadiusMin; + lightRadiusMin = lightRadiusMax; + lightRadiusMax = lrm; + } } } } else { //it's one of vavoom lights - lightRenderStyle = (int)GZDoomLightRenderStyle.NORMAL; + lightRenderStyle = (int)GZDoomLightRenderStyle.VAVOOM; lightType = thing.Type; if (lightType == (int)GZDoomLightType.VAVOOM_COLORED) - lightColor = new Color4((float)lightRenderStyle / 100.0f, (float)thing.Args[1] / 255, (float)thing.Args[2] / 255, (float)thing.Args[3] / 255); + lightColor = new Color4((float)lightRenderStyle / 100.0f, (float)thing.Args[1] / scaled_intensity, (float)thing.Args[2] / scaled_intensity, (float)thing.Args[3] / scaled_intensity); else - lightColor = new Color4((float)lightRenderStyle / 100.0f, 1.0f, 1.0f, 1.0f); - lightRadiusMin = thing.Args[0] * 4; + lightColor = new Color4((float)lightRenderStyle / 100.0f, General.Settings.GZDynamicLightIntensity, General.Settings.GZDynamicLightIntensity, General.Settings.GZDynamicLightIntensity); + lightRadiusMin = (float)(thing.Args[0] * 8) * General.Settings.GZDynamicLightRadius; } UpdateLightRadius(); } @@ -411,9 +414,8 @@ namespace CodeImp.DoomBuilder.VisualModes return; } - //if (lightRadiusMax < lightRadiusMin) lightRadiusMax = lightRadiusMin; double time = General.Clock.GetCurrentTime(); - int diff = lightRadiusMax - lightRadiusMin; + float diff = lightRadiusMax - lightRadiusMin; //pulse if (lightType == (int)GZDoomLightType.PULSE) { @@ -436,16 +438,16 @@ namespace CodeImp.DoomBuilder.VisualModes } else if (lightType == (int)GZDoomLightType.RANDOM) { float delta = (float)Math.Sin(time / (100.0f * thing.Angle * 4.6f)); //just playing by the eye here... if (Math.Sign(delta) != Math.Sign(lightDelta)) - lightRadius = lightRadiusMin + new Random().Next(0, diff); + lightRadius = lightRadiusMin + (float)(new Random().Next(0, (int)(diff * 10))) / 10.0f; lightDelta = delta; } } //mxd. update bounding box - public void UpdateBoundingBox(int width, int height) { + public void UpdateBoundingBox(float width, float height) { boundingBox = new Vector3[9]; boundingBox[0] = Center; - int h2 = height / 2; + float h2 = height / 2.0f; boundingBox[1] = new Vector3(position_v3.X - width, position_v3.Y - width, Center.Z - h2); boundingBox[2] = new Vector3(position_v3.X + width, position_v3.Y - width, Center.Z - h2); diff --git a/Source/Core/Windows/PreferencesForm.Designer.cs b/Source/Core/Windows/PreferencesForm.Designer.cs index 944db075b859f4aa9c83c63319aa8c3f2a892690..f70914407f89d81d82fad6a2940e72878256d4e9 100644 --- a/Source/Core/Windows/PreferencesForm.Designer.cs +++ b/Source/Core/Windows/PreferencesForm.Designer.cs @@ -35,6 +35,8 @@ namespace CodeImp.DoomBuilder.Windows System.Windows.Forms.GroupBox groupBox1; System.Windows.Forms.Label label1; System.Windows.Forms.Label label18; + System.Windows.Forms.Label label20; + System.Windows.Forms.Label label21; this.showtexturesizes = new System.Windows.Forms.CheckBox(); this.scriptontop = new System.Windows.Forms.CheckBox(); this.zoomfactor = new Dotnetrix.Controls.TrackBar(); @@ -113,6 +115,8 @@ namespace CodeImp.DoomBuilder.Windows this.actiondescription = new System.Windows.Forms.Label(); this.tabcolors = new System.Windows.Forms.TabPage(); this.appearancegroup1 = new System.Windows.Forms.GroupBox(); + this.labelDynLightSize = new System.Windows.Forms.Label(); + this.tbDynLightSize = new Dotnetrix.Controls.TrackBar(); this.labelDynLightCount = new System.Windows.Forms.Label(); this.tbDynLightCount = new Dotnetrix.Controls.TrackBar(); this.animatevisualselection = new System.Windows.Forms.CheckBox(); @@ -142,12 +146,16 @@ namespace CodeImp.DoomBuilder.Windows this.tabpasting = new System.Windows.Forms.TabPage(); this.label16 = new System.Windows.Forms.Label(); this.pasteoptions = new CodeImp.DoomBuilder.Controls.PasteOptionsControl(); + this.labelDynLightIntensity = new System.Windows.Forms.Label(); + this.tbDynLightIntensity = new Dotnetrix.Controls.TrackBar(); label7 = new System.Windows.Forms.Label(); label6 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label(); groupBox1 = new System.Windows.Forms.GroupBox(); label1 = new System.Windows.Forms.Label(); label18 = new System.Windows.Forms.Label(); + label20 = new System.Windows.Forms.Label(); + label21 = new System.Windows.Forms.Label(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.zoomfactor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.autoscrollspeed)).BeginInit(); @@ -167,11 +175,13 @@ namespace CodeImp.DoomBuilder.Windows this.actioncontrolpanel.SuspendLayout(); this.tabcolors.SuspendLayout(); this.appearancegroup1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.imagebrightness)).BeginInit(); this.colorsgroup3.SuspendLayout(); this.panel1.SuspendLayout(); this.tabpasting.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).BeginInit(); this.SuspendLayout(); // // label7 @@ -358,7 +368,7 @@ namespace CodeImp.DoomBuilder.Windows // label1 // label1.AutoSize = true; - label1.Location = new System.Drawing.Point(22, 40); + label1.Location = new System.Drawing.Point(28, 30); label1.Name = "label1"; label1.Size = new System.Drawing.Size(147, 14); label1.TabIndex = 20; @@ -368,13 +378,23 @@ namespace CodeImp.DoomBuilder.Windows // label18 // label18.AutoSize = true; - label18.Location = new System.Drawing.Point(22, 91); + label18.Location = new System.Drawing.Point(22, 78); label18.Name = "label18"; label18.Size = new System.Drawing.Size(151, 14); label18.TabIndex = 25; label18.Text = "Max. dynamic lights to render:"; label18.TextAlign = System.Drawing.ContentAlignment.TopRight; // + // label20 + // + label20.AutoSize = true; + label20.Location = new System.Drawing.Point(76, 126); + label20.Name = "label20"; + label20.Size = new System.Drawing.Size(96, 14); + label20.TabIndex = 28; + label20.Text = "Dynamic light size:"; + label20.TextAlign = System.Drawing.ContentAlignment.TopRight; + // // keyusedlabel // this.keyusedlabel.AutoSize = true; @@ -407,7 +427,7 @@ namespace CodeImp.DoomBuilder.Windows this.colorsgroup1.Controls.Add(this.colorlinedefs); this.colorsgroup1.Location = new System.Drawing.Point(8, 8); this.colorsgroup1.Name = "colorsgroup1"; - this.colorsgroup1.Size = new System.Drawing.Size(203, 472); + this.colorsgroup1.Size = new System.Drawing.Size(203, 493); this.colorsgroup1.TabIndex = 0; this.colorsgroup1.TabStop = false; this.colorsgroup1.Text = " Display "; @@ -1140,6 +1160,12 @@ namespace CodeImp.DoomBuilder.Windows this.appearancegroup1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.appearancegroup1.Controls.Add(label21); + this.appearancegroup1.Controls.Add(this.labelDynLightIntensity); + this.appearancegroup1.Controls.Add(this.tbDynLightIntensity); + this.appearancegroup1.Controls.Add(label20); + this.appearancegroup1.Controls.Add(this.labelDynLightSize); + this.appearancegroup1.Controls.Add(this.tbDynLightSize); this.appearancegroup1.Controls.Add(label18); this.appearancegroup1.Controls.Add(this.labelDynLightCount); this.appearancegroup1.Controls.Add(this.tbDynLightCount); @@ -1150,17 +1176,39 @@ namespace CodeImp.DoomBuilder.Windows this.appearancegroup1.Controls.Add(this.classicbilinear); this.appearancegroup1.Controls.Add(this.imagebrightnesslabel); this.appearancegroup1.Controls.Add(this.imagebrightness); - this.appearancegroup1.Location = new System.Drawing.Point(217, 251); + this.appearancegroup1.Location = new System.Drawing.Point(217, 236); this.appearancegroup1.Name = "appearancegroup1"; - this.appearancegroup1.Size = new System.Drawing.Size(457, 229); + this.appearancegroup1.Size = new System.Drawing.Size(457, 265); this.appearancegroup1.TabIndex = 24; this.appearancegroup1.TabStop = false; this.appearancegroup1.Text = " Additional Options "; // + // labelDynLightSize + // + this.labelDynLightSize.AutoSize = true; + this.labelDynLightSize.Location = new System.Drawing.Point(337, 126); + this.labelDynLightSize.Name = "labelDynLightSize"; + this.labelDynLightSize.Size = new System.Drawing.Size(22, 14); + this.labelDynLightSize.TabIndex = 29; + this.labelDynLightSize.Text = "1.0"; + // + // tbDynLightSize + // + this.tbDynLightSize.LargeChange = 1; + this.tbDynLightSize.Location = new System.Drawing.Point(176, 113); + this.tbDynLightSize.Maximum = 20; + this.tbDynLightSize.Minimum = 1; + this.tbDynLightSize.Name = "tbDynLightSize"; + this.tbDynLightSize.Size = new System.Drawing.Size(154, 45); + this.tbDynLightSize.TabIndex = 27; + this.tbDynLightSize.TickStyle = System.Windows.Forms.TickStyle.Both; + this.tbDynLightSize.Value = 10; + this.tbDynLightSize.ValueChanged += new System.EventHandler(this.tbDynLightSize_ValueChanged); + // // labelDynLightCount // this.labelDynLightCount.AutoSize = true; - this.labelDynLightCount.Location = new System.Drawing.Point(337, 91); + this.labelDynLightCount.Location = new System.Drawing.Point(337, 78); this.labelDynLightCount.Name = "labelDynLightCount"; this.labelDynLightCount.Size = new System.Drawing.Size(19, 14); this.labelDynLightCount.TabIndex = 26; @@ -1169,7 +1217,7 @@ namespace CodeImp.DoomBuilder.Windows // tbDynLightCount // this.tbDynLightCount.LargeChange = 3; - this.tbDynLightCount.Location = new System.Drawing.Point(176, 78); + this.tbDynLightCount.Location = new System.Drawing.Point(176, 65); this.tbDynLightCount.Maximum = 32; this.tbDynLightCount.Minimum = 1; this.tbDynLightCount.Name = "tbDynLightCount"; @@ -1183,7 +1231,7 @@ namespace CodeImp.DoomBuilder.Windows // animatevisualselection // this.animatevisualselection.AutoSize = true; - this.animatevisualselection.Location = new System.Drawing.Point(244, 165); + this.animatevisualselection.Location = new System.Drawing.Point(244, 236); this.animatevisualselection.Name = "animatevisualselection"; this.animatevisualselection.Size = new System.Drawing.Size(188, 18); this.animatevisualselection.TabIndex = 23; @@ -1193,7 +1241,7 @@ namespace CodeImp.DoomBuilder.Windows // blackbrowsers // this.blackbrowsers.AutoSize = true; - this.blackbrowsers.Location = new System.Drawing.Point(244, 135); + this.blackbrowsers.Location = new System.Drawing.Point(244, 212); this.blackbrowsers.Name = "blackbrowsers"; this.blackbrowsers.Size = new System.Drawing.Size(199, 18); this.blackbrowsers.TabIndex = 4; @@ -1203,7 +1251,7 @@ namespace CodeImp.DoomBuilder.Windows // visualbilinear // this.visualbilinear.AutoSize = true; - this.visualbilinear.Location = new System.Drawing.Point(25, 165); + this.visualbilinear.Location = new System.Drawing.Point(25, 236); this.visualbilinear.Name = "visualbilinear"; this.visualbilinear.Size = new System.Drawing.Size(176, 18); this.visualbilinear.TabIndex = 6; @@ -1213,7 +1261,7 @@ namespace CodeImp.DoomBuilder.Windows // classicbilinear // this.classicbilinear.AutoSize = true; - this.classicbilinear.Location = new System.Drawing.Point(25, 135); + this.classicbilinear.Location = new System.Drawing.Point(25, 212); this.classicbilinear.Name = "classicbilinear"; this.classicbilinear.Size = new System.Drawing.Size(182, 18); this.classicbilinear.TabIndex = 5; @@ -1223,7 +1271,7 @@ namespace CodeImp.DoomBuilder.Windows // imagebrightnesslabel // this.imagebrightnesslabel.AutoSize = true; - this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 40); + this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 30); this.imagebrightnesslabel.Name = "imagebrightnesslabel"; this.imagebrightnesslabel.Size = new System.Drawing.Size(31, 14); this.imagebrightnesslabel.TabIndex = 22; @@ -1232,7 +1280,7 @@ namespace CodeImp.DoomBuilder.Windows // imagebrightness // this.imagebrightness.LargeChange = 3; - this.imagebrightness.Location = new System.Drawing.Point(176, 27); + this.imagebrightness.Location = new System.Drawing.Point(176, 17); this.imagebrightness.Name = "imagebrightness"; this.imagebrightness.Size = new System.Drawing.Size(154, 45); this.imagebrightness.TabIndex = 3; @@ -1261,7 +1309,7 @@ namespace CodeImp.DoomBuilder.Windows this.colorsgroup3.Controls.Add(this.colorplaintext); this.colorsgroup3.Location = new System.Drawing.Point(217, 8); this.colorsgroup3.Name = "colorsgroup3"; - this.colorsgroup3.Size = new System.Drawing.Size(457, 237); + this.colorsgroup3.Size = new System.Drawing.Size(457, 222); this.colorsgroup3.TabIndex = 1; this.colorsgroup3.TabStop = false; this.colorsgroup3.Text = " Script editor "; @@ -1503,6 +1551,37 @@ namespace CodeImp.DoomBuilder.Windows this.pasteoptions.Size = new System.Drawing.Size(666, 427); this.pasteoptions.TabIndex = 0; // + // label21 + // + label21.AutoSize = true; + label21.Location = new System.Drawing.Point(55, 174); + label21.Name = "label21"; + label21.Size = new System.Drawing.Size(116, 14); + label21.TabIndex = 31; + label21.Text = "Dynamic light intensity:"; + label21.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // labelDynLightIntensity + // + this.labelDynLightIntensity.AutoSize = true; + this.labelDynLightIntensity.Location = new System.Drawing.Point(337, 174); + this.labelDynLightIntensity.Name = "labelDynLightIntensity"; + this.labelDynLightIntensity.Size = new System.Drawing.Size(22, 14); + this.labelDynLightIntensity.TabIndex = 32; + this.labelDynLightIntensity.Text = "1.0"; + // + // tbDynLightIntensity + // + this.tbDynLightIntensity.LargeChange = 1; + this.tbDynLightIntensity.Location = new System.Drawing.Point(176, 161); + this.tbDynLightIntensity.Minimum = 1; + this.tbDynLightIntensity.Name = "tbDynLightIntensity"; + this.tbDynLightIntensity.Size = new System.Drawing.Size(154, 45); + this.tbDynLightIntensity.TabIndex = 30; + this.tbDynLightIntensity.TickStyle = System.Windows.Forms.TickStyle.Both; + this.tbDynLightIntensity.Value = 10; + this.tbDynLightIntensity.ValueChanged += new System.EventHandler(this.tbDynLightIntensity_ValueChanged); + // // PreferencesForm // this.AcceptButton = this.apply; @@ -1551,12 +1630,14 @@ namespace CodeImp.DoomBuilder.Windows this.tabcolors.ResumeLayout(false); this.appearancegroup1.ResumeLayout(false); this.appearancegroup1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.imagebrightness)).EndInit(); this.colorsgroup3.ResumeLayout(false); this.colorsgroup3.PerformLayout(); this.panel1.ResumeLayout(false); this.tabpasting.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).EndInit(); this.ResumeLayout(false); } @@ -1670,5 +1751,9 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.CheckBox toolbar_gzdoom; private System.Windows.Forms.Label labelDynLightCount; private Dotnetrix.Controls.TrackBar tbDynLightCount; + private System.Windows.Forms.Label labelDynLightSize; + private Dotnetrix.Controls.TrackBar tbDynLightSize; + private System.Windows.Forms.Label labelDynLightIntensity; + private Dotnetrix.Controls.TrackBar tbDynLightIntensity; } } \ No newline at end of file diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index 3ea96ab0f60e90d71894d9bbce1d7e682fa1ed96..aee1d76b0a60e543b070b23cd5d56148d2d1e2e0 100644 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -98,6 +98,10 @@ namespace CodeImp.DoomBuilder.Windows showtexturesizes.Checked = General.Settings.ShowTextureSizes; tbDynLightCount.Value = General.Settings.GZMaxDynamicLights; labelDynLightCount.Text = General.Settings.GZMaxDynamicLights.ToString(); + tbDynLightSize.Value = (int)(General.Settings.GZDynamicLightRadius * 10); + labelDynLightSize.Text = General.Settings.GZDynamicLightRadius.ToString(); + tbDynLightIntensity.Value = (int)(General.Settings.GZDynamicLightIntensity * 10); + labelDynLightIntensity.Text = General.Settings.GZDynamicLightIntensity.ToString(); // Fill fonts list scriptfontname.BeginUpdate(); @@ -265,6 +269,8 @@ namespace CodeImp.DoomBuilder.Windows //mxd General.Settings.GZMaxDynamicLights = tbDynLightCount.Value; + General.Settings.GZDynamicLightRadius = ((float)tbDynLightSize.Value / 10.0f); + General.Settings.GZDynamicLightIntensity = ((float)tbDynLightIntensity.Value / 10.0f); // Paste options General.Settings.PasteOptions = pasteoptions.GetOptions(); @@ -757,6 +763,16 @@ namespace CodeImp.DoomBuilder.Windows labelDynLightCount.Text = tbDynLightCount.Value.ToString(); } + //mxd + private void tbDynLightSize_ValueChanged(object sender, EventArgs e) { + labelDynLightSize.Text = ((float)tbDynLightSize.Value / 10).ToString(); + } + + //mxd + private void tbDynLightIntensity_ValueChanged(object sender, EventArgs e) { + labelDynLightIntensity.Text = ((float)tbDynLightIntensity.Value / 10).ToString(); + } + #endregion // Help diff --git a/Source/Core/Windows/PreferencesForm.resx b/Source/Core/Windows/PreferencesForm.resx index 0240dae14ece8a154b47089727601b31d6873009..4d3363b7f320e8eb526aaf8d0d6237732b630934 100644 --- a/Source/Core/Windows/PreferencesForm.resx +++ b/Source/Core/Windows/PreferencesForm.resx @@ -135,4 +135,10 @@ <metadata name="label18.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </metadata> + <metadata name="label20.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> </root> \ No newline at end of file