diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 8d5ae3447f4cb9ecf4800189ead314fdd3b8af7f..49e29fcca5d64b188391bf6dc6ee3bec55d007e6 100644 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -575,7 +575,7 @@ namespace CodeImp.DoomBuilder // Remove the previous log file and start logging if(File.Exists(logfile)) File.Delete(logfile); //mxd - General.WriteLogLine("GZDoomBuilder " + CodeImp.DoomBuilder.GZBuilder.GZGeneral.Version + " startup"); + General.WriteLogLine("GZDoom Builder " + CodeImp.DoomBuilder.GZBuilder.GZGeneral.Version + " startup"); //General.WriteLogLine("Doom Builder " + thisversion.Major + "." + thisversion.Minor + " startup"); General.WriteLogLine("Application path: " + apppath); General.WriteLogLine("Temporary path: " + temppath); diff --git a/Source/Core/Properties/AssemblyInfo.cs b/Source/Core/Properties/AssemblyInfo.cs index c5b7f5500258edf0483ce982c9b07e8a49952b34..a4baed7b79f3005617080ebdcbeb0bf2b04dfcd2 100644 --- a/Source/Core/Properties/AssemblyInfo.cs +++ b/Source/Core/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GZDoomBuilder")] +[assembly: AssemblyTitle("GZDoom Builder")] [assembly: AssemblyDescription("Doom, Heretic and Hexen map editor")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CodeImp, MaxED")] -[assembly: AssemblyProduct("GZDoomBuilder")] +[assembly: AssemblyProduct("GZDoom Builder")] [assembly: AssemblyCopyright("Copyright © 2007, 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,4 +29,4 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.1.2.0")] +[assembly: AssemblyVersion("2.1.2.1551")] diff --git a/Source/Core/Rendering/Renderer.cs b/Source/Core/Rendering/Renderer.cs index f5ef3394a7520526173e81599c0047888da5d696..85c1042319aa73e579497d8fd494a2527e8f7af3 100644 --- a/Source/Core/Rendering/Renderer.cs +++ b/Source/Core/Rendering/Renderer.cs @@ -103,7 +103,7 @@ namespace CodeImp.DoomBuilder.Rendering //mxd. This calculates wall brightness level with doom-style shading public int CalculateBrightness(int level, Sidedef sd) { - if (!General.Map.Data.MapInfo.EvenLighting && sd != null) { + if (level < 253 && !General.Map.Data.MapInfo.EvenLighting && sd != null) { //all walls are shaded by their angle if (General.Map.Data.MapInfo.SmoothLighting) { float ammount = Math.Abs((float)Math.Sin(sd.Angle)); diff --git a/Source/Core/Rendering/Renderer3D.cs b/Source/Core/Rendering/Renderer3D.cs index f34f5eb585cc29f35de0fef231123cfc37fcdbf0..9bf23a3c938cd5444bc20c96f8312eb1a285940a 100644 --- a/Source/Core/Rendering/Renderer3D.cs +++ b/Source/Core/Rendering/Renderer3D.cs @@ -996,6 +996,8 @@ namespace CodeImp.DoomBuilder.Rendering foreach (KeyValuePair<ModeldefEntry, List<VisualThing>> group in thingsWithModel) { foreach (VisualThing t in group.Value) { + t.Update(); + Color4 vertexColor = new Color4(t.VertexColor); vertexColor.Alpha = 1.0f; //check if model is affected by dynamic lights and set color accordingly @@ -1173,18 +1175,20 @@ namespace CodeImp.DoomBuilder.Rendering } } + if (!isThingOnScreen(t.BoundingBox)) { + return; + } + //mxd. gather models if (General.Settings.GZDrawModels && (!General.Settings.GZDrawSelectedModelsOnly || t.Selected) && t.Thing.IsModel) { ModeldefEntry mde = General.Map.Data.ModeldefEntries[t.Thing.Type]; - if (!isThingOnScreen(t.BoundingBox)) - return; + //if (!isThingOnScreen(t.BoundingBox)) + //return; if (!thingsWithModel.ContainsKey(mde)) thingsWithModel.Add(mde, new List<VisualThing>()); thingsWithModel[mde].Add(t); - }else if (!isThingOnScreen(t.BoundingBox)) { - return; } // Make sure the distance to camera is calculated diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 02b9491f3beeb7a2a89b07a4fd47f644e7e113bd..cc3bf2b64a360d36b3c19e92c45cad0439a2c074 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -160,6 +160,11 @@ namespace CodeImp.DoomBuilder.BuilderModes { return renderer.CalculateBrightness(level); } + + //mxd. This calculates brightness level with doom-style shading + internal int CalculateBrightness(int level, Sidedef sd) { + return renderer.CalculateBrightness(level, sd); + } // This adds a selected object internal void AddSelectedObject(IVisualEventReceiver obj) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs index d7ac497546c6504fcf321aafeb2a9843c53e939f..ddbb61abd90b73d64c88d17501d812c7116e462e 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs @@ -202,9 +202,6 @@ namespace CodeImp.DoomBuilder.BuilderModes pos.z = Thing.Sector.CeilHeight - info.Height; } } - - checkModelState(); //mxd. check model state - checkLightState(); //mxd. check gldefs light state // Apply settings SetPosition(pos); diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs index ae45660bb76b1addbce7d77d00aac2f6a988a1f3..16ad6e045102ce9995961d2ef975de7032b8facb 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs @@ -65,7 +65,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // This builds the geometry. Returns false when no geometry created. public override bool Setup() { - int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + //mxd + //int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness, Sidedef); // Calculate size of this wall part float geotop = (float)Sidedef.Other.Sector.FloorHeight; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs index f715b1bea7ee8c087f1b5f567802b82a129eea69..222841d6305df6fc28111472d7461e167ed4a4a0 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs @@ -70,7 +70,9 @@ namespace CodeImp.DoomBuilder.BuilderModes { WorldVertex[] verts; - int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + //mxd + //int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness, Sidedef); // Calculate size of this wall part float geotop = (float)Math.Min(Sidedef.Sector.CeilHeight, Sidedef.Other.Sector.CeilHeight); diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs index e5a0a625b7f173acb5dec35935326e7d7b39f062..ca66d7c6190f41adc07b07776a83e5764154fc43 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs @@ -65,7 +65,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // This builds the geometry. Returns false when no geometry created. public override bool Setup() { - int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + //mxd + //int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness, Sidedef); // Calculate size of this wall part float geotop = (float)Sidedef.Sector.CeilHeight; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs index efcf70e5afa23d69cb2eac7b1449f26adc9d33cf..8e01847de6ab9da61a4eaee911f7a2b827a1e9b3 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs @@ -65,7 +65,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // This builds the geometry. Returns false when no geometry created. public override bool Setup() { - int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + //mxd + //int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness); + int brightness = mode.CalculateBrightness(Sidedef.Sector.Brightness, Sidedef); // Calculate size of this wall part float geotop = (float)Sidedef.Sector.CeilHeight; diff --git a/Source/Plugins/GZDoomEditing/VisualModes/BaseVisualThing.cs b/Source/Plugins/GZDoomEditing/VisualModes/BaseVisualThing.cs index 8e4d02d75ba9bc487df5a10b5d1ceb1be2b6c48d..51c53f481c9794f662a6328690f62605a065d0a2 100644 --- a/Source/Plugins/GZDoomEditing/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/GZDoomEditing/VisualModes/BaseVisualThing.cs @@ -238,9 +238,6 @@ namespace CodeImp.DoomBuilder.GZDoomEditing pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height; } } - - checkModelState(); //mxd. check model state - checkLightState(); //mxd. check gldefs light state // Apply settings SetPosition(pos);