diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index a24c0b0..e7d1e32 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -124,6 +124,8 @@ namespace CodeImp.DoomBuilder.Config private bool showcolormaps = true; private bool drawCrosshair; private bool drawFullCrosshair; + private bool drawThingsFixedSize; + private float defaultThingSize; private int maxRecentFiles; private bool autoClearSideTextures; private bool storeSelectedEditTab; @@ -231,6 +233,8 @@ namespace CodeImp.DoomBuilder.Config public bool ShowColormaps { get { return showcolormaps; } set { showcolormaps = value; } } //mxd public bool DrawCrosshair { get { return drawCrosshair; } internal set { drawCrosshair = value; } } public bool DrawFullCrosshair { get { return drawFullCrosshair; } internal set { drawFullCrosshair = value; } } + public bool DrawThingsFixedSize { get { return drawThingsFixedSize; } internal set { drawThingsFixedSize = value; } } + public float DefaultThingSize { get { return defaultThingSize; } internal set { defaultThingSize = value; } } public int MaxRecentFiles { get { return maxRecentFiles; } internal set { maxRecentFiles = General.Clamp(value, 8, 25); } } public bool AutoClearSidedefTextures { get { return autoClearSideTextures; } internal set { autoClearSideTextures = value; } } public bool StoreSelectedEditTab { get { return storeSelectedEditTab; } internal set { storeSelectedEditTab = value; } } @@ -357,8 +361,10 @@ namespace CodeImp.DoomBuilder.Config lastUsedConfigName = cfg.ReadSetting("lastusedconfigname", ""); lastUsedMapFolder = cfg.ReadSetting("lastusedmapfolder", ""); gzMarkExtraFloors = cfg.ReadSetting("gzmarkextrafloors", true); - DrawCrosshair = cfg.ReadSetting("drawcrosshair", true); + drawCrosshair = cfg.ReadSetting("drawcrosshair", true); drawFullCrosshair = cfg.ReadSetting("drawfullcrosshair", false); + drawThingsFixedSize = cfg.ReadSetting("drawthingsfixedsize", false); + defaultThingSize = cfg.ReadSetting("defaultthingsize", 8f); maxRecentFiles = cfg.ReadSetting("maxrecentfiles", 8); autoClearSideTextures = cfg.ReadSetting("autoclearsidetextures", true); storeSelectedEditTab = cfg.ReadSetting("storeselectededittab", true); @@ -467,6 +473,8 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("gzmarkextrafloors", gzMarkExtraFloors); cfg.WriteSetting("drawcrosshair", drawCrosshair); cfg.WriteSetting("drawfullcrosshair", drawFullCrosshair); + cfg.WriteSetting("drawthingsfixedsize", drawThingsFixedSize); + cfg.WriteSetting("defaultthingsize", defaultThingSize); if (!string.IsNullOrEmpty(lastUsedConfigName)) cfg.WriteSetting("lastusedconfigname", lastUsedConfigName); if(!string.IsNullOrEmpty(lastUsedMapFolder)) diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 294f324..5ade228 100644 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -987,10 +987,11 @@ namespace CodeImp.DoomBuilder.Rendering // Returns false when not on the screen private bool CreateThingBoxVerts(Thing t, ref FlatVertex[] verts, Dictionary thingsByPosition, int offset, PixelColor c) { - if(t.Size * scale < MINIMUM_THING_RADIUS) return false; //mxd. Don't render tiny little things + float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size; + if(thingsize * scale < MINIMUM_THING_RADIUS) return false; //mxd. Don't render tiny little things // Determine size - float circlesize = (t.FixedSize && (scale > 1.0f) ? t.Size /* * THING_CIRCLE_SIZE*/ : t.Size * scale /* * THING_CIRCLE_SIZE*/); + float circlesize = (t.FixedSize && (scale > 1.0f) ? thingsize /* * THING_CIRCLE_SIZE*/ : thingsize * scale /* * THING_CIRCLE_SIZE*/); // Transform to screen coordinates Vector2D screenpos = ((Vector2D)t.Position).GetTransformed(translatex, translatey, scale, -scale); @@ -1042,8 +1043,9 @@ namespace CodeImp.DoomBuilder.Rendering //mxd private void CreateThingArrowVerts(Thing t, ref FlatVertex[] verts, Vector2D screenpos, int offset) { - // Determine size - float arrowsize = (t.FixedSize && (scale > 1.0f) ? t.Size : t.Size * scale) * THING_ARROW_SIZE; //mxd + // Determine size + float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size; + float arrowsize = (t.FixedSize && (scale > 1.0f) ? thingsize : thingsize * scale) * THING_ARROW_SIZE; //mxd // Setup rotated rect for arrow float sinarrowsize = (float)Math.Sin(t.Angle + Angle2D.PI * 0.25f) * arrowsize; @@ -1246,26 +1248,28 @@ namespace CodeImp.DoomBuilder.Rendering float spriteWidth, spriteHeight; float spriteScale = (group.Value[0].FixedSize && (scale > 1.0f)) ? 1.0f : scale; + float radius = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : info.Radius; if(sprite.Width > sprite.Height) { - spriteWidth = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; + spriteWidth = radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; spriteHeight = spriteWidth * ((float)sprite.Height / sprite.Width); } else if(sprite.Width < sprite.Height) { - spriteHeight = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; + spriteHeight = radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; spriteWidth = spriteHeight * ((float)sprite.Width / sprite.Height); } else { - spriteWidth = info.Radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; + spriteWidth = radius * spriteScale - THING_SPRITE_SHRINK * spriteScale; spriteHeight = spriteWidth; } foreach(Thing t in group.Value) { if(t.IsModel && (General.Settings.GZDrawModelsMode == ModelRenderMode.ALL || (General.Settings.GZDrawModelsMode == ModelRenderMode.SELECTION && t.Selected) || (General.Settings.GZDrawModelsMode == ModelRenderMode.ACTIVE_THINGS_FILTER && alpha == 1.0f))) continue; - float scaler = t.Size / info.Radius; + float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size; + float scaler = thingsize / radius; if(Math.Max(spriteWidth, spriteHeight) * scaler < MINIMUM_SPRITE_RADIUS) continue; //don't render tiny little sprites CreateThingSpriteVerts(thingsByPosition[t], spriteWidth * scaler, spriteHeight * scaler, ref verts, buffercount * 6, t.Selected ? selectionColor : 0xFFFFFF); diff --git a/Source/Core/Windows/PreferencesForm.Designer.cs b/Source/Core/Windows/PreferencesForm.Designer.cs index 7b5266f..37702b9 100644 --- a/Source/Core/Windows/PreferencesForm.Designer.cs +++ b/Source/Core/Windows/PreferencesForm.Designer.cs @@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Windows System.Windows.Forms.Label label18; System.Windows.Forms.Label label20; System.Windows.Forms.Label label21; + System.Windows.Forms.Label label29; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesForm)); this.maxBackups = new System.Windows.Forms.TrackBar(); this.labelBackups = new System.Windows.Forms.Label(); @@ -140,6 +141,10 @@ namespace CodeImp.DoomBuilder.Windows this.actionkey = new System.Windows.Forms.TextBox(); this.tabcolors = new System.Windows.Forms.TabPage(); this.appearancegroup1 = new System.Windows.Forms.GroupBox(); + this.labelDefaultThingSize = new System.Windows.Forms.Label(); + this.tbDefaultThingSize = new System.Windows.Forms.TrackBar(); + this.cbDrawThingsFixedSize = new System.Windows.Forms.CheckBox(); + this.cbDrawCrosshair = new System.Windows.Forms.CheckBox(); this.cbDrawFullCrosshair = new System.Windows.Forms.CheckBox(); this.capitalizetexturenames = new System.Windows.Forms.CheckBox(); this.cbMarkExtraFloors = new System.Windows.Forms.CheckBox(); @@ -214,7 +219,6 @@ namespace CodeImp.DoomBuilder.Windows this.pasteoptions = new CodeImp.DoomBuilder.Controls.PasteOptionsControl(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.browseScreenshotsFolderDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.cbDrawCrosshair = new System.Windows.Forms.CheckBox(); label7 = new System.Windows.Forms.Label(); label6 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label(); @@ -223,6 +227,7 @@ namespace CodeImp.DoomBuilder.Windows label18 = new System.Windows.Forms.Label(); label20 = new System.Windows.Forms.Label(); label21 = new System.Windows.Forms.Label(); + label29 = new System.Windows.Forms.Label(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.maxBackups)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.recentFiles)).BeginInit(); @@ -247,6 +252,7 @@ namespace CodeImp.DoomBuilder.Windows this.actioncontrolpanel.SuspendLayout(); this.tabcolors.SuspendLayout(); this.appearancegroup1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbDefaultThingSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).BeginInit(); @@ -641,6 +647,16 @@ namespace CodeImp.DoomBuilder.Windows label21.Text = "Dynamic light intensity:"; label21.TextAlign = System.Drawing.ContentAlignment.TopRight; // + // label29 + // + label29.AutoSize = true; + label29.Location = new System.Drawing.Point(51, 161); + label29.Name = "label29"; + label29.Size = new System.Drawing.Size(118, 13); + label29.TabIndex = 41; + label29.Text = "Default Thing size (2D):"; + label29.TextAlign = System.Drawing.ContentAlignment.TopRight; + // // keyusedlabel // this.keyusedlabel.AutoSize = true; @@ -831,7 +847,7 @@ namespace CodeImp.DoomBuilder.Windows // cbStretchView // this.cbStretchView.AutoSize = true; - this.cbStretchView.Location = new System.Drawing.Point(25, 277); + this.cbStretchView.Location = new System.Drawing.Point(25, 313); this.cbStretchView.Name = "cbStretchView"; this.cbStretchView.Size = new System.Drawing.Size(172, 17); this.cbStretchView.TabIndex = 18; @@ -843,7 +859,7 @@ namespace CodeImp.DoomBuilder.Windows // qualitydisplay // this.qualitydisplay.AutoSize = true; - this.qualitydisplay.Location = new System.Drawing.Point(25, 191); + this.qualitydisplay.Location = new System.Drawing.Point(25, 227); this.qualitydisplay.Name = "qualitydisplay"; this.qualitydisplay.Size = new System.Drawing.Size(128, 17); this.qualitydisplay.TabIndex = 7; @@ -1510,6 +1526,10 @@ 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(label29); + this.appearancegroup1.Controls.Add(this.labelDefaultThingSize); + this.appearancegroup1.Controls.Add(this.tbDefaultThingSize); + this.appearancegroup1.Controls.Add(this.cbDrawThingsFixedSize); this.appearancegroup1.Controls.Add(this.cbDrawCrosshair); this.appearancegroup1.Controls.Add(this.cbDrawFullCrosshair); this.appearancegroup1.Controls.Add(this.capitalizetexturenames); @@ -1540,10 +1560,57 @@ namespace CodeImp.DoomBuilder.Windows this.appearancegroup1.TabStop = false; this.appearancegroup1.Text = " Additional Options "; // + // labelDefaultThingSize + // + this.labelDefaultThingSize.AutoSize = true; + this.labelDefaultThingSize.Location = new System.Drawing.Point(337, 161); + this.labelDefaultThingSize.Name = "labelDefaultThingSize"; + this.labelDefaultThingSize.Size = new System.Drawing.Size(13, 13); + this.labelDefaultThingSize.TabIndex = 42; + this.labelDefaultThingSize.Text = "8"; + // + // tbDefaultThingSize + // + this.tbDefaultThingSize.BackColor = System.Drawing.SystemColors.Window; + this.tbDefaultThingSize.LargeChange = 4; + this.tbDefaultThingSize.Location = new System.Drawing.Point(176, 151); + this.tbDefaultThingSize.Maximum = 64; + this.tbDefaultThingSize.Minimum = 1; + this.tbDefaultThingSize.Name = "tbDefaultThingSize"; + this.tbDefaultThingSize.Size = new System.Drawing.Size(154, 45); + this.tbDefaultThingSize.TabIndex = 40; + this.tbDefaultThingSize.TickFrequency = 4; + this.tbDefaultThingSize.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.tbDefaultThingSize.Value = 8; + this.tbDefaultThingSize.ValueChanged += new System.EventHandler(this.tbDefaultThingSize_ValueChanged); + // + // cbDrawThingsFixedSize + // + this.cbDrawThingsFixedSize.AutoSize = true; + this.cbDrawThingsFixedSize.Location = new System.Drawing.Point(237, 313); + this.cbDrawThingsFixedSize.Name = "cbDrawThingsFixedSize"; + this.cbDrawThingsFixedSize.Size = new System.Drawing.Size(172, 17); + this.cbDrawThingsFixedSize.TabIndex = 39; + this.cbDrawThingsFixedSize.Text = "Draw Things at fixed size in 2D"; + this.toolTip1.SetToolTip(this.cbDrawThingsFixedSize, "If enabled, things in classic modes will be drawn at a fixed size, independent of" + + " their actual size."); + this.cbDrawThingsFixedSize.UseVisualStyleBackColor = true; + // + // cbDrawCrosshair + // + this.cbDrawCrosshair.AutoSize = true; + this.cbDrawCrosshair.Location = new System.Drawing.Point(237, 269); + this.cbDrawCrosshair.Name = "cbDrawCrosshair"; + this.cbDrawCrosshair.Size = new System.Drawing.Size(176, 17); + this.cbDrawCrosshair.TabIndex = 38; + this.cbDrawCrosshair.Text = "Draw crosshair in classic modes"; + this.toolTip1.SetToolTip(this.cbDrawCrosshair, "If disabled, the crosshair in classic modes\r\nwill not be drawn."); + this.cbDrawCrosshair.UseVisualStyleBackColor = true; + // // cbDrawFullCrosshair // this.cbDrawFullCrosshair.AutoSize = true; - this.cbDrawFullCrosshair.Location = new System.Drawing.Point(237, 254); + this.cbDrawFullCrosshair.Location = new System.Drawing.Point(237, 290); this.cbDrawFullCrosshair.Name = "cbDrawFullCrosshair"; this.cbDrawFullCrosshair.Size = new System.Drawing.Size(192, 17); this.cbDrawFullCrosshair.TabIndex = 37; @@ -1555,7 +1622,7 @@ namespace CodeImp.DoomBuilder.Windows // capitalizetexturenames // this.capitalizetexturenames.AutoSize = true; - this.capitalizetexturenames.Location = new System.Drawing.Point(237, 170); + this.capitalizetexturenames.Location = new System.Drawing.Point(237, 206); this.capitalizetexturenames.Name = "capitalizetexturenames"; this.capitalizetexturenames.Size = new System.Drawing.Size(140, 17); this.capitalizetexturenames.TabIndex = 36; @@ -1567,7 +1634,7 @@ namespace CodeImp.DoomBuilder.Windows // cbMarkExtraFloors // this.cbMarkExtraFloors.AutoSize = true; - this.cbMarkExtraFloors.Location = new System.Drawing.Point(25, 254); + this.cbMarkExtraFloors.Location = new System.Drawing.Point(25, 290); this.cbMarkExtraFloors.Name = "cbMarkExtraFloors"; this.cbMarkExtraFloors.Size = new System.Drawing.Size(175, 17); this.cbMarkExtraFloors.TabIndex = 35; @@ -1579,7 +1646,7 @@ namespace CodeImp.DoomBuilder.Windows // cbOldHighlightMode // this.cbOldHighlightMode.AutoSize = true; - this.cbOldHighlightMode.Location = new System.Drawing.Point(237, 212); + this.cbOldHighlightMode.Location = new System.Drawing.Point(237, 248); this.cbOldHighlightMode.Name = "cbOldHighlightMode"; this.cbOldHighlightMode.Size = new System.Drawing.Size(207, 17); this.cbOldHighlightMode.TabIndex = 33; @@ -1660,7 +1727,7 @@ namespace CodeImp.DoomBuilder.Windows // animatevisualselection // this.animatevisualselection.AutoSize = true; - this.animatevisualselection.Location = new System.Drawing.Point(237, 191); + this.animatevisualselection.Location = new System.Drawing.Point(237, 227); this.animatevisualselection.Name = "animatevisualselection"; this.animatevisualselection.Size = new System.Drawing.Size(184, 17); this.animatevisualselection.TabIndex = 23; @@ -1670,7 +1737,7 @@ namespace CodeImp.DoomBuilder.Windows // blackbrowsers // this.blackbrowsers.AutoSize = true; - this.blackbrowsers.Location = new System.Drawing.Point(25, 170); + this.blackbrowsers.Location = new System.Drawing.Point(25, 206); this.blackbrowsers.Name = "blackbrowsers"; this.blackbrowsers.Size = new System.Drawing.Size(195, 17); this.blackbrowsers.TabIndex = 4; @@ -1680,7 +1747,7 @@ namespace CodeImp.DoomBuilder.Windows // visualbilinear // this.visualbilinear.AutoSize = true; - this.visualbilinear.Location = new System.Drawing.Point(25, 233); + this.visualbilinear.Location = new System.Drawing.Point(25, 269); this.visualbilinear.Name = "visualbilinear"; this.visualbilinear.Size = new System.Drawing.Size(171, 17); this.visualbilinear.TabIndex = 6; @@ -1690,7 +1757,7 @@ namespace CodeImp.DoomBuilder.Windows // classicbilinear // this.classicbilinear.AutoSize = true; - this.classicbilinear.Location = new System.Drawing.Point(25, 212); + this.classicbilinear.Location = new System.Drawing.Point(25, 248); this.classicbilinear.Name = "classicbilinear"; this.classicbilinear.Size = new System.Drawing.Size(176, 17); this.classicbilinear.TabIndex = 5; @@ -2424,17 +2491,6 @@ namespace CodeImp.DoomBuilder.Windows // this.browseScreenshotsFolderDialog.Description = "Select a Folder to Save Screenshots Into"; // - // cbDrawCrosshair - // - this.cbDrawCrosshair.AutoSize = true; - this.cbDrawCrosshair.Location = new System.Drawing.Point(237, 233); - this.cbDrawCrosshair.Name = "cbDrawCrosshair"; - this.cbDrawCrosshair.Size = new System.Drawing.Size(176, 17); - this.cbDrawCrosshair.TabIndex = 38; - this.cbDrawCrosshair.Text = "Draw crosshair in classic modes"; - this.toolTip1.SetToolTip(this.cbDrawCrosshair, "If disabled, the crosshair in classic modes\r\nwill not be drawn."); - this.cbDrawCrosshair.UseVisualStyleBackColor = true; - // // PreferencesForm // this.AcceptButton = this.apply; @@ -2489,6 +2545,7 @@ namespace CodeImp.DoomBuilder.Windows this.tabcolors.ResumeLayout(false); this.appearancegroup1.ResumeLayout(false); this.appearancegroup1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbDefaultThingSize)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).EndInit(); @@ -2689,5 +2746,8 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Label label28; private CodeImp.DoomBuilder.Controls.ColorControl colorproperties; private System.Windows.Forms.CheckBox cbDrawCrosshair; + private System.Windows.Forms.CheckBox cbDrawThingsFixedSize; + private System.Windows.Forms.Label labelDefaultThingSize; + private System.Windows.Forms.TrackBar tbDefaultThingSize; } } \ No newline at end of file diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index 63f5e82..ae685e2 100644 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -107,6 +107,9 @@ namespace CodeImp.DoomBuilder.Windows cbMarkExtraFloors.Checked = General.Settings.GZMarkExtraFloors; cbDrawCrosshair.Checked = General.Settings.DrawCrosshair; cbDrawFullCrosshair.Checked = General.Settings.DrawFullCrosshair; + cbDrawThingsFixedSize.Checked = General.Settings.DrawThingsFixedSize; + tbDefaultThingSize.Value = General.Clamp((int)General.Settings.DefaultThingSize, tbDefaultThingSize.Minimum, tbDefaultThingSize.Maximum); + labelDefaultThingSize.Text = ((int)General.Settings.DefaultThingSize).ToString(); recentFiles.Value = General.Settings.MaxRecentFiles; maxBackups.Value = General.Settings.MaxBackups; screenshotsfolderpath.Text = General.Settings.ScreenshotsPath; @@ -384,6 +387,8 @@ namespace CodeImp.DoomBuilder.Windows General.Settings.GZMarkExtraFloors = cbMarkExtraFloors.Checked; General.Settings.DrawCrosshair = cbDrawCrosshair.Checked; General.Settings.DrawFullCrosshair = cbDrawFullCrosshair.Checked; + General.Settings.DrawThingsFixedSize = cbDrawThingsFixedSize.Checked; + General.Settings.DefaultThingSize = tbDefaultThingSize.Value; // Paste options General.Settings.PasteOptions = pasteoptions.GetOptions(); @@ -964,6 +969,12 @@ namespace CodeImp.DoomBuilder.Windows labelDynLightIntensity.Text = ((float)tbDynLightIntensity.Value / 10).ToString(); } + //mxd + private void tbDefaultThingSize_ValueChanged(object sender, EventArgs e) + { + labelDefaultThingSize.Text = ((int)tbDefaultThingSize.Value).ToString(); + } + #endregion #region ================== Script Editor Panel (mxd) diff --git a/Source/Core/Windows/PreferencesForm.resx b/Source/Core/Windows/PreferencesForm.resx index 5756023..1cfcf11 100644 --- a/Source/Core/Windows/PreferencesForm.resx +++ b/Source/Core/Windows/PreferencesForm.resx @@ -144,6 +144,12 @@ False + + False + + + 17, 17 + When enabled, the opening brace will be placed on a new line when