diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs index b447a3dc..1396dfbd 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs @@ -1079,19 +1079,18 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Start dragging the selection - if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag()) //mxd + if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag(draglines)) //mxd General.Editing.ChangeMode(new DragLinedefsMode(mousedownmappos, draglines)); } } } //mxd. Check if any selected linedef is outside of map boundary - private static bool CanDrag() + private static bool CanDrag(ICollection draglines) { - ICollection selectedlines = General.Map.Map.GetSelectedLinedefs(true); int unaffectedCount = 0; - foreach(Linedef l in selectedlines) + foreach(Linedef l in draglines) { // Make sure the linedef is inside the map boundary if(l.Start.Position.x < General.Map.Config.LeftBoundary || l.Start.Position.x > General.Map.Config.RightBoundary @@ -1099,21 +1098,22 @@ namespace CodeImp.DoomBuilder.BuilderModes || l.End.Position.x < General.Map.Config.LeftBoundary || l.End.Position.x > General.Map.Config.RightBoundary || l.End.Position.y > General.Map.Config.TopBoundary || l.End.Position.y < General.Map.Config.BottomBoundary) { - - l.Selected = false; unaffectedCount++; } } - if(unaffectedCount == selectedlines.Count) + if (unaffectedCount == draglines.Count) { - General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (selectedlines.Count == 1 ? "selected linedef is" : "all of selected linedefs are") + " outside of map boundary!"); + General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (draglines.Count == 1 ? "selected linedef is" : "all of selected linedefs are") + " outside of map boundary!"); General.Interface.RedrawDisplay(); return false; } - if(unaffectedCount > 0) + if (unaffectedCount > 0) + { General.Interface.DisplayStatus(StatusType.Warning, unaffectedCount + " of selected linedefs " + (unaffectedCount == 1 ? "is" : "are") + " outside of map boundary!"); + return false; + } return true; } diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index 1c294ccc..17145bae 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -1334,19 +1334,18 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Start dragging the selection - if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag()) //mxd + if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag(dragsectors)) //mxd General.Editing.ChangeMode(new DragSectorsMode(mousedownmappos, dragsectors)); } } } //mxd. Check if any selected sector is outside of map boundary - private bool CanDrag() + private bool CanDrag(ICollection dragsectors) { - ICollection selectedsectors = General.Map.Map.GetSelectedSectors(true); int unaffectedCount = 0; - foreach(Sector s in selectedsectors) + foreach(Sector s in dragsectors) { // Make sure the sector is inside the map boundary foreach(Sidedef sd in s.Sidedefs) @@ -1356,24 +1355,25 @@ namespace CodeImp.DoomBuilder.BuilderModes || sd.Line.End.Position.x < General.Map.Config.LeftBoundary || sd.Line.End.Position.x > General.Map.Config.RightBoundary || sd.Line.End.Position.y > General.Map.Config.TopBoundary || sd.Line.End.Position.y < General.Map.Config.BottomBoundary) { - SelectSector(s, false, false); unaffectedCount++; break; } } } - if(unaffectedCount == selectedsectors.Count) + if (unaffectedCount == dragsectors.Count) { - General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (selectedsectors.Count == 1 ? "selected sector is" : "all of selected sectors are") + " outside of map boundary!"); + General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (dragsectors.Count == 1 ? "selected sector is" : "all of selected sectors are") + " outside of map boundary!"); General.Interface.RedrawDisplay(); return false; } - if(unaffectedCount > 0) + if (unaffectedCount > 0) + { General.Interface.DisplayStatus(StatusType.Warning, unaffectedCount + " of selected sectors " + (unaffectedCount == 1 ? "is" : "are") + " outside of map boundary!"); + return false; + } - UpdateSelectedLabels(); //mxd return true; } diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index 8465ed64..a284460a 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -759,7 +759,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Start dragging the selection - if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag()) //mxd + if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag(dragthings)) //mxd { // Shift pressed? Clone things! bool thingscloned = false; @@ -820,31 +820,32 @@ namespace CodeImp.DoomBuilder.BuilderModes } //mxd. Check if any selected thing is outside of map boundary - private static bool CanDrag() + private static bool CanDrag(ICollection dragthings) { - ICollection selectedthings = General.Map.Map.GetSelectedThings(true); int unaffectedCount = 0; - foreach(Thing t in selectedthings) + foreach(Thing t in dragthings) { // Make sure the vertex is inside the map boundary if(t.Position.x < General.Map.Config.LeftBoundary || t.Position.x > General.Map.Config.RightBoundary || t.Position.y > General.Map.Config.TopBoundary || t.Position.y < General.Map.Config.BottomBoundary) { - t.Selected = false; unaffectedCount++; } } - if(unaffectedCount == selectedthings.Count) + if (unaffectedCount == dragthings.Count) { - General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (selectedthings.Count == 1 ? "selected thing is" : "all of selected things are") + " outside of map boundary!"); + General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (dragthings.Count == 1 ? "selected thing is" : "all of selected things are") + " outside of map boundary!"); General.Interface.RedrawDisplay(); return false; } - if(unaffectedCount > 0) + if (unaffectedCount > 0) + { General.Interface.DisplayStatus(StatusType.Warning, unaffectedCount + " of selected vertices " + (unaffectedCount == 1 ? "is" : "are") + " outside of map boundary!"); + return false; + } return true; } diff --git a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs index d40207a7..8f9582ea 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs @@ -654,39 +654,39 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Start dragging the selection - if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag()) //mxd + if(!BuilderPlug.Me.DontMoveGeometryOutsideMapBoundary || CanDrag(dragvertices)) //mxd General.Editing.ChangeMode(new DragVerticesMode(mousedownmappos, dragvertices)); } } } //mxd. Check if any selected vertex is outside of map boundary - private static bool CanDrag() + private static bool CanDrag(ICollection dragvertices) { - ICollection selectedverts = General.Map.Map.GetSelectedVertices(true); int unaffectedCount = 0; - foreach(Vertex v in selectedverts) + foreach(Vertex v in dragvertices) { // Make sure the vertex is inside the map boundary if(v.Position.x < General.Map.Config.LeftBoundary || v.Position.x > General.Map.Config.RightBoundary || v.Position.y > General.Map.Config.TopBoundary || v.Position.y < General.Map.Config.BottomBoundary) { - - v.Selected = false; unaffectedCount++; } } - if(unaffectedCount == selectedverts.Count) + if (unaffectedCount == dragvertices.Count) { - General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (selectedverts.Count == 1 ? "selected vertex is" : "all of selected vertices are") + " outside of map boundary!"); + General.Interface.DisplayStatus(StatusType.Warning, "Unable to drag selection: " + (dragvertices.Count == 1 ? "selected vertex is" : "all of selected vertices are") + " outside of map boundary!"); General.Interface.RedrawDisplay(); return false; } - - if(unaffectedCount > 0) + + if (unaffectedCount > 0) + { General.Interface.DisplayStatus(StatusType.Warning, unaffectedCount + " of selected vertices " + (unaffectedCount == 1 ? "is" : "are") + " outside of map boundary!"); + return false; + } return true; } diff --git a/Source/Plugins/BuilderModes/General/BuilderPlug.cs b/Source/Plugins/BuilderModes/General/BuilderPlug.cs index 73cce8d0..8ec83444 100755 --- a/Source/Plugins/BuilderModes/General/BuilderPlug.cs +++ b/Source/Plugins/BuilderModes/General/BuilderPlug.cs @@ -678,9 +678,6 @@ namespace CodeImp.DoomBuilder.BuilderModes [BeginAction("exporttoimage")] private void ExportToImage() { - // Convert geometry selection to sectors - General.Map.Map.ConvertSelection(SelectionType.Sectors); - // Get sectors ICollection sectors = General.Map.Map.SelectedSectorsCount == 0 ? General.Map.Map.Sectors : General.Map.Map.GetSelectedSectors(true); if (sectors.Count == 0) diff --git a/Source/Plugins/BuilderModes/IO/ImageExporter.cs b/Source/Plugins/BuilderModes/IO/ImageExporter.cs index 5a3f0bb6..4e88511e 100644 --- a/Source/Plugins/BuilderModes/IO/ImageExporter.cs +++ b/Source/Plugins/BuilderModes/IO/ImageExporter.cs @@ -50,11 +50,12 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO public bool ApplySectorColors; public bool Brightmap; public bool Tiles; + public bool Transparency; public PixelFormat PixelFormat; public ImageFormat ImageFormat; public float Scale; - public ImageExportSettings(string path, string name, string extension, bool floor, bool fullbright, bool applysectorcolors, bool brightmap, bool tiles, float scale, PixelFormat pformat, ImageFormat iformat) + public ImageExportSettings(string path, string name, string extension, bool floor, bool fullbright, bool applysectorcolors, bool brightmap, bool transparency, bool tiles, float scale, PixelFormat pformat, ImageFormat iformat) { Path = path; Name = name; @@ -63,6 +64,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO Brightmap = brightmap; Tiles = tiles; Fullbright = fullbright; + Transparency = transparency; ApplySectorColors = applysectorcolors; PixelFormat = pformat; ImageFormat = iformat; @@ -201,11 +203,15 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO // The texture using (Graphics gtexture = Graphics.FromImage(texturebitmap)) { - gtexture.Clear(Color.Black); // If we don't clear to black we'll see seams where the sectors touch, due to the AA + if (!settings.Transparency) + { + gtexture.Clear(Color.Black); // If we don't clear to black we'll see seams where the sectors touch, due to the AA + gtexture.SmoothingMode = SmoothingMode.AntiAlias; // Without AA the sector edges will be quite rough + } + gtexture.InterpolationMode = InterpolationMode.HighQualityBilinear; gtexture.CompositingQuality = CompositingQuality.HighQuality; - gtexture.PixelOffsetMode = PixelOffsetMode.HighQuality; - gtexture.SmoothingMode = SmoothingMode.AntiAlias; // Without AA the sector edges will be quite rough + gtexture.PixelOffsetMode = PixelOffsetMode.HighQuality; using (GraphicsPath gpath = new GraphicsPath()) { diff --git a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.Designer.cs index e65a379d..7165d9c6 100644 --- a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.Designer.cs @@ -28,266 +28,286 @@ /// private void InitializeComponent() { - this.tbExportPath = new System.Windows.Forms.TextBox(); - this.browse = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.close = new System.Windows.Forms.Button(); - this.export = new System.Windows.Forms.Button(); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.cbImageFormat = new System.Windows.Forms.ComboBox(); - this.cbPixelFormat = new System.Windows.Forms.ComboBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.rbFloor = new System.Windows.Forms.RadioButton(); - this.rbCeiling = new System.Windows.Forms.RadioButton(); - this.cbFullbright = new System.Windows.Forms.CheckBox(); - this.cbBrightmap = new System.Windows.Forms.CheckBox(); - this.cbTiles = new System.Windows.Forms.CheckBox(); - this.cbScale = new System.Windows.Forms.ComboBox(); - this.label4 = new System.Windows.Forms.Label(); - this.progress = new System.Windows.Forms.ProgressBar(); - this.lbPhase = new System.Windows.Forms.Label(); - this.cbApplySectorColors = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // tbExportPath - // - this.tbExportPath.Location = new System.Drawing.Point(50, 9); - this.tbExportPath.Name = "tbExportPath"; - this.tbExportPath.Size = new System.Drawing.Size(344, 20); - this.tbExportPath.TabIndex = 2; - // - // browse - // - this.browse.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Folder; - this.browse.Location = new System.Drawing.Point(400, 7); - this.browse.Name = "browse"; - this.browse.Size = new System.Drawing.Size(30, 24); - this.browse.TabIndex = 3; - this.browse.UseVisualStyleBackColor = true; - this.browse.Click += new System.EventHandler(this.browse_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(32, 13); - this.label1.TabIndex = 4; - this.label1.Text = "Path:"; - // - // close - // - this.close.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.close.Location = new System.Drawing.Point(360, 153); - this.close.Name = "close"; - this.close.Size = new System.Drawing.Size(75, 23); - this.close.TabIndex = 7; - this.close.Text = "Close"; - this.close.UseVisualStyleBackColor = true; - this.close.Click += new System.EventHandler(this.close_Click); - // - // export - // - this.export.Location = new System.Drawing.Point(279, 153); - this.export.Name = "export"; - this.export.Size = new System.Drawing.Size(75, 23); - this.export.TabIndex = 6; - this.export.Text = "Export"; - this.export.UseVisualStyleBackColor = true; - this.export.Click += new System.EventHandler(this.export_Click); - // - // saveFileDialog - // - this.saveFileDialog.Filter = "PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|All files (*.*)|*.*"; - // - // cbImageFormat - // - this.cbImageFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbImageFormat.FormattingEnabled = true; - this.cbImageFormat.Items.AddRange(new object[] { - "PNG", - "JPG"}); - this.cbImageFormat.Location = new System.Drawing.Point(102, 35); - this.cbImageFormat.Name = "cbImageFormat"; - this.cbImageFormat.Size = new System.Drawing.Size(71, 21); - this.cbImageFormat.TabIndex = 8; - this.cbImageFormat.SelectedIndexChanged += new System.EventHandler(this.cbImageFormat_SelectedIndexChanged); - // - // cbPixelFormat - // - this.cbPixelFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbPixelFormat.FormattingEnabled = true; - this.cbPixelFormat.Items.AddRange(new object[] { - "32 bit", - "24 bit", - "16 bit"}); - this.cbPixelFormat.Location = new System.Drawing.Point(102, 62); - this.cbPixelFormat.Name = "cbPixelFormat"; - this.cbPixelFormat.Size = new System.Drawing.Size(71, 21); - this.cbPixelFormat.TabIndex = 9; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 38); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(71, 13); - this.label2.TabIndex = 10; - this.label2.Text = "Image format:"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 65); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(64, 13); - this.label3.TabIndex = 11; - this.label3.Text = "Color depth:"; - // - // rbFloor - // - this.rbFloor.AutoSize = true; - this.rbFloor.Checked = true; - this.rbFloor.Location = new System.Drawing.Point(197, 39); - this.rbFloor.Name = "rbFloor"; - this.rbFloor.Size = new System.Drawing.Size(48, 17); - this.rbFloor.TabIndex = 12; - this.rbFloor.TabStop = true; - this.rbFloor.Text = "Floor"; - this.rbFloor.UseVisualStyleBackColor = true; - // - // rbCeiling - // - this.rbCeiling.AutoSize = true; - this.rbCeiling.Location = new System.Drawing.Point(197, 61); - this.rbCeiling.Name = "rbCeiling"; - this.rbCeiling.Size = new System.Drawing.Size(56, 17); - this.rbCeiling.TabIndex = 13; - this.rbCeiling.Text = "Ceiling"; - this.rbCeiling.UseVisualStyleBackColor = true; - // - // cbFullbright - // - this.cbFullbright.AutoSize = true; - this.cbFullbright.Checked = true; - this.cbFullbright.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbFullbright.Location = new System.Drawing.Point(279, 40); - this.cbFullbright.Name = "cbFullbright"; - this.cbFullbright.Size = new System.Drawing.Size(87, 17); - this.cbFullbright.TabIndex = 14; - this.cbFullbright.Text = "Use fullbright"; - this.cbFullbright.UseVisualStyleBackColor = true; - // - // cbBrightmap - // - this.cbBrightmap.AutoSize = true; - this.cbBrightmap.Location = new System.Drawing.Point(279, 84); - this.cbBrightmap.Name = "cbBrightmap"; - this.cbBrightmap.Size = new System.Drawing.Size(106, 17); - this.cbBrightmap.TabIndex = 15; - this.cbBrightmap.Text = "Create brightmap"; - this.cbBrightmap.UseVisualStyleBackColor = true; - // - // cbTiles - // - this.cbTiles.AutoSize = true; - this.cbTiles.Location = new System.Drawing.Point(279, 108); - this.cbTiles.Name = "cbTiles"; - this.cbTiles.Size = new System.Drawing.Size(110, 17); - this.cbTiles.TabIndex = 16; - this.cbTiles.Text = "Create 64x64 tiles"; - this.cbTiles.UseVisualStyleBackColor = true; - // - // cbScale - // - this.cbScale.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbScale.FormattingEnabled = true; - this.cbScale.Items.AddRange(new object[] { - "100%", - "200%", - "400%", - "800%"}); - this.cbScale.Location = new System.Drawing.Point(102, 89); - this.cbScale.Name = "cbScale"; - this.cbScale.Size = new System.Drawing.Size(71, 21); - this.cbScale.TabIndex = 17; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(12, 92); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(37, 13); - this.label4.TabIndex = 18; - this.label4.Text = "Scale:"; - // - // progress - // - this.progress.Location = new System.Drawing.Point(12, 153); - this.progress.Name = "progress"; - this.progress.Size = new System.Drawing.Size(261, 23); - this.progress.Step = 1; - this.progress.TabIndex = 19; - this.progress.Visible = false; - // - // lbPhase - // - this.lbPhase.AutoSize = true; - this.lbPhase.Location = new System.Drawing.Point(14, 127); - this.lbPhase.Name = "lbPhase"; - this.lbPhase.Size = new System.Drawing.Size(45, 13); - this.lbPhase.TabIndex = 20; - this.lbPhase.Text = "lbPhase"; - this.lbPhase.Visible = false; - // - // cbApplySectorColors - // - this.cbApplySectorColors.AutoSize = true; - this.cbApplySectorColors.Checked = true; - this.cbApplySectorColors.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbApplySectorColors.Location = new System.Drawing.Point(279, 61); - this.cbApplySectorColors.Name = "cbApplySectorColors"; - this.cbApplySectorColors.Size = new System.Drawing.Size(115, 17); - this.cbApplySectorColors.TabIndex = 14; - this.cbApplySectorColors.Text = "Apply sector colors"; - this.cbApplySectorColors.UseVisualStyleBackColor = true; - // - // ImageExportSettingsForm - // - this.AcceptButton = this.export; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.close; - this.ClientSize = new System.Drawing.Size(447, 188); - this.Controls.Add(this.lbPhase); - this.Controls.Add(this.progress); - this.Controls.Add(this.label4); - this.Controls.Add(this.cbScale); - this.Controls.Add(this.cbTiles); - this.Controls.Add(this.cbBrightmap); - this.Controls.Add(this.cbApplySectorColors); - this.Controls.Add(this.cbFullbright); - this.Controls.Add(this.rbCeiling); - this.Controls.Add(this.rbFloor); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.cbPixelFormat); - this.Controls.Add(this.cbImageFormat); - this.Controls.Add(this.close); - this.Controls.Add(this.export); - this.Controls.Add(this.label1); - this.Controls.Add(this.browse); - this.Controls.Add(this.tbExportPath); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ImageExportSettingsForm"; - this.Text = "Image export settings"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ImageExportSettingsForm_FormClosing); - this.ResumeLayout(false); - this.PerformLayout(); - + this.components = new System.ComponentModel.Container(); + this.tbExportPath = new System.Windows.Forms.TextBox(); + this.browse = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.close = new System.Windows.Forms.Button(); + this.export = new System.Windows.Forms.Button(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.cbImageFormat = new System.Windows.Forms.ComboBox(); + this.cbPixelFormat = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.rbFloor = new System.Windows.Forms.RadioButton(); + this.rbCeiling = new System.Windows.Forms.RadioButton(); + this.cbFullbright = new System.Windows.Forms.CheckBox(); + this.cbBrightmap = new System.Windows.Forms.CheckBox(); + this.cbTiles = new System.Windows.Forms.CheckBox(); + this.cbScale = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.progress = new System.Windows.Forms.ProgressBar(); + this.lbPhase = new System.Windows.Forms.Label(); + this.cbApplySectorColors = new System.Windows.Forms.CheckBox(); + this.cbTransparency = new System.Windows.Forms.CheckBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // tbExportPath + // + this.tbExportPath.Location = new System.Drawing.Point(50, 9); + this.tbExportPath.Name = "tbExportPath"; + this.tbExportPath.Size = new System.Drawing.Size(344, 20); + this.tbExportPath.TabIndex = 2; + // + // browse + // + this.browse.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Folder; + this.browse.Location = new System.Drawing.Point(400, 7); + this.browse.Name = "browse"; + this.browse.Size = new System.Drawing.Size(30, 24); + this.browse.TabIndex = 3; + this.browse.UseVisualStyleBackColor = true; + this.browse.Click += new System.EventHandler(this.browse_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(32, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Path:"; + // + // close + // + this.close.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.close.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.close.Location = new System.Drawing.Point(360, 172); + this.close.Name = "close"; + this.close.Size = new System.Drawing.Size(75, 23); + this.close.TabIndex = 7; + this.close.Text = "Close"; + this.close.UseVisualStyleBackColor = true; + this.close.Click += new System.EventHandler(this.close_Click); + // + // export + // + this.export.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.export.Location = new System.Drawing.Point(279, 172); + this.export.Name = "export"; + this.export.Size = new System.Drawing.Size(75, 23); + this.export.TabIndex = 6; + this.export.Text = "Export"; + this.export.UseVisualStyleBackColor = true; + this.export.Click += new System.EventHandler(this.export_Click); + // + // saveFileDialog + // + this.saveFileDialog.Filter = "PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|All files (*.*)|*.*"; + // + // cbImageFormat + // + this.cbImageFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbImageFormat.FormattingEnabled = true; + this.cbImageFormat.Items.AddRange(new object[] { + "PNG", + "JPG"}); + this.cbImageFormat.Location = new System.Drawing.Point(102, 35); + this.cbImageFormat.Name = "cbImageFormat"; + this.cbImageFormat.Size = new System.Drawing.Size(71, 21); + this.cbImageFormat.TabIndex = 8; + this.cbImageFormat.SelectedIndexChanged += new System.EventHandler(this.cbImageFormat_SelectedIndexChanged); + // + // cbPixelFormat + // + this.cbPixelFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbPixelFormat.FormattingEnabled = true; + this.cbPixelFormat.Items.AddRange(new object[] { + "32 bit", + "24 bit", + "16 bit"}); + this.cbPixelFormat.Location = new System.Drawing.Point(102, 62); + this.cbPixelFormat.Name = "cbPixelFormat"; + this.cbPixelFormat.Size = new System.Drawing.Size(71, 21); + this.cbPixelFormat.TabIndex = 9; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 38); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(71, 13); + this.label2.TabIndex = 10; + this.label2.Text = "Image format:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 65); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(64, 13); + this.label3.TabIndex = 11; + this.label3.Text = "Color depth:"; + // + // rbFloor + // + this.rbFloor.AutoSize = true; + this.rbFloor.Checked = true; + this.rbFloor.Location = new System.Drawing.Point(197, 39); + this.rbFloor.Name = "rbFloor"; + this.rbFloor.Size = new System.Drawing.Size(48, 17); + this.rbFloor.TabIndex = 12; + this.rbFloor.TabStop = true; + this.rbFloor.Text = "Floor"; + this.rbFloor.UseVisualStyleBackColor = true; + // + // rbCeiling + // + this.rbCeiling.AutoSize = true; + this.rbCeiling.Location = new System.Drawing.Point(197, 61); + this.rbCeiling.Name = "rbCeiling"; + this.rbCeiling.Size = new System.Drawing.Size(56, 17); + this.rbCeiling.TabIndex = 13; + this.rbCeiling.Text = "Ceiling"; + this.rbCeiling.UseVisualStyleBackColor = true; + // + // cbFullbright + // + this.cbFullbright.AutoSize = true; + this.cbFullbright.Checked = true; + this.cbFullbright.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbFullbright.Location = new System.Drawing.Point(279, 40); + this.cbFullbright.Name = "cbFullbright"; + this.cbFullbright.Size = new System.Drawing.Size(87, 17); + this.cbFullbright.TabIndex = 14; + this.cbFullbright.Text = "Use fullbright"; + this.cbFullbright.UseVisualStyleBackColor = true; + // + // cbBrightmap + // + this.cbBrightmap.AutoSize = true; + this.cbBrightmap.Location = new System.Drawing.Point(279, 109); + this.cbBrightmap.Name = "cbBrightmap"; + this.cbBrightmap.Size = new System.Drawing.Size(106, 17); + this.cbBrightmap.TabIndex = 15; + this.cbBrightmap.Text = "Create brightmap"; + this.cbBrightmap.UseVisualStyleBackColor = true; + // + // cbTiles + // + this.cbTiles.AutoSize = true; + this.cbTiles.Location = new System.Drawing.Point(279, 132); + this.cbTiles.Name = "cbTiles"; + this.cbTiles.Size = new System.Drawing.Size(110, 17); + this.cbTiles.TabIndex = 16; + this.cbTiles.Text = "Create 64x64 tiles"; + this.cbTiles.UseVisualStyleBackColor = true; + // + // cbScale + // + this.cbScale.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbScale.FormattingEnabled = true; + this.cbScale.Items.AddRange(new object[] { + "100%", + "200%", + "400%", + "800%"}); + this.cbScale.Location = new System.Drawing.Point(102, 89); + this.cbScale.Name = "cbScale"; + this.cbScale.Size = new System.Drawing.Size(71, 21); + this.cbScale.TabIndex = 17; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(12, 92); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(37, 13); + this.label4.TabIndex = 18; + this.label4.Text = "Scale:"; + // + // progress + // + this.progress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.progress.Location = new System.Drawing.Point(12, 172); + this.progress.Name = "progress"; + this.progress.Size = new System.Drawing.Size(261, 23); + this.progress.Step = 1; + this.progress.TabIndex = 19; + this.progress.Visible = false; + // + // lbPhase + // + this.lbPhase.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.lbPhase.AutoSize = true; + this.lbPhase.Location = new System.Drawing.Point(14, 146); + this.lbPhase.Name = "lbPhase"; + this.lbPhase.Size = new System.Drawing.Size(45, 13); + this.lbPhase.TabIndex = 20; + this.lbPhase.Text = "lbPhase"; + this.lbPhase.Visible = false; + // + // cbApplySectorColors + // + this.cbApplySectorColors.AutoSize = true; + this.cbApplySectorColors.Checked = true; + this.cbApplySectorColors.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbApplySectorColors.Location = new System.Drawing.Point(279, 63); + this.cbApplySectorColors.Name = "cbApplySectorColors"; + this.cbApplySectorColors.Size = new System.Drawing.Size(115, 17); + this.cbApplySectorColors.TabIndex = 14; + this.cbApplySectorColors.Text = "Apply sector colors"; + this.cbApplySectorColors.UseVisualStyleBackColor = true; + // + // cbTransparency + // + this.cbTransparency.AutoSize = true; + this.cbTransparency.Location = new System.Drawing.Point(279, 86); + this.cbTransparency.Name = "cbTransparency"; + this.cbTransparency.Size = new System.Drawing.Size(115, 17); + this.cbTransparency.TabIndex = 21; + this.cbTransparency.Text = "Allow transparency"; + this.toolTip.SetToolTip(this.cbTransparency, "Unoccupied parts of the images will be transparent.\r\nWorks with transparent textu" + + "res, too.\r\n\r\nAntialiasing will be disabled."); + this.cbTransparency.UseVisualStyleBackColor = true; + // + // ImageExportSettingsForm + // + this.AcceptButton = this.export; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.close; + this.ClientSize = new System.Drawing.Size(447, 208); + this.Controls.Add(this.cbTransparency); + this.Controls.Add(this.lbPhase); + this.Controls.Add(this.progress); + this.Controls.Add(this.label4); + this.Controls.Add(this.cbScale); + this.Controls.Add(this.cbTiles); + this.Controls.Add(this.cbBrightmap); + this.Controls.Add(this.cbApplySectorColors); + this.Controls.Add(this.cbFullbright); + this.Controls.Add(this.rbCeiling); + this.Controls.Add(this.rbFloor); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.cbPixelFormat); + this.Controls.Add(this.cbImageFormat); + this.Controls.Add(this.close); + this.Controls.Add(this.export); + this.Controls.Add(this.label1); + this.Controls.Add(this.browse); + this.Controls.Add(this.tbExportPath); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImageExportSettingsForm"; + this.Text = "Image export settings"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ImageExportSettingsForm_FormClosing); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion @@ -311,6 +331,8 @@ private System.Windows.Forms.Label label4; private System.Windows.Forms.ProgressBar progress; private System.Windows.Forms.Label lbPhase; - private System.Windows.Forms.CheckBox cbApplySectorColors; + private System.Windows.Forms.CheckBox cbApplySectorColors; + private System.Windows.Forms.CheckBox cbTransparency; + private System.Windows.Forms.ToolTip toolTip; } } \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.cs b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.cs index 766b094a..bd04b247 100644 --- a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.cs +++ b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.cs @@ -52,6 +52,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface public string FilePath { get { return tbExportPath.Text.Trim(); } } public bool Floor { get { return rbFloor.Checked; } } public bool Fullbright { get { return cbFullbright.Checked; } } + public bool Transparency { get { return cbTransparency.Checked; } } public bool ApplySectorColors { get { return cbApplySectorColors.Checked; } } public bool Brightmap { get { return cbBrightmap.Checked; } } public bool Tiles { get { return cbTiles.Checked; } } @@ -101,6 +102,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface cbFullbright.Checked = General.Settings.ReadPluginSetting("imageexportfullbright", true); cbApplySectorColors.Checked = General.Settings.ReadPluginSetting("imageexportapplysectorcolors", true); + cbTransparency.Checked = General.Settings.ReadPluginSetting("imageexporttransparency", false); cbBrightmap.Checked = General.Settings.ReadPluginSetting("imageexportbrightmap", false); cbTiles.Checked = General.Settings.ReadPluginSetting("imageexporttiles", false); cbScale.SelectedIndex = General.Settings.ReadPluginSetting("imageexportscale", 0); @@ -160,11 +162,13 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface export.Enabled = true; export.Text = "Cancel"; - ImageExportSettings settings = new ImageExportSettings(Path.GetDirectoryName(FilePath), Path.GetFileNameWithoutExtension(FilePath), Path.GetExtension(FilePath), Floor, Fullbright, ApplySectorColors, Brightmap, Tiles, ImageScale, GetPixelFormat(), GetImageFormat()); + ImageExportSettings settings = new ImageExportSettings(Path.GetDirectoryName(FilePath), Path.GetFileNameWithoutExtension(FilePath), Path.GetExtension(FilePath), Floor, Fullbright, ApplySectorColors, Brightmap, Transparency, Tiles, ImageScale, GetPixelFormat(), GetImageFormat()); - exportthread = new Thread(() => RunExport(settings)); - exportthread.Name = "Image export"; - exportthread.Priority = ThreadPriority.Normal; + exportthread = new Thread(() => RunExport(settings)) + { + Name = "Image export", + Priority = ThreadPriority.Normal + }; exportthread.Start(); } @@ -323,6 +327,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface General.Settings.WritePluginSetting("imageexportfullbright", cbFullbright.Checked); General.Settings.WritePluginSetting("imageexportapplysectorcolors", cbApplySectorColors.Checked); General.Settings.WritePluginSetting("imageexportbrightmap", cbBrightmap.Checked); + General.Settings.WritePluginSetting("imageexporttransparency", cbTransparency.Checked); General.Settings.WritePluginSetting("imageexporttiles", cbTiles.Checked); General.Settings.WritePluginSetting("imageexportscale", cbScale.SelectedIndex); diff --git a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.resx b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.resx index 5e7f0a6f..4c9c0105 100644 --- a/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.resx +++ b/Source/Plugins/BuilderModes/Interface/ImageExportSettingsForm.resx @@ -1,123 +1,126 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 146, 17 + \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 45e7891c..fa6f0756 100755 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -1543,7 +1543,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // Things are automatically selected on creation foreach (Thing t in General.Map.Map.GetSelectedThings(true)) - CreateVisualThing(t); + allthings[t] = CreateVisualThing(t); // For linedefs it's a bit more complicated... foreach (Linedef ld in General.Map.Map.GetSelectedLinedefs(true))