Visual mode, UDMF: added rendering support for fogdensity and floor/ceiling glow properties.

Internal, build tools: use origin/master to get commits count and current hash instead of local master.
This commit is contained in:
MaxED 2017-01-04 16:28:36 +03:00
parent c9ab3274f9
commit a7d2417844
17 changed files with 309 additions and 182 deletions

View file

@ -5,6 +5,7 @@
//The Code Project - http://www.codeproject.com
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
@ -44,7 +45,13 @@ namespace CodeImp.DoomBuilder.Controls
public event EventHandler AngleChanged;
public int Angle { get { return (angle == NO_ANGLE ? NO_ANGLE : angle - angleoffset); } set { angle = (value == NO_ANGLE ? NO_ANGLE : value + angleoffset); this.Refresh(); } }
public int Angle { get { return (angle == NO_ANGLE ? NO_ANGLE : angle - angleoffset); } set {
if(LicenseManager.UsageMode != LicenseUsageMode.Designtime)
{
angle = (value == NO_ANGLE ? NO_ANGLE : value + angleoffset);
this.Refresh();
}
} }
public int AngleOffset { get { return angleoffset; } set { angleoffset = value; this.Refresh(); } }
public bool DoomAngleClamping { get { return doomangleclamping; } set { doomangleclamping = value; } }
public const int NO_ANGLE = int.MinValue;

View file

@ -339,84 +339,98 @@ namespace CodeImp.DoomBuilder.Data
}
}
//mxd. Calculate average color?
if(General.Map != null && General.Map.Data != null && General.Map.Data.GlowingFlats != null &&
General.Map.Data.GlowingFlats.ContainsKey(longname) &&
General.Map.Data.GlowingFlats[longname].CalculateTextureColor)
if(!loadfailed)
{
BitmapData bmpdata = null;
try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); }
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message); }
if(bmpdata != null)
//mxd. Check translucency and calculate average color?
if(General.Map != null && General.Map.Data != null && General.Map.Data.GlowingFlats != null &&
General.Map.Data.GlowingFlats.ContainsKey(longname) &&
General.Map.Data.GlowingFlats[longname].CalculateTextureColor)
{
PixelColor* pixels = (PixelColor*) (bmpdata.Scan0.ToPointer());
int numpixels = bmpdata.Width * bmpdata.Height;
uint r = 0;
uint g = 0;
uint b = 0;
for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--)
BitmapData bmpdata = null;
try
{
r += cp->r;
g += cp->g;
b += cp->b;
// Also check alpha
if(cp->a > 0 && cp->a < 255) istranslucent = true;
else if(cp->a == 0) ismasked = true;
bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
}
catch(Exception e)
{
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message);
}
// Update glow data
int br = (int)(r / numpixels);
int bg = (int)(g / numpixels);
int bb = (int)(b / numpixels);
int max = Math.Max(br, Math.Max(bg, bb));
// Black can't glow...
if(max == 0)
if(bmpdata != null)
{
General.Map.Data.GlowingFlats.Remove(longname);
}
else
{
// That's how it's done in GZDoom (and I may be totally wrong about this)
br = Math.Min(255, br * 153 / max);
bg = Math.Min(255, bg * 153 / max);
bb = Math.Min(255, bb * 153 / max);
General.Map.Data.GlowingFlats[longname].Color = new PixelColor(255, (byte)br, (byte)bg, (byte)bb);
General.Map.Data.GlowingFlats[longname].CalculateTextureColor = false;
if(!General.Map.Data.GlowingFlats[longname].Fullbright)
General.Map.Data.GlowingFlats[longname].Brightness = (br + bg + bb) / 3;
}
PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer());
int numpixels = bmpdata.Width * bmpdata.Height;
uint r = 0;
uint g = 0;
uint b = 0;
// Release the data
bitmap.UnlockBits(bmpdata);
for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--)
{
r += cp->r;
g += cp->g;
b += cp->b;
// Also check alpha
if(cp->a > 0 && cp->a < 255) istranslucent = true;
else if(cp->a == 0) ismasked = true;
}
// Update glow data
int br = (int)(r / numpixels);
int bg = (int)(g / numpixels);
int bb = (int)(b / numpixels);
int max = Math.Max(br, Math.Max(bg, bb));
// Black can't glow...
if(max == 0)
{
General.Map.Data.GlowingFlats.Remove(longname);
}
else
{
// That's how it's done in GZDoom (and I may be totally wrong about this)
br = Math.Min(255, br * 153 / max);
bg = Math.Min(255, bg * 153 / max);
bb = Math.Min(255, bb * 153 / max);
General.Map.Data.GlowingFlats[longname].Color = new PixelColor(255, (byte)br, (byte)bg, (byte)bb);
General.Map.Data.GlowingFlats[longname].CalculateTextureColor = false;
if(!General.Map.Data.GlowingFlats[longname].Fullbright) General.Map.Data.GlowingFlats[longname].Brightness = (br + bg + bb) / 3;
}
// Release the data
bitmap.UnlockBits(bmpdata);
}
}
}
//mxd. Check if the texture is translucent
else if(!loadfailed)
{
BitmapData bmpdata = null;
try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); }
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message); }
if(bmpdata != null)
//mxd. Check if the texture is translucent
else
{
PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer());
int numpixels = bmpdata.Width * bmpdata.Height;
for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--)
BitmapData bmpdata = null;
try
{
// Check alpha
if(cp->a > 0 && cp->a < 255) istranslucent = true;
else if(cp->a == 0) ismasked = true;
bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
}
catch(Exception e)
{
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message);
}
// Release the data
bitmap.UnlockBits(bmpdata);
if(bmpdata != null)
{
PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer());
int numpixels = bmpdata.Width * bmpdata.Height;
for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--)
{
// Check alpha
if(cp->a > 0 && cp->a < 255) istranslucent = true;
else if(cp->a == 0) ismasked = true;
}
// Release the data
bitmap.UnlockBits(bmpdata);
}
}
}
}

View file

@ -5,7 +5,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
public class GlowingFlatData
{
public PixelColor Color;
public int Height;
public float Height;
public int Brightness = 255;
public bool Fullbright;
public bool CalculateTextureColor;

View file

@ -203,22 +203,26 @@ namespace CodeImp.DoomBuilder.VisualModes
//TODO: this doesn't match any GZDoom light mode...
//GZDoom: gl_renderstate.h, SetFog();
//GZDoom: gl_lightlevel.cpp gl_SetFog();
protected float CalculateFogFactor(int brightness) { return CalculateFogFactor(Sector.Sector.FogMode, brightness); }
public static float CalculateFogFactor(SectorFogMode mode, int brightness)
protected float CalculateFogFactor(int brightness) { return CalculateFogFactor(Sector.Sector, brightness); }
public static float CalculateFogFactor(Sector sector, int brightness)
{
float density;
switch(mode)
int fogdensity = (General.Map.UDMF ? General.Clamp(sector.Fields.GetValue("fogdensity", 0), 0, 510) : 0);
switch(sector.FogMode)
{
case SectorFogMode.OUTSIDEFOGDENSITY:
density = General.Map.Data.MapInfo.OutsideFogDensity * FADE_MULTIPLIER;
if(fogdensity < 3) fogdensity = General.Map.Data.MapInfo.OutsideFogDensity;
density = fogdensity * FADE_MULTIPLIER;
break;
case SectorFogMode.FOGDENSITY:
density = General.Map.Data.MapInfo.FogDensity * FADE_MULTIPLIER;
if(fogdensity < 3) fogdensity = General.Map.Data.MapInfo.FogDensity;
density = fogdensity * FADE_MULTIPLIER;
break;
case SectorFogMode.FADE:
density = General.Clamp(255 - brightness, 30, 255) * FADE_MULTIPLIER;
if(fogdensity < 3) fogdensity = General.Clamp(255 - brightness, 30, 255);
density = fogdensity * FADE_MULTIPLIER;
break;
case SectorFogMode.CLASSIC:

View file

@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.Windows
label11.Name = "label11";
label11.Size = new System.Drawing.Size(80, 14);
label11.TabIndex = 13;
label11.Text = "Sector Index:";
label11.Text = "Sector index:";
label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label12
@ -173,7 +173,7 @@ namespace CodeImp.DoomBuilder.Windows
label12.Name = "label12";
label12.Size = new System.Drawing.Size(80, 14);
label12.TabIndex = 16;
label12.Text = "Sector Index:";
label12.Text = "Sector index:";
label12.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// activationlabel
@ -191,7 +191,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontTextureOffset.Name = "labelFrontTextureOffset";
this.labelFrontTextureOffset.Size = new System.Drawing.Size(80, 14);
this.labelFrontTextureOffset.TabIndex = 42;
this.labelFrontTextureOffset.Text = "Texture Offset:";
this.labelFrontTextureOffset.Text = "Texture offset:";
this.labelFrontTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackTextureOffset
@ -200,7 +200,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackTextureOffset.Name = "labelBackTextureOffset";
this.labelBackTextureOffset.Size = new System.Drawing.Size(80, 14);
this.labelBackTextureOffset.TabIndex = 43;
this.labelBackTextureOffset.Text = "Texture Offset:";
this.labelBackTextureOffset.Text = "Texture offset:";
this.labelBackTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// cancel
@ -353,9 +353,9 @@ namespace CodeImp.DoomBuilder.Windows
this.frontside.AutoSize = true;
this.frontside.Location = new System.Drawing.Point(17, 4);
this.frontside.Name = "frontside";
this.frontside.Size = new System.Drawing.Size(74, 17);
this.frontside.Size = new System.Drawing.Size(72, 17);
this.frontside.TabIndex = 0;
this.frontside.Text = "Front Side";
this.frontside.Text = "Front side";
this.frontside.UseVisualStyleBackColor = true;
this.frontside.CheckStateChanged += new System.EventHandler(this.frontside_CheckStateChanged);
//
@ -384,6 +384,7 @@ namespace CodeImp.DoomBuilder.Windows
// frontsector
//
this.frontsector.AllowDecimal = false;
this.frontsector.AllowExpressions = false;
this.frontsector.AllowNegative = false;
this.frontsector.AllowRelative = false;
this.frontsector.ButtonStep = 1;
@ -449,9 +450,9 @@ namespace CodeImp.DoomBuilder.Windows
this.backside.AutoSize = true;
this.backside.Location = new System.Drawing.Point(17, 158);
this.backside.Name = "backside";
this.backside.Size = new System.Drawing.Size(75, 17);
this.backside.Size = new System.Drawing.Size(73, 17);
this.backside.TabIndex = 0;
this.backside.Text = "Back Side";
this.backside.Text = "Back side";
this.backside.UseVisualStyleBackColor = true;
this.backside.CheckStateChanged += new System.EventHandler(this.backside_CheckStateChanged);
//
@ -480,6 +481,7 @@ namespace CodeImp.DoomBuilder.Windows
// backsector
//
this.backsector.AllowDecimal = false;
this.backsector.AllowExpressions = false;
this.backsector.AllowNegative = false;
this.backsector.AllowRelative = false;
this.backsector.ButtonStep = 1;

View file

@ -50,6 +50,7 @@ namespace CodeImp.DoomBuilder.Windows
this.tabs = new System.Windows.Forms.TabControl();
this.tabproperties = new System.Windows.Forms.TabPage();
this.groupsettings = new System.Windows.Forms.GroupBox();
this.resetalpha = new System.Windows.Forms.Button();
this.lockpick = new System.Windows.Forms.ComboBox();
this.alpha = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.renderStyle = new System.Windows.Forms.ComboBox();
@ -124,7 +125,6 @@ namespace CodeImp.DoomBuilder.Windows
this.fieldslist = new CodeImp.DoomBuilder.Controls.FieldsEditorControl();
this.imagelist = new System.Windows.Forms.ImageList(this.components);
this.tooltip = new System.Windows.Forms.ToolTip(this.components);
this.resetalpha = new System.Windows.Forms.Button();
label2 = new System.Windows.Forms.Label();
label11 = new System.Windows.Forms.Label();
label12 = new System.Windows.Forms.Label();
@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.Windows
label11.Name = "label11";
label11.Size = new System.Drawing.Size(80, 14);
label11.TabIndex = 13;
label11.Text = "Sector Index:";
label11.Text = "Sector index:";
label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label12
@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.Windows
label12.Name = "label12";
label12.Size = new System.Drawing.Size(80, 14);
label12.TabIndex = 16;
label12.Text = "Sector Index:";
label12.Text = "Sector index:";
label12.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label6
@ -389,6 +389,17 @@ namespace CodeImp.DoomBuilder.Windows
this.groupsettings.TabStop = false;
this.groupsettings.Text = " Settings";
//
// resetalpha
//
this.resetalpha.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset;
this.resetalpha.Location = new System.Drawing.Point(301, 16);
this.resetalpha.Name = "resetalpha";
this.resetalpha.Size = new System.Drawing.Size(23, 23);
this.resetalpha.TabIndex = 70;
this.tooltip.SetToolTip(this.resetalpha, "Reset");
this.resetalpha.UseVisualStyleBackColor = true;
this.resetalpha.Click += new System.EventHandler(this.resetalpha_Click);
//
// lockpick
//
this.lockpick.FormattingEnabled = true;
@ -488,9 +499,9 @@ namespace CodeImp.DoomBuilder.Windows
this.frontside.AutoSize = true;
this.frontside.Location = new System.Drawing.Point(20, 6);
this.frontside.Name = "frontside";
this.frontside.Size = new System.Drawing.Size(74, 17);
this.frontside.Size = new System.Drawing.Size(72, 17);
this.frontside.TabIndex = 0;
this.frontside.Text = "Front Side";
this.frontside.Text = "Front side";
this.frontside.UseVisualStyleBackColor = true;
this.frontside.CheckStateChanged += new System.EventHandler(this.frontside_CheckStateChanged);
//
@ -551,7 +562,7 @@ namespace CodeImp.DoomBuilder.Windows
this.frontscalegroup.Size = new System.Drawing.Size(290, 112);
this.frontscalegroup.TabIndex = 44;
this.frontscalegroup.TabStop = false;
this.frontscalegroup.Text = " Texture Scale ";
this.frontscalegroup.Text = " Texture scale ";
//
// labelFrontScaleBottom
//
@ -560,7 +571,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontScaleBottom.Size = new System.Drawing.Size(80, 14);
this.labelFrontScaleBottom.TabIndex = 42;
this.labelFrontScaleBottom.Tag = "";
this.labelFrontScaleBottom.Text = "Lower Scale:";
this.labelFrontScaleBottom.Text = "Lower scale:";
this.labelFrontScaleBottom.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelFrontScaleMid
@ -570,7 +581,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontScaleMid.Size = new System.Drawing.Size(80, 14);
this.labelFrontScaleMid.TabIndex = 41;
this.labelFrontScaleMid.Tag = "";
this.labelFrontScaleMid.Text = "Middle Scale:";
this.labelFrontScaleMid.Text = "Middle scale:";
this.labelFrontScaleMid.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelFrontScaleTop
@ -580,7 +591,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontScaleTop.Size = new System.Drawing.Size(80, 14);
this.labelFrontScaleTop.TabIndex = 28;
this.labelFrontScaleTop.Tag = "";
this.labelFrontScaleTop.Text = "Upper Scale:";
this.labelFrontScaleTop.Text = "Upper scale:";
this.labelFrontScaleTop.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// pfcFrontScaleTop
@ -655,7 +666,7 @@ namespace CodeImp.DoomBuilder.Windows
this.groupBox6.Size = new System.Drawing.Size(290, 143);
this.groupBox6.TabIndex = 43;
this.groupBox6.TabStop = false;
this.groupBox6.Text = " Texture Offsets ";
this.groupBox6.Text = " Texture offsets ";
//
// labelFrontTextureOffset
//
@ -664,7 +675,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontTextureOffset.Size = new System.Drawing.Size(80, 14);
this.labelFrontTextureOffset.TabIndex = 46;
this.labelFrontTextureOffset.Tag = "";
this.labelFrontTextureOffset.Text = "Sidedef Offset:";
this.labelFrontTextureOffset.Text = "Sidedef offset:";
this.labelFrontTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelFrontOffsetBottom
@ -674,7 +685,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontOffsetBottom.Size = new System.Drawing.Size(80, 14);
this.labelFrontOffsetBottom.TabIndex = 45;
this.labelFrontOffsetBottom.Tag = "";
this.labelFrontOffsetBottom.Text = "Lower Offset:";
this.labelFrontOffsetBottom.Text = "Lower offset:";
this.labelFrontOffsetBottom.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// frontTextureOffset
@ -697,7 +708,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontOffsetMid.Size = new System.Drawing.Size(80, 14);
this.labelFrontOffsetMid.TabIndex = 44;
this.labelFrontOffsetMid.Tag = "";
this.labelFrontOffsetMid.Text = "Middle Offset:";
this.labelFrontOffsetMid.Text = "Middle offset:";
this.labelFrontOffsetMid.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// pfcFrontOffsetTop
@ -726,7 +737,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelFrontOffsetTop.Size = new System.Drawing.Size(80, 14);
this.labelFrontOffsetTop.TabIndex = 43;
this.labelFrontOffsetTop.Tag = "";
this.labelFrontOffsetTop.Text = "Upper Offset:";
this.labelFrontOffsetTop.Text = "Upper offset:";
this.labelFrontOffsetTop.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// pfcFrontOffsetMid
@ -905,9 +916,9 @@ namespace CodeImp.DoomBuilder.Windows
this.backside.AutoSize = true;
this.backside.Location = new System.Drawing.Point(20, 6);
this.backside.Name = "backside";
this.backside.Size = new System.Drawing.Size(75, 17);
this.backside.Size = new System.Drawing.Size(73, 17);
this.backside.TabIndex = 0;
this.backside.Text = "Back Side";
this.backside.Text = "Back side";
this.backside.UseVisualStyleBackColor = true;
this.backside.CheckStateChanged += new System.EventHandler(this.backside_CheckStateChanged);
//
@ -1064,7 +1075,7 @@ namespace CodeImp.DoomBuilder.Windows
this.backscalegroup.Size = new System.Drawing.Size(290, 112);
this.backscalegroup.TabIndex = 44;
this.backscalegroup.TabStop = false;
this.backscalegroup.Text = " Texture Scale";
this.backscalegroup.Text = " Texture scale";
//
// labelBackScaleBottom
//
@ -1073,7 +1084,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackScaleBottom.Size = new System.Drawing.Size(80, 14);
this.labelBackScaleBottom.TabIndex = 45;
this.labelBackScaleBottom.Tag = "";
this.labelBackScaleBottom.Text = "Lower Scale:";
this.labelBackScaleBottom.Text = "Lower scale:";
this.labelBackScaleBottom.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackScaleMid
@ -1083,7 +1094,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackScaleMid.Size = new System.Drawing.Size(80, 14);
this.labelBackScaleMid.TabIndex = 44;
this.labelBackScaleMid.Tag = "";
this.labelBackScaleMid.Text = "Middle Scale:";
this.labelBackScaleMid.Text = "Middle scale:";
this.labelBackScaleMid.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackScaleTop
@ -1093,7 +1104,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackScaleTop.Size = new System.Drawing.Size(80, 14);
this.labelBackScaleTop.TabIndex = 43;
this.labelBackScaleTop.Tag = "";
this.labelBackScaleTop.Text = "Upper Scale:";
this.labelBackScaleTop.Text = "Upper scale:";
this.labelBackScaleTop.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// pfcBackScaleTop
@ -1168,7 +1179,7 @@ namespace CodeImp.DoomBuilder.Windows
this.groupBox1.Size = new System.Drawing.Size(290, 143);
this.groupBox1.TabIndex = 43;
this.groupBox1.TabStop = false;
this.groupBox1.Text = " Texture Offsets ";
this.groupBox1.Text = " Texture offsets ";
//
// labelBackTextureOffset
//
@ -1177,7 +1188,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackTextureOffset.Size = new System.Drawing.Size(80, 14);
this.labelBackTextureOffset.TabIndex = 50;
this.labelBackTextureOffset.Tag = "";
this.labelBackTextureOffset.Text = "Sidedef Offset:";
this.labelBackTextureOffset.Text = "Sidedef offset:";
this.labelBackTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackOffsetBottom
@ -1187,7 +1198,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackOffsetBottom.Size = new System.Drawing.Size(80, 14);
this.labelBackOffsetBottom.TabIndex = 49;
this.labelBackOffsetBottom.Tag = "";
this.labelBackOffsetBottom.Text = "Lower Offset:";
this.labelBackOffsetBottom.Text = "Lower offset:";
this.labelBackOffsetBottom.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackOffsetMid
@ -1197,7 +1208,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackOffsetMid.Size = new System.Drawing.Size(80, 14);
this.labelBackOffsetMid.TabIndex = 48;
this.labelBackOffsetMid.Tag = "";
this.labelBackOffsetMid.Text = "Middle Offset:";
this.labelBackOffsetMid.Text = "Middle offset:";
this.labelBackOffsetMid.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelBackOffsetTop
@ -1207,7 +1218,7 @@ namespace CodeImp.DoomBuilder.Windows
this.labelBackOffsetTop.Size = new System.Drawing.Size(80, 14);
this.labelBackOffsetTop.TabIndex = 47;
this.labelBackOffsetTop.Tag = "";
this.labelBackOffsetTop.Text = "Upper Offset:";
this.labelBackOffsetTop.Text = "Upper offset:";
this.labelBackOffsetTop.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// pfcBackOffsetTop
@ -1374,17 +1385,6 @@ namespace CodeImp.DoomBuilder.Windows
this.imagelist.Images.SetKeyName(0, "Check.png");
this.imagelist.Images.SetKeyName(1, "SearchClear.png");
//
// resetalpha
//
this.resetalpha.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset;
this.resetalpha.Location = new System.Drawing.Point(301, 16);
this.resetalpha.Name = "resetalpha";
this.resetalpha.Size = new System.Drawing.Size(23, 23);
this.resetalpha.TabIndex = 70;
this.tooltip.SetToolTip(this.resetalpha, "Reset");
this.resetalpha.UseVisualStyleBackColor = true;
this.resetalpha.Click += new System.EventHandler(this.resetalpha_Click);
//
// LinedefEditFormUDMF
//
this.AcceptButton = this.apply;

View file

@ -864,6 +864,7 @@ namespace CodeImp.DoomBuilder.Windows
private void resetalpha_Click(object sender, EventArgs e)
{
alpha.Focus();
alpha.Text = "1";
}

View file

@ -101,7 +101,7 @@ namespace CodeImp.DoomBuilder.Windows
groupeffect.Size = new System.Drawing.Size(436, 92);
groupeffect.TabIndex = 1;
groupeffect.TabStop = false;
groupeffect.Text = "Effect and Identification";
groupeffect.Text = "Effect and identification";
//
// browseeffect
//
@ -174,7 +174,7 @@ namespace CodeImp.DoomBuilder.Windows
groupfloorceiling.Size = new System.Drawing.Size(436, 186);
groupfloorceiling.TabIndex = 0;
groupfloorceiling.TabStop = false;
groupfloorceiling.Text = "Floor and Ceiling ";
groupfloorceiling.Text = "Floor and ceiling ";
//
// label7
//
@ -210,9 +210,9 @@ namespace CodeImp.DoomBuilder.Windows
// heightoffset
//
this.heightoffset.AllowDecimal = false;
this.heightoffset.AllowExpressions = true;
this.heightoffset.AllowNegative = true;
this.heightoffset.AllowRelative = true;
this.heightoffset.AllowExpressions = true;
this.heightoffset.ButtonStep = 8;
this.heightoffset.ButtonStepBig = 16F;
this.heightoffset.ButtonStepFloat = 1F;
@ -229,6 +229,7 @@ namespace CodeImp.DoomBuilder.Windows
// brightness
//
this.brightness.AllowDecimal = false;
this.brightness.AllowExpressions = false;
this.brightness.AllowNegative = true;
this.brightness.AllowRelative = true;
this.brightness.ButtonStep = 8;
@ -247,9 +248,9 @@ namespace CodeImp.DoomBuilder.Windows
// ceilingheight
//
this.ceilingheight.AllowDecimal = false;
this.ceilingheight.AllowExpressions = true;
this.ceilingheight.AllowNegative = true;
this.ceilingheight.AllowRelative = true;
this.ceilingheight.AllowExpressions = true;
this.ceilingheight.ButtonStep = 8;
this.ceilingheight.ButtonStepBig = 16F;
this.ceilingheight.ButtonStepFloat = 1F;
@ -314,9 +315,9 @@ namespace CodeImp.DoomBuilder.Windows
// floorheight
//
this.floorheight.AllowDecimal = false;
this.floorheight.AllowExpressions = true;
this.floorheight.AllowNegative = true;
this.floorheight.AllowRelative = true;
this.floorheight.AllowExpressions = true;
this.floorheight.ButtonStep = 8;
this.floorheight.ButtonStepBig = 16F;
this.floorheight.ButtonStepFloat = 1F;

View file

@ -74,6 +74,7 @@
this.flags = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl();
this.tabSurfaces = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.floorglowheightrequired = new System.Windows.Forms.PictureBox();
this.disablefloorglow = new System.Windows.Forms.CheckBox();
this.resetfloorglowheight = new System.Windows.Forms.Button();
this.floorglowheightlabel = new System.Windows.Forms.Label();
@ -101,6 +102,7 @@
this.floorOffsets = new CodeImp.DoomBuilder.Controls.PairedFieldsControl();
this.floortex = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.ceilingglowheightrequired = new System.Windows.Forms.PictureBox();
this.disableceilingglow = new System.Windows.Forms.CheckBox();
this.resetceilingglowheight = new System.Windows.Forms.Button();
this.ceilingglowheightlabel = new System.Windows.Forms.Label();
@ -178,7 +180,9 @@
this.groupBox3.SuspendLayout();
this.tabSurfaces.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.floorglowheightrequired)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ceilingglowheightrequired)).BeginInit();
this.tabslopes.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox6.SuspendLayout();
@ -246,7 +250,7 @@
this.fogdensity.ButtonStepSmall = 1F;
this.fogdensity.ButtonStepsUseModifierKeys = true;
this.fogdensity.ButtonStepsWrapAround = false;
this.fogdensity.Location = new System.Drawing.Point(89, 132);
this.fogdensity.Location = new System.Drawing.Point(283, 130);
this.fogdensity.Name = "fogdensity";
this.fogdensity.Size = new System.Drawing.Size(81, 24);
this.fogdensity.StepValues = null;
@ -257,7 +261,7 @@
//
label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
label4.ForeColor = System.Drawing.SystemColors.HotTrack;
label4.Location = new System.Drawing.Point(9, 137);
label4.Location = new System.Drawing.Point(203, 135);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(74, 14);
label4.TabIndex = 9;
@ -773,6 +777,7 @@
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.floorglowheightrequired);
this.groupBox2.Controls.Add(this.disablefloorglow);
this.groupBox2.Controls.Add(this.resetfloorglowheight);
this.groupBox2.Controls.Add(this.floorglowheightlabel);
@ -806,6 +811,17 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = " Floor ";
//
// floorglowheightrequired
//
this.floorglowheightrequired.Image = global::CodeImp.DoomBuilder.Properties.Resources.Warning;
this.floorglowheightrequired.Location = new System.Drawing.Point(20, 257);
this.floorglowheightrequired.Name = "floorglowheightrequired";
this.floorglowheightrequired.Size = new System.Drawing.Size(16, 16);
this.floorglowheightrequired.TabIndex = 27;
this.floorglowheightrequired.TabStop = false;
this.tooltip.SetToolTip(this.floorglowheightrequired, "Non-zero glow height required\r\nfor the glow to be shown ingame!");
this.floorglowheightrequired.Visible = false;
//
// disablefloorglow
//
this.disablefloorglow.AutoSize = true;
@ -845,9 +861,9 @@
this.floorglowheight.AllowExpressions = false;
this.floorglowheight.AllowNegative = false;
this.floorglowheight.AllowRelative = false;
this.floorglowheight.ButtonStep = 8;
this.floorglowheight.ButtonStepBig = 16F;
this.floorglowheight.ButtonStepFloat = 1F;
this.floorglowheight.ButtonStep = 16;
this.floorglowheight.ButtonStepBig = 64F;
this.floorglowheight.ButtonStepFloat = 16F;
this.floorglowheight.ButtonStepSmall = 1F;
this.floorglowheight.ButtonStepsUseModifierKeys = true;
this.floorglowheight.ButtonStepsWrapAround = false;
@ -883,7 +899,7 @@
//
// label23
//
this.label23.Location = new System.Drawing.Point(24, 202);
this.label23.Location = new System.Drawing.Point(26, 202);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(80, 14);
this.label23.TabIndex = 17;
@ -925,7 +941,7 @@
//
// label3
//
this.label3.Location = new System.Drawing.Point(24, 114);
this.label3.Location = new System.Drawing.Point(26, 114);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(80, 14);
this.label3.TabIndex = 6;
@ -956,22 +972,22 @@
//
// labelFloorOffsets
//
this.labelFloorOffsets.Location = new System.Drawing.Point(6, 27);
this.labelFloorOffsets.Location = new System.Drawing.Point(8, 27);
this.labelFloorOffsets.Name = "labelFloorOffsets";
this.labelFloorOffsets.Size = new System.Drawing.Size(98, 14);
this.labelFloorOffsets.TabIndex = 0;
this.labelFloorOffsets.Tag = "";
this.labelFloorOffsets.Text = "Texture Offsets:";
this.labelFloorOffsets.Text = "Texture offsets:";
this.labelFloorOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelFloorScale
//
this.labelFloorScale.Location = new System.Drawing.Point(9, 59);
this.labelFloorScale.Location = new System.Drawing.Point(8, 59);
this.labelFloorScale.Name = "labelFloorScale";
this.labelFloorScale.Size = new System.Drawing.Size(95, 14);
this.labelFloorScale.Size = new System.Drawing.Size(98, 14);
this.labelFloorScale.TabIndex = 2;
this.labelFloorScale.Tag = "";
this.labelFloorScale.Text = "Texture Scale:";
this.labelFloorScale.Text = "Texture scale:";
this.labelFloorScale.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// cbUseFloorLineAngles
@ -988,7 +1004,7 @@
//
// floorAngleControl
//
this.floorAngleControl.Angle = -1710;
this.floorAngleControl.Angle = -270;
this.floorAngleControl.AngleOffset = 90;
this.floorAngleControl.DoomAngleClamping = false;
this.floorAngleControl.Location = new System.Drawing.Point(6, 156);
@ -999,7 +1015,7 @@
//
// labelfloorrenderstyle
//
this.labelfloorrenderstyle.Location = new System.Drawing.Point(24, 88);
this.labelfloorrenderstyle.Location = new System.Drawing.Point(26, 88);
this.labelfloorrenderstyle.Name = "labelfloorrenderstyle";
this.labelfloorrenderstyle.Size = new System.Drawing.Size(80, 14);
this.labelfloorrenderstyle.TabIndex = 4;
@ -1009,7 +1025,7 @@
//
// label11
//
this.label11.Location = new System.Drawing.Point(24, 172);
this.label11.Location = new System.Drawing.Point(26, 172);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(80, 14);
this.label11.TabIndex = 14;
@ -1050,7 +1066,7 @@
//
// label12
//
this.label12.Location = new System.Drawing.Point(24, 142);
this.label12.Location = new System.Drawing.Point(26, 142);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(80, 14);
this.label12.TabIndex = 9;
@ -1139,6 +1155,7 @@
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.ceilingglowheightrequired);
this.groupBox1.Controls.Add(this.disableceilingglow);
this.groupBox1.Controls.Add(this.resetceilingglowheight);
this.groupBox1.Controls.Add(this.ceilingglowheightlabel);
@ -1172,6 +1189,17 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = " Ceiling ";
//
// ceilingglowheightrequired
//
this.ceilingglowheightrequired.Image = global::CodeImp.DoomBuilder.Properties.Resources.Warning;
this.ceilingglowheightrequired.Location = new System.Drawing.Point(20, 257);
this.ceilingglowheightrequired.Name = "ceilingglowheightrequired";
this.ceilingglowheightrequired.Size = new System.Drawing.Size(16, 16);
this.ceilingglowheightrequired.TabIndex = 26;
this.ceilingglowheightrequired.TabStop = false;
this.tooltip.SetToolTip(this.ceilingglowheightrequired, "Non-zero glow height required\r\nfor the glow to be shown ingame!");
this.ceilingglowheightrequired.Visible = false;
//
// disableceilingglow
//
this.disableceilingglow.AutoSize = true;
@ -1211,9 +1239,9 @@
this.ceilingglowheight.AllowExpressions = false;
this.ceilingglowheight.AllowNegative = false;
this.ceilingglowheight.AllowRelative = false;
this.ceilingglowheight.ButtonStep = 8;
this.ceilingglowheight.ButtonStepBig = 16F;
this.ceilingglowheight.ButtonStepFloat = 1F;
this.ceilingglowheight.ButtonStep = 16;
this.ceilingglowheight.ButtonStepBig = 64F;
this.ceilingglowheight.ButtonStepFloat = 16F;
this.ceilingglowheight.ButtonStepSmall = 1F;
this.ceilingglowheight.ButtonStepsUseModifierKeys = true;
this.ceilingglowheight.ButtonStepsWrapAround = false;
@ -1327,17 +1355,17 @@
this.labelCeilOffsets.Size = new System.Drawing.Size(98, 14);
this.labelCeilOffsets.TabIndex = 0;
this.labelCeilOffsets.Tag = "";
this.labelCeilOffsets.Text = "Texture Offsets:";
this.labelCeilOffsets.Text = "Texture offsets:";
this.labelCeilOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelCeilScale
//
this.labelCeilScale.Location = new System.Drawing.Point(11, 59);
this.labelCeilScale.Location = new System.Drawing.Point(8, 59);
this.labelCeilScale.Name = "labelCeilScale";
this.labelCeilScale.Size = new System.Drawing.Size(95, 14);
this.labelCeilScale.Size = new System.Drawing.Size(98, 14);
this.labelCeilScale.TabIndex = 2;
this.labelCeilScale.Tag = "";
this.labelCeilScale.Text = "Texture Scale:";
this.labelCeilScale.Text = "Texture scale:";
this.labelCeilScale.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// cbUseCeilLineAngles
@ -1354,7 +1382,7 @@
//
// ceilAngleControl
//
this.ceilAngleControl.Angle = -1710;
this.ceilAngleControl.Angle = -270;
this.ceilAngleControl.AngleOffset = 90;
this.ceilAngleControl.DoomAngleClamping = false;
this.ceilAngleControl.Location = new System.Drawing.Point(6, 156);
@ -1849,8 +1877,10 @@
this.tabSurfaces.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.floorglowheightrequired)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ceilingglowheightrequired)).EndInit();
this.tabslopes.ResumeLayout(false);
this.groupBox7.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
@ -1971,5 +2001,7 @@
private System.Windows.Forms.Button resetfloorglowheight;
private System.Windows.Forms.CheckBox disableceilingglow;
private System.Windows.Forms.CheckBox disablefloorglow;
private System.Windows.Forms.PictureBox ceilingglowheightrequired;
private System.Windows.Forms.PictureBox floorglowheightrequired;
}
}

View file

@ -293,9 +293,6 @@ namespace CodeImp.DoomBuilder.Windows
{
preventchanges = true; //mxd
int floorglowcolorval = 0;
int ceilingglowcolorval = 0;
// Keep this list
this.sectors = sectors;
if(sectors.Count > 1) this.Text = "Edit Sectors (" + sectors.Count + ")";
@ -370,8 +367,8 @@ namespace CodeImp.DoomBuilder.Windows
fogdensity.Text = General.Clamp(sc.Fields.GetValue("fogdensity", 0), 0, 510).ToString();
// Floor/ceiling glow
ceilingglowcolorval = sc.Fields.GetValue("ceilingglowcolor", 0);
floorglowcolorval = sc.Fields.GetValue("floorglowcolor", 0);
int ceilingglowcolorval = sc.Fields.GetValue("ceilingglowcolor", 0);
int floorglowcolorval = sc.Fields.GetValue("floorglowcolor", 0);
ceilingglowcolor.SetValueFrom(sc.Fields, true);
floorglowcolor.SetValueFrom(sc.Fields, true);
@ -587,6 +584,10 @@ namespace CodeImp.DoomBuilder.Windows
if(ceilingglowheight.Text == "0") resetceilingglowheight.Visible = false;
if(floorglowheight.Text == "0") resetfloorglowheight.Visible = false;
//mxd. Cause Graf was not into non-zero default glow height...
UpdateCeilingGlowHeightWarning();
UpdateFloorGlowHeightWarning();
//mxd. Setup tags
tagsselector.SetValues(sectors);
@ -990,6 +991,7 @@ namespace CodeImp.DoomBuilder.Windows
private void resetfloorterrain_Click(object sender, EventArgs e)
{
floorterrain.Focus();
floorterrain.Text = NO_TERRAIN;
}
@ -1005,6 +1007,7 @@ namespace CodeImp.DoomBuilder.Windows
private void resetceilterrain_Click(object sender, EventArgs e)
{
ceilterrain.Focus();
ceilterrain.Text = NO_TERRAIN;
}
@ -1062,11 +1065,13 @@ namespace CodeImp.DoomBuilder.Windows
private void reset_ceiling_reflect_Click(object sender, EventArgs e)
{
ceiling_reflect.Focus();
ceiling_reflect.Text = "0";
}
private void reset_floor_reflect_Click(object sender, EventArgs e)
{
floor_reflect.Focus();
floor_reflect.Text = "0";
}
@ -1082,11 +1087,13 @@ namespace CodeImp.DoomBuilder.Windows
private void resetalphafloor_Click(object sender, EventArgs e)
{
alphafloor.Focus();
alphafloor.Text = "1";
}
private void resetalphaceiling_Click(object sender, EventArgs e)
{
alphaceiling.Focus();
alphaceiling.Text = "1";
}
@ -1840,6 +1847,18 @@ namespace CodeImp.DoomBuilder.Windows
#region ================== Glow relatime events (mxd)
private void UpdateCeilingGlowHeightWarning()
{
ceilingglowheightrequired.Visible = (ceilingglowcolor.Color.WithAlpha(0).ToInt() != ceilingglowcolor.DefaultValue
&& ceilingglowheight.GetResultFloat(0f) == 0f);
}
private void UpdateFloorGlowHeightWarning()
{
floorglowheightrequired.Visible = (floorglowcolor.Color.WithAlpha(0).ToInt() != floorglowcolor.DefaultValue
&& floorglowheight.GetResultFloat(0f) == 0f);
}
private void ceilingglowcolor_OnValueChanged(object sender, EventArgs e)
{
if(preventchanges) return;
@ -1851,6 +1870,9 @@ namespace CodeImp.DoomBuilder.Windows
s.UpdateNeeded = true;
}
// Show height warning?
UpdateCeilingGlowHeightWarning();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
@ -1866,6 +1888,9 @@ namespace CodeImp.DoomBuilder.Windows
s.UpdateNeeded = true;
}
// Show height warning?
UpdateFloorGlowHeightWarning();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
@ -1889,6 +1914,9 @@ namespace CodeImp.DoomBuilder.Windows
s.UpdateNeeded = true;
}
// Hide height warning
ceilingglowheightrequired.Visible = false;
// Trigger update
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
@ -1919,6 +1947,9 @@ namespace CodeImp.DoomBuilder.Windows
s.UpdateNeeded = true;
}
// Hide height warning
floorglowheightrequired.Visible = false;
// Trigger update
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
@ -1957,6 +1988,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update "Reset" button
resetceilingglowheight.Visible = (ceilingglowheight.GetResultFloat(0f) != 0f);
// Show height warning?
UpdateCeilingGlowHeightWarning();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
@ -1988,17 +2022,22 @@ namespace CodeImp.DoomBuilder.Windows
// Update "Reset" button
resetfloorglowheight.Visible = (floorglowheight.GetResultFloat(0f) != 0f);
// Show height warning?
UpdateFloorGlowHeightWarning();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void resetceilingglowheight_Click(object sender, EventArgs e)
{
ceilingglowheight.Focus();
ceilingglowheight.Text = "0";
}
private void resetfloorglowheight_Click(object sender, EventArgs e)
{
floorglowheight.Focus();
floorglowheight.Text = "0";
}

View file

@ -130,7 +130,8 @@
<value>17, 17</value>
</metadata>
<data name="label4.ToolTip" xml:space="preserve">
<value>Sets an explicit fog density for the sector, overriding the default calculation from the light level.
<value>Applied only when the sector is affected by either Fade or MAPINFO fogdensity/outsidefogdensity.
Sets an explicit fog density for the sector, overriding the default calculation from the light level.
Value range is 0-510, 0 meaning that the default is to be used, 2 equalling the density
of a light level of 250, and 255 equalling the density of a light level of 0.</value>
</data>

View file

@ -96,9 +96,9 @@ namespace CodeImp.DoomBuilder.Windows
this.cbAbsoluteHeight.AutoSize = true;
this.cbAbsoluteHeight.Location = new System.Drawing.Point(12, 111);
this.cbAbsoluteHeight.Name = "cbAbsoluteHeight";
this.cbAbsoluteHeight.Size = new System.Drawing.Size(101, 17);
this.cbAbsoluteHeight.Size = new System.Drawing.Size(99, 17);
this.cbAbsoluteHeight.TabIndex = 16;
this.cbAbsoluteHeight.Text = "Absolute Height";
this.cbAbsoluteHeight.Text = "Absolute height";
this.cbAbsoluteHeight.UseVisualStyleBackColor = true;
this.cbAbsoluteHeight.CheckedChanged += new System.EventHandler(this.cbAbsoluteHeight_CheckedChanged);
//
@ -123,9 +123,9 @@ namespace CodeImp.DoomBuilder.Windows
// posX
//
this.posX.AllowDecimal = false;
this.posX.AllowExpressions = true;
this.posX.AllowNegative = true;
this.posX.AllowRelative = true;
this.posX.AllowExpressions = true;
this.posX.ButtonStep = 8;
this.posX.ButtonStepBig = 16F;
this.posX.ButtonStepFloat = 1F;
@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.Windows
// posY
//
this.posY.AllowDecimal = false;
this.posY.AllowExpressions = true;
this.posY.AllowNegative = true;
this.posY.AllowRelative = true;
this.posY.AllowExpressions = true;
this.posY.ButtonStep = 8;
this.posY.ButtonStepBig = 16F;
this.posY.ButtonStepFloat = 1F;
@ -161,9 +161,9 @@ namespace CodeImp.DoomBuilder.Windows
// posZ
//
this.posZ.AllowDecimal = false;
this.posZ.AllowExpressions = true;
this.posZ.AllowNegative = true;
this.posZ.AllowRelative = true;
this.posZ.AllowExpressions = true;
this.posZ.ButtonStep = 8;
this.posZ.ButtonStepBig = 16F;
this.posZ.ButtonStepFloat = 1F;
@ -243,9 +243,9 @@ namespace CodeImp.DoomBuilder.Windows
// angle
//
this.angle.AllowDecimal = false;
this.angle.AllowExpressions = false;
this.angle.AllowNegative = true;
this.angle.AllowRelative = true;
this.posX.AllowExpressions = true;
this.angle.ButtonStep = 5;
this.angle.ButtonStepBig = 15F;
this.angle.ButtonStepFloat = 1F;

View file

@ -123,9 +123,9 @@ namespace CodeImp.DoomBuilder.Windows
// zceiling
//
this.zceiling.AllowDecimal = false;
this.zceiling.AllowExpressions = true;
this.zceiling.AllowNegative = true;
this.zceiling.AllowRelative = true;
this.zceiling.AllowExpressions = true;
this.zceiling.ButtonStep = 8;
this.zceiling.ButtonStepBig = 16F;
this.zceiling.ButtonStepFloat = 1F;
@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.Windows
// zfloor
//
this.zfloor.AllowDecimal = false;
this.zfloor.AllowExpressions = true;
this.zfloor.AllowNegative = true;
this.zfloor.AllowRelative = true;
this.zfloor.AllowExpressions = true;
this.zfloor.ButtonStep = 8;
this.zfloor.ButtonStepBig = 16F;
this.zfloor.ButtonStepFloat = 1F;
@ -163,25 +163,25 @@ namespace CodeImp.DoomBuilder.Windows
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(68, 37);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(111, 13);
label2.Size = new System.Drawing.Size(106, 13);
label2.TabIndex = 26;
label2.Text = "Absolute Floor Height:";
label2.Text = "Absolute floor height:";
//
// label3
//
label3.AutoSize = true;
label3.Location = new System.Drawing.Point(60, 5);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(119, 13);
label3.Size = new System.Drawing.Size(116, 13);
label3.TabIndex = 27;
label3.Text = "Absolute Ceiling Height:";
label3.Text = "Absolute ceiling height:";
//
// positiony
//
this.positiony.AllowDecimal = false;
this.positiony.AllowExpressions = true;
this.positiony.AllowNegative = true;
this.positiony.AllowRelative = true;
this.positiony.AllowExpressions = true;
this.positiony.ButtonStep = 1;
this.positiony.ButtonStepBig = 8F;
this.positiony.ButtonStepFloat = 1F;
@ -198,9 +198,9 @@ namespace CodeImp.DoomBuilder.Windows
// positionx
//
this.positionx.AllowDecimal = false;
this.positionx.AllowExpressions = true;
this.positionx.AllowNegative = true;
this.positionx.AllowRelative = true;
this.positionx.AllowExpressions = true;
this.positionx.ButtonStep = 1;
this.positionx.ButtonStepBig = 8F;
this.positionx.ButtonStepFloat = 1F;

View file

@ -265,7 +265,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
sectorcolor = areacolor.WithAlpha(alpha).ToInt();
//mxd. Calculate fogfactor
fogfactor = VisualGeometry.CalculateFogFactor(level.sector.FogMode, brightness);
fogfactor = VisualGeometry.CalculateFogFactor(level.sector, brightness);
}
}
//TECH: even Bright Thing frames are affected by custom fade...
@ -277,7 +277,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(level != null && level.sector.FogMode > SectorFogMode.CLASSIC)
{
//mxd. Calculate fogfactor
fogfactor = VisualGeometry.CalculateFogFactor(level.sector.FogMode, level.brightnessbelow);
fogfactor = VisualGeometry.CalculateFogFactor(level.sector, level.brightnessbelow);
}
}
}

View file

@ -1,4 +1,5 @@
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.GZBuilder.Data;
using CodeImp.DoomBuilder.Rendering;
namespace CodeImp.DoomBuilder.BuilderModes
{
@ -16,10 +17,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
data = sourcedata;
}
public void Update()
public void Update()
{
// Create ceiling glow effect?
if(General.Map.Data.GlowingFlats.ContainsKey(data.Sector.LongCeilTexture))
data.CeilingGlow = GetGlowData(false);
if(data.CeilingGlow != null)
{
// Create ceiling level?
if(ceillevel == null)
@ -29,20 +31,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Update ceiling level
data.CeilingGlow = General.Map.Data.GlowingFlats[data.Sector.LongCeilTexture];
ceillevel.brightnessbelow = -1; // We need this plane for clipping only,
ceillevel.color = 0; // so we need to reset all shading and coloring
ceillevel.plane = data.Ceiling.plane;
ceillevel.plane.Offset -= data.CeilingGlow.Height;
data.CeilingGlowPlane = ceillevel.plane;
}
else
{
data.CeilingGlow = null;
}
// Create floor glow effect?
if(General.Map.Data.GlowingFlats.ContainsKey(data.Sector.LongFloorTexture))
data.FloorGlow = GetGlowData(true);
if(data.FloorGlow != null)
{
// Create floor level?
if(floorlevel == null)
@ -52,7 +50,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Update floor level
data.FloorGlow = General.Map.Data.GlowingFlats[data.Sector.LongFloorTexture];
floorlevel.plane = data.Floor.plane.GetInverted();
floorlevel.plane.Offset += data.FloorGlow.Height;
@ -72,10 +69,39 @@ namespace CodeImp.DoomBuilder.BuilderModes
data.FloorGlowPlane = floorlevel.plane;
}
else
}
private GlowingFlatData GetGlowData(bool floor)
{
// Check UDMF glow properties
if(General.Map.UDMF)
{
data.FloorGlow = null;
int glowcolor = data.Sector.Fields.GetValue((floor ? "floorglowcolor" : "ceilingglowcolor"), 0);
// Glow is explicidly disabled?
if(glowcolor == -1) return null;
// Avoid black glows
if(glowcolor > 0)
{
float glowheight = data.Sector.Fields.GetValue((floor ? "floorglowheight" : "ceilingglowheight"), 0f);
if(glowheight > 0f)
{
// Create glow data
PixelColor c = PixelColor.FromInt(glowcolor);
return new GlowingFlatData
{
Color = c,
Height = glowheight,
Brightness = (c.r + c.g + c.b) / 3,
};
}
}
}
// Use GLDEFS glow if available
long texture = (floor ? data.Sector.LongFloorTexture : data.Sector.LongCeilTexture);
return (General.Map.Data.GlowingFlats.ContainsKey(texture) ? General.Map.Data.GlowingFlats[texture] : null);
}
}
}

View file

@ -15,7 +15,7 @@ namespace mxd.VersionFromGIT
{
#region ======================== Constants
private const string GIT_INFO = "@echo off\r\ngit rev-list --count master\r\ngit rev-parse --short=7 master";
private const string GIT_INFO = "@echo off\r\ngit rev-list --count origin/master\r\ngit rev-parse --short=7 origin/master";
#endregion

Binary file not shown.