diff --git a/Makefile b/Makefile index 6e44e59f3a..879cbb07ab 100644 --- a/Makefile +++ b/Makefile @@ -137,15 +137,19 @@ ralint: $(ralint_TARGET) # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') -tsbuild_TARGET = TilesetBuilder.exe +tsbuild_TARGET = OpenRA.TilesetBuilder.exe tsbuild_KIND = winexe tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET) tsbuild_LIBS = $(COMMON_LIBS) $(tsbuild_DEPS) System.Windows.Forms.dll -tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.Form1.resources +tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.frmBuilder.resources -resource:OpenRA.TilesetBuilder.frmNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources PROGRAMS += tsbuild -OpenRA.TilesetBuilder.Form1.resources: - resgen2 OpenRA.TilesetBuilder/Form1.resx OpenRA.TilesetBuilder.Form1.resources 1> /dev/null -tsbuild: OpenRA.TilesetBuilder.Form1.resources $(tsbuild_TARGET) +OpenRA.TilesetBuilder.frmBuilder.resources: + resgen2 OpenRA.TilesetBuilder/frmBuilder.resx OpenRA.TilesetBuilder.frmBuilder.resources 1> /dev/null +OpenRA.TilesetBuilder.frmNew.resources: + resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.frmNew.resources 1> /dev/null +OpenRA.TilesetBuilder.Surface.resources: + resgen2 OpenRA.TilesetBuilder/Surface.resx OpenRA.TilesetBuilder.Surface.resources 1> /dev/null +tsbuild: OpenRA.TilesetBuilder.frmBuilder.resources OpenRA.TilesetBuilder.frmNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET) # # Launchers / Utilities diff --git a/OpenRA.TilesetBuilder/Form1.Designer.cs b/OpenRA.TilesetBuilder/Form1.Designer.cs deleted file mode 100644 index 6c5336a3fc..0000000000 --- a/OpenRA.TilesetBuilder/Form1.Designer.cs +++ /dev/null @@ -1,326 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -namespace OpenRA.TilesetBuilder -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); - this.panel1 = new System.Windows.Forms.Panel(); - this.surface1 = new OpenRA.TilesetBuilder.Surface(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton14 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton12 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton11 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton10 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton9 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton8 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton7 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton13 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripContainer1.ContentPanel.SuspendLayout(); - this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); - this.toolStripContainer1.SuspendLayout(); - this.panel1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // toolStripContainer1 - // - // - // toolStripContainer1.ContentPanel - // - this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1); - this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(745, 571); - this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); - this.toolStripContainer1.Name = "toolStripContainer1"; - this.toolStripContainer1.Size = new System.Drawing.Size(745, 596); - this.toolStripContainer1.TabIndex = 0; - this.toolStripContainer1.Text = "toolStripContainer1"; - // - // toolStripContainer1.TopToolStripPanel - // - this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1); - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.Controls.Add(this.surface1); - this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(745, 571); - this.panel1.TabIndex = 0; - // - // surface1 - // - this.surface1.BackColor = System.Drawing.Color.Black; - this.surface1.Location = new System.Drawing.Point(0, 0); - this.surface1.Name = "surface1"; - this.surface1.Size = new System.Drawing.Size(598, 372); - this.surface1.TabIndex = 2; - this.surface1.Text = "surface1"; - // - // toolStrip1 - // - this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton2, - this.toolStripButton14, - this.toolStripButton3, - this.toolStripSeparator1, - this.toolStripButton4, - this.toolStripButton12, - this.toolStripButton11, - this.toolStripButton10, - this.toolStripButton9, - this.toolStripButton8, - this.toolStripButton7, - this.toolStripButton6, - this.toolStripButton5, - this.toolStripButton13, - this.toolStripButton1}); - this.toolStrip1.Location = new System.Drawing.Point(3, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(602, 25); - this.toolStrip1.TabIndex = 0; - // - // toolStripButton2 - // - this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image"))); - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(51, 22); - this.toolStripButton2.Text = "Save"; - this.toolStripButton2.Click += new System.EventHandler(this.SaveClicked); - // - // toolStripButton14 - // - this.toolStripButton14.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton14.Image"))); - this.toolStripButton14.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton14.Name = "toolStripButton14"; - this.toolStripButton14.Size = new System.Drawing.Size(60, 22); - this.toolStripButton14.Text = "Export"; - this.toolStripButton14.Click += new System.EventHandler(this.ExportClicked); - // - // toolStripButton3 - // - this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image"))); - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(104, 22); - this.toolStripButton3.Text = "Show Overlays"; - this.toolStripButton3.Click += new System.EventHandler(this.ShowOverlaysClicked); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image"))); - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(25, 22); - this.toolStripButton4.Tag = "0"; - this.toolStripButton4.Text = "tt0"; - this.toolStripButton4.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton12 - // - this.toolStripButton12.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton12.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton12.Image"))); - this.toolStripButton12.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton12.Name = "toolStripButton12"; - this.toolStripButton12.Size = new System.Drawing.Size(25, 22); - this.toolStripButton12.Tag = "1"; - this.toolStripButton12.Text = "tt1"; - this.toolStripButton12.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton11 - // - this.toolStripButton11.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton11.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton11.Image"))); - this.toolStripButton11.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton11.Name = "toolStripButton11"; - this.toolStripButton11.Size = new System.Drawing.Size(25, 22); - this.toolStripButton11.Tag = "2"; - this.toolStripButton11.Text = "tt2"; - this.toolStripButton11.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton10 - // - this.toolStripButton10.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton10.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton10.Image"))); - this.toolStripButton10.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton10.Name = "toolStripButton10"; - this.toolStripButton10.Size = new System.Drawing.Size(25, 22); - this.toolStripButton10.Tag = "3"; - this.toolStripButton10.Text = "tt3"; - this.toolStripButton10.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton9 - // - this.toolStripButton9.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton9.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton9.Image"))); - this.toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton9.Name = "toolStripButton9"; - this.toolStripButton9.Size = new System.Drawing.Size(25, 22); - this.toolStripButton9.Tag = "4"; - this.toolStripButton9.Text = "tt4"; - this.toolStripButton9.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton8 - // - this.toolStripButton8.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton8.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton8.Image"))); - this.toolStripButton8.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton8.Name = "toolStripButton8"; - this.toolStripButton8.Size = new System.Drawing.Size(25, 22); - this.toolStripButton8.Tag = "5"; - this.toolStripButton8.Text = "tt5"; - this.toolStripButton8.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton7 - // - this.toolStripButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton7.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton7.Image"))); - this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton7.Name = "toolStripButton7"; - this.toolStripButton7.Size = new System.Drawing.Size(25, 22); - this.toolStripButton7.Tag = "6"; - this.toolStripButton7.Text = "tt6"; - this.toolStripButton7.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton6 - // - this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton6.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton6.Image"))); - this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton6.Name = "toolStripButton6"; - this.toolStripButton6.Size = new System.Drawing.Size(25, 22); - this.toolStripButton6.Tag = "7"; - this.toolStripButton6.Text = "tt7"; - this.toolStripButton6.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image"))); - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - this.toolStripButton5.Size = new System.Drawing.Size(25, 22); - this.toolStripButton5.Tag = "8"; - this.toolStripButton5.Text = "tt8"; - this.toolStripButton5.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton13 - // - this.toolStripButton13.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton13.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton13.Image"))); - this.toolStripButton13.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton13.Name = "toolStripButton13"; - this.toolStripButton13.Size = new System.Drawing.Size(25, 22); - this.toolStripButton13.Tag = "9"; - this.toolStripButton13.Text = "tt9"; - // - // toolStripButton1 - // - this.toolStripButton1.Checked = true; - this.toolStripButton1.CheckState = System.Windows.Forms.CheckState.Checked; - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(88, 22); - this.toolStripButton1.Text = "Template Tool"; - this.toolStripButton1.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(745, 596); - this.Controls.Add(this.toolStripContainer1); - this.Name = "Form1"; - this.Text = "Tileset Builder"; - this.toolStripContainer1.ContentPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.PerformLayout(); - this.toolStripContainer1.ResumeLayout(false); - this.toolStripContainer1.PerformLayout(); - this.panel1.ResumeLayout(false); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ToolStripContainer toolStripContainer1; - private System.Windows.Forms.Panel panel1; - private Surface surface1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripButton toolStripButton4; - private System.Windows.Forms.ToolStripButton toolStripButton12; - private System.Windows.Forms.ToolStripButton toolStripButton11; - private System.Windows.Forms.ToolStripButton toolStripButton10; - private System.Windows.Forms.ToolStripButton toolStripButton9; - private System.Windows.Forms.ToolStripButton toolStripButton8; - private System.Windows.Forms.ToolStripButton toolStripButton7; - private System.Windows.Forms.ToolStripButton toolStripButton6; - private System.Windows.Forms.ToolStripButton toolStripButton5; - private System.Windows.Forms.ToolStripButton toolStripButton13; - private System.Windows.Forms.ToolStripButton toolStripButton14; - - } -} - diff --git a/OpenRA.TilesetBuilder/Form1.cs b/OpenRA.TilesetBuilder/Form1.cs deleted file mode 100644 index 1c1c084360..0000000000 --- a/OpenRA.TilesetBuilder/Form1.cs +++ /dev/null @@ -1,278 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Linq; -using System.Windows.Forms; -using System.Xml; -using OpenRA.FileFormats; - -namespace OpenRA.TilesetBuilder -{ - public partial class Form1 : Form - { - string srcfile; - int size; - - public Form1( string src, int size ) - { - srcfile = src; - this.size = size; - InitializeComponent(); - surface1.TileSize = size; - surface1.Image = (Bitmap)Image.FromFile(src); - surface1.Image.SetResolution(96, 96); // people keep being noobs about DPI, and GDI+ cares. - surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */ - surface1.Templates = new List