From 02b902e20cee73e1720e5acf67f45da0cb0f838b Mon Sep 17 00:00:00 2001 From: MaxED Date: Thu, 26 Feb 2015 14:42:58 +0000 Subject: [PATCH] Fixed, Visual mode: ExtraFloor_LightOnly effect transferred brightness incorrectly (I broke this in r2236). Changed, Visual mode: floors and ceilings with sky texture are now always rendered at full brightness. --- .../VisualModes/BaseVisualGeometrySidedef.cs | 2 +- .../Plugins/BuilderModes/VisualModes/VisualCeiling.cs | 10 ++++++++-- Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs | 10 ++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs index 1608623d..f19f1e7e 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs @@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { // Go for all polygons int num = polygons.Count; - Plane plane = (l.type == SectorLevelType.Ceiling ? l.plane : l.plane.GetInverted()); //mxd + Plane plane = (l.type == SectorLevelType.Floor ? l.plane.GetInverted() : l.plane); //mxd for(int pi = 0; pi < num; pi++) { diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs index eef1ceae..3fbc175c 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs @@ -117,14 +117,20 @@ namespace CodeImp.DoomBuilder.BuilderModes else texscale = new Vector2D(1.0f / 64.0f, 1.0f / 64.0f); + //mxd. Sky is always bright + int color; + if(s.CeilTexture == General.Map.Config.SkyFlatName) + color = -1; // That's white. With alpha. Not very impressive, eh? + else + color = (int)((level.color | General.Clamp(level.alpha, 0, 255) << 24) & 0xffffffff); // Byte offset shinanigans! Yay! + // Make vertices ReadOnlyCollection triverts = base.Sector.Sector.Triangles.Vertices; WorldVertex[] verts = new WorldVertex[triverts.Count]; for(int i = 0; i < triverts.Count; i++) { // Color shading - PixelColor c = PixelColor.FromInt(level.color); - verts[i].c = c.WithAlpha((byte)General.Clamp(level.alpha, 0, 255)).ToInt(); + verts[i].c = color; //mxd // Vertex coordinates verts[i].x = triverts[i].x; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs index ba2bbf9c..5546f9f9 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs @@ -119,14 +119,20 @@ namespace CodeImp.DoomBuilder.BuilderModes else texscale = new Vector2D(1.0f / 64.0f, 1.0f / 64.0f); + //mxd. Sky is always bright + int color; + if(s.FloorTexture == General.Map.Config.SkyFlatName) + color = -1; // That's white. With alpha. Not very impressive, eh? + else + color = (int)((level.color | General.Clamp(level.alpha, 0, 255) << 24) & 0xffffffff); // Byte offset shinanigans! Yay! + // Make vertices ReadOnlyCollection triverts = base.Sector.Sector.Triangles.Vertices; WorldVertex[] verts = new WorldVertex[triverts.Count]; for(int i = 0; i < triverts.Count; i++) { // Color shading - PixelColor c = PixelColor.FromInt(level.color); - verts[i].c = c.WithAlpha((byte)General.Clamp(level.alpha, 0, 255)).ToInt(); + verts[i].c = color; //mxd // Vertex coordinates verts[i].x = triverts[i].x;