diff --git a/Build/Builder.cfg b/Build/Builder.cfg index 2ff6b575..7861f0b7 100644 --- a/Build/Builder.cfg +++ b/Build/Builder.cfg @@ -2,9 +2,9 @@ mainwindow { positionx = 27; - windowstate = 2; - sizeheight = 586; - sizewidth = 750; + sizeheight = 572; positiony = 15; + windowstate = 2; + sizewidth = 739; } diff --git a/Source/Builder.csproj b/Source/Builder.csproj index 05d0c2db..e5f8ef00 100644 --- a/Source/Builder.csproj +++ b/Source/Builder.csproj @@ -44,10 +44,24 @@ --> + + + + Form + + + MapOptionsForm.cs + + + Form + + + ResourceOptionsForm.cs + @@ -61,7 +75,9 @@ MainForm.cs + + @@ -86,6 +102,14 @@ Designer MainForm.cs + + Designer + MapOptionsForm.cs + + + Designer + ResourceOptionsForm.cs + Designer ResXFileCodeGenerator diff --git a/Source/General/ConfigurationInfo.cs b/Source/General/ConfigurationInfo.cs new file mode 100644 index 00000000..578963fb --- /dev/null +++ b/Source/General/ConfigurationInfo.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +namespace CodeImp.DoomBuilder +{ + internal struct ConfigurationInfo : IComparable + { + // Members + public string name; + public string filename; + + // Constructor + public ConfigurationInfo(string name, string filename) + { + // Initialize + this.name = name; + this.filename = filename; + } + + // This compares it to other ConfigurationInfo objects + public int CompareTo(ConfigurationInfo other) + { + // Compare + return name.CompareTo(other.name); + } + } +} diff --git a/Source/General/General.cs b/Source/General/General.cs index ee5cca7b..09e5800b 100644 --- a/Source/General/General.cs +++ b/Source/General/General.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -20,7 +26,9 @@ using System.IO; using System.Reflection; using CodeImp.DoomBuilder.Interface; using CodeImp.DoomBuilder.IO; -using System.Collections.Specialized; +using CodeImp.DoomBuilder.Map; + +#endregion namespace CodeImp.DoomBuilder { @@ -44,10 +52,10 @@ namespace CodeImp.DoomBuilder // Main objects private static MainForm mainwindow; private static Configuration settings; - + private static MapManager map; + // Configurations - private static List configfiles; - private static List confignames; + private static List configs; #endregion @@ -58,7 +66,85 @@ namespace CodeImp.DoomBuilder public static string ConfigsPath { get { return configspath; } } public static MainForm MainWindow { get { return mainwindow; } } public static Configuration Settings { get { return settings; } } + public static List Configs { get { return configs; } } + public static MapManager Map { get { return map; } } + + #endregion + #region ================== Configurations + + // This loads and returns a game configuration + public static Configuration LoadGameConfiguration(string filename) + { + Configuration cfg; + + // Make the full filepathname + string filepathname = Path.Combine(configspath, filename); + + // Load configuration + try + { + // Try loading the configuration + cfg = new Configuration(filepathname, true); + + // Check for erors + if(cfg.ErrorResult != 0) + { + // Error in configuration + MessageBox.Show(mainwindow, "Unable to load the game configuration file \"" + filename + "\".\n" + + "Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, + Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + return null; + } + else + { + // Return config + return cfg; + } + } + catch(Exception) + { + // Unable to load configuration + MessageBox.Show(mainwindow, "Unable to load the game configuration file \"" + filename + "\".", + Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + return null; + } + } + + // This finds all game configurations + private static void FindGameConfigurations() + { + Configuration cfg; + string[] filenames; + string name, fullfilename; + + // Display status + mainwindow.DisplayStatus("Loading game configurations..."); + + // Make array + configs = new List(); + + // Go for all files in the configurations directory + filenames = Directory.GetFiles(configspath, "*.cfg", SearchOption.TopDirectoryOnly); + foreach(string filepath in filenames) + { + // Check if it can be loaded + cfg = LoadGameConfiguration(filepath); + if(cfg != null) + { + // Get name and filename + name = cfg.ReadSetting("game", ""); + fullfilename = Path.GetFileName(filepath); + + // Add to lists + configs.Add(new ConfigurationInfo(name, fullfilename)); + } + } + + // Sort the configurations list + configs.Sort(); + } + #endregion #region ================== Startup @@ -89,63 +175,13 @@ namespace CodeImp.DoomBuilder mainwindow.Update(); // Load game configurations - LoadConfigurations(); + FindGameConfigurations(); // Run application from the main window mainwindow.DisplayReady(); Application.Run(mainwindow); } - // This loads configurations - private static void LoadConfigurations() - { - Configuration cfg; - string[] filenames; - string fn; - - // Display status - mainwindow.DisplayStatus("Loading game configurations..."); - - // Make arrays - configfiles = new List(); - confignames = new List(); - - // Go for all files in the configurations directory - filenames = Directory.GetFiles(configspath, "*.cfg", SearchOption.TopDirectoryOnly); - foreach(string filepath in filenames) - { - // Determine filename only - fn = Path.GetFileName(filepath); - - try - { - // Try loading the configuration - cfg = new Configuration(filepath, true); - - // Check for erors - if(cfg.ErrorResult != 0) - { - // Error in configuration - MessageBox.Show(mainwindow, "Unable to load the game configuration file \"" + fn + "\".\n" + - "Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, - Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - else - { - // Add to lists - configfiles.Add(fn); - confignames.Add(cfg.ReadSetting("game", "")); - } - } - catch(Exception) - { - // Unable to load configuration - MessageBox.Show(mainwindow, "Unable to load the game configuration file \"" + fn + "\".", - Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } - #endregion #region ================== Terminate @@ -164,5 +200,57 @@ namespace CodeImp.DoomBuilder } #endregion + + #region ================== Management + + // This creates a new map + public static bool NewMap() + { + MapOptions newoptions; + MapOptionsForm optionswindow; + DialogResult result; + + // Empty options + newoptions = new MapOptions(); + + // Open map options dialog + optionswindow = new MapOptionsForm(newoptions); + if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK) + { + // Map open and not saved? + if((map != null) && map.IsChanged) + { + // Ask to save changes + result = MessageBox.Show(mainwindow, "Do you want to save changes to " + map.FileTitle + " (" + map.Options.CurrentName + ")?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if(result == DialogResult.Yes) + { + // TODO: Save map + + } + else if(result == DialogResult.Cancel) + { + // Abort + return false; + } + } + + // Display status + mainwindow.DisplayStatus("Creating new map..."); + + // Create map manager with these options + map = new MapManager(newoptions); + + // Done + mainwindow.DisplayReady(); + return true; + } + else + { + // Cancelled + return false; + } + } + + #endregion } } diff --git a/Source/General/MapManager.cs b/Source/General/MapManager.cs new file mode 100644 index 00000000..e9831b19 --- /dev/null +++ b/Source/General/MapManager.cs @@ -0,0 +1,105 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Reflection; +using CodeImp.DoomBuilder.Interface; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Map; + +#endregion + +namespace CodeImp.DoomBuilder +{ + internal class MapManager : IDisposable + { + #region ================== Constants + + #endregion + + #region ================== Variables + + // Status + private bool changed; + + // Map information + private string filetitle; + private string filepathname; + private MapSet data; + private MapOptions options; + private Configuration config; + + // Disposing + private bool isdisposed = false; + + #endregion + + #region ================== Properties + + public string FilePathName { get { return filepathname; } } + public string FileTitle { get { return filetitle; } } + public MapOptions Options { get { return options; } } + public bool IsChanged { get { return changed; } set { changed = value; } } + public bool IsDisposed { get { return isdisposed; } } + + #endregion + + #region ================== Constructor / Disposer + + // Constructor for new map + public MapManager(MapOptions options) + { + // Initialize + this.filetitle = "unnamed.wad"; + this.filepathname = ""; + this.changed = false; + this.options = options; + this.config = General.LoadGameConfiguration(options.ConfigFile); + this.data = new MapSet(); + + // We have no destructor + GC.SuppressFinalize(this); + } + + // Diposer + public void Dispose() + { + // Not already disposed? + if(!isdisposed) + { + // Dispose + data.Dispose(); + + // Done + isdisposed = true; + } + } + + #endregion + + #region ================== Methods + + #endregion + } +} diff --git a/Source/Geometry/Angle2D.cs b/Source/Geometry/Angle2D.cs index 019731a1..6e85fd71 100644 --- a/Source/Geometry/Angle2D.cs +++ b/Source/Geometry/Angle2D.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Geometry { internal struct Angle2D diff --git a/Source/Geometry/Line2D.cs b/Source/Geometry/Line2D.cs index 2e362862..de24e288 100644 --- a/Source/Geometry/Line2D.cs +++ b/Source/Geometry/Line2D.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Geometry { internal struct Line2D diff --git a/Source/Geometry/Vector2D.cs b/Source/Geometry/Vector2D.cs index 1d6461b3..0d309c16 100644 --- a/Source/Geometry/Vector2D.cs +++ b/Source/Geometry/Vector2D.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Geometry { internal struct Vector2D diff --git a/Source/Geometry/Vector3D.cs b/Source/Geometry/Vector3D.cs index 5bc0ff62..3c49fa9e 100644 --- a/Source/Geometry/Vector3D.cs +++ b/Source/Geometry/Vector3D.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Geometry { internal struct Vector3D diff --git a/Source/IO/ClippedStream.cs b/Source/IO/ClippedStream.cs index a223a662..404144bb 100644 --- a/Source/IO/ClippedStream.cs +++ b/Source/IO/ClippedStream.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using System.IO; +#endregion + namespace CodeImp.DoomBuilder.IO { internal class ClippedStream : Stream diff --git a/Source/IO/Configuration.cs b/Source/IO/Configuration.cs index 4b2fa815..2aac5f80 100644 --- a/Source/IO/Configuration.cs +++ b/Source/IO/Configuration.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,7 +12,10 @@ * */ -#region = CFG file structure syntax = +#endregion + +#region ================== CFG file structure syntax + /* ' ==================================================================================== ' CONFIGURATION FILE STRUCTURE SYNTAX @@ -121,8 +126,10 @@ ' age = 52; ' } */ + #endregion +#region ================== Namespaces using System; using System.IO; @@ -131,6 +138,8 @@ using System.Globalization; using System.Collections; using System.Collections.Specialized; +#endregion + namespace CodeImp.DoomBuilder.IO { internal sealed class Configuration diff --git a/Source/IO/IMapSetIO.cs b/Source/IO/IMapSetIO.cs index 3ced8e97..b1950f7c 100644 --- a/Source/IO/IMapSetIO.cs +++ b/Source/IO/IMapSetIO.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using CodeImp.DoomBuilder.Map; +#endregion + namespace CodeImp.DoomBuilder.IO { internal interface IMapSetIO : IDisposable diff --git a/Source/IO/Lump.cs b/Source/IO/Lump.cs index 17dad2cf..316f94ee 100644 --- a/Source/IO/Lump.cs +++ b/Source/IO/Lump.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using System.IO; +#endregion + namespace CodeImp.DoomBuilder.IO { internal class Lump : IDisposable diff --git a/Source/IO/WAD.cs b/Source/IO/WAD.cs index 154613b2..78d26f4c 100644 --- a/Source/IO/WAD.cs +++ b/Source/IO/WAD.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using System.IO; +#endregion + namespace CodeImp.DoomBuilder.IO { internal class WAD : IDisposable diff --git a/Source/Interface/MainForm.Designer.cs b/Source/Interface/MainForm.Designer.cs index e0ba3c14..d61656e9 100644 --- a/Source/Interface/MainForm.Designer.cs +++ b/Source/Interface/MainForm.Designer.cs @@ -79,6 +79,7 @@ namespace CodeImp.DoomBuilder.Interface this.itemnewmap.Name = "itemnewmap"; this.itemnewmap.Size = new System.Drawing.Size(167, 22); this.itemnewmap.Text = "New Map..."; + this.itemnewmap.Click += new System.EventHandler(this.itemnewmap_Click); // // itemopenmap // diff --git a/Source/Interface/MainForm.cs b/Source/Interface/MainForm.cs index 5b6179a4..77f4d08c 100644 --- a/Source/Interface/MainForm.cs +++ b/Source/Interface/MainForm.cs @@ -1,3 +1,21 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + using System; using System.Collections.Generic; using System.ComponentModel; @@ -5,6 +23,8 @@ using System.Drawing; using System.Text; using System.Windows.Forms; +#endregion + namespace CodeImp.DoomBuilder.Interface { public partial class MainForm : Form @@ -128,5 +148,12 @@ namespace CodeImp.DoomBuilder.Interface } #endregion + + #region ================== File Menu + + // New map clicked + private void itemnewmap_Click(object sender, EventArgs e) { General.NewMap(); } + + #endregion } } \ No newline at end of file diff --git a/Source/Interface/MainForm.resx b/Source/Interface/MainForm.resx index 901d8b4d..a7fbc870 100644 --- a/Source/Interface/MainForm.resx +++ b/Source/Interface/MainForm.resx @@ -117,15 +117,33 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + 17, 17 + + True + 121, 17 + + True + 207, 17 + + True + + + True + + + True + diff --git a/Source/Interface/MapOptionsForm.Designer.cs b/Source/Interface/MapOptionsForm.Designer.cs new file mode 100644 index 00000000..dcb324b0 --- /dev/null +++ b/Source/Interface/MapOptionsForm.Designer.cs @@ -0,0 +1,224 @@ +namespace CodeImp.DoomBuilder.Interface +{ + partial class MapOptionsForm + { + /// + /// 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.Windows.Forms.GroupBox groupBox1; + System.Windows.Forms.Label label3; + System.Windows.Forms.Label label2; + System.Windows.Forms.Label label1; + System.Windows.Forms.GroupBox groupBox2; + this.levelname = new System.Windows.Forms.TextBox(); + this.config = new System.Windows.Forms.ComboBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.addresource = new System.Windows.Forms.Button(); + this.resources = new System.Windows.Forms.ListBox(); + this.apply = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + groupBox1 = new System.Windows.Forms.GroupBox(); + label3 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); + label1 = new System.Windows.Forms.Label(); + groupBox2 = new System.Windows.Forms.GroupBox(); + groupBox1.SuspendLayout(); + groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + groupBox1.Controls.Add(label3); + groupBox1.Controls.Add(this.levelname); + groupBox1.Controls.Add(label2); + groupBox1.Controls.Add(this.config); + groupBox1.Controls.Add(label1); + groupBox1.Location = new System.Drawing.Point(12, 12); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new System.Drawing.Size(365, 118); + groupBox1.TabIndex = 10; + groupBox1.TabStop = false; + groupBox1.Text = " Settings "; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(239, 76); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(90, 14); + label3.TabIndex = 9; + label3.Text = "example: MAP01"; + // + // levelname + // + this.levelname.Location = new System.Drawing.Point(129, 73); + this.levelname.Name = "levelname"; + this.levelname.Size = new System.Drawing.Size(94, 20); + this.levelname.TabIndex = 8; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(58, 76); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(65, 14); + label2.TabIndex = 7; + label2.Text = "Level name:"; + // + // config + // + this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.config.FormattingEnabled = true; + this.config.Location = new System.Drawing.Point(129, 31); + this.config.Name = "config"; + this.config.Size = new System.Drawing.Size(213, 22); + this.config.TabIndex = 6; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(18, 34); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(105, 14); + label1.TabIndex = 5; + label1.Text = "Game Configuration:"; + // + // groupBox2 + // + groupBox2.Controls.Add(this.button2); + groupBox2.Controls.Add(this.button1); + groupBox2.Controls.Add(this.addresource); + groupBox2.Controls.Add(this.resources); + groupBox2.Location = new System.Drawing.Point(12, 145); + groupBox2.Name = "groupBox2"; + groupBox2.Size = new System.Drawing.Size(365, 165); + groupBox2.TabIndex = 11; + groupBox2.TabStop = false; + groupBox2.Text = " Custom Resources "; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(268, 125); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(74, 25); + this.button2.TabIndex = 13; + this.button2.Text = "Remove"; + this.button2.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(139, 125); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(123, 25); + this.button1.TabIndex = 12; + this.button1.Text = "Resource Options..."; + this.button1.UseVisualStyleBackColor = true; + // + // addresource + // + this.addresource.Location = new System.Drawing.Point(21, 125); + this.addresource.Name = "addresource"; + this.addresource.Size = new System.Drawing.Size(112, 25); + this.addresource.TabIndex = 11; + this.addresource.Text = "Add Resource..."; + this.addresource.UseVisualStyleBackColor = true; + // + // resources + // + this.resources.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.resources.FormattingEnabled = true; + this.resources.ItemHeight = 14; + this.resources.Location = new System.Drawing.Point(21, 31); + this.resources.Name = "resources"; + this.resources.Size = new System.Drawing.Size(321, 88); + this.resources.TabIndex = 10; + // + // apply + // + this.apply.Location = new System.Drawing.Point(147, 330); + this.apply.Name = "apply"; + this.apply.Size = new System.Drawing.Size(112, 25); + this.apply.TabIndex = 12; + this.apply.Text = "OK"; + this.apply.UseVisualStyleBackColor = true; + this.apply.Click += new System.EventHandler(this.apply_Click); + // + // cancel + // + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Location = new System.Drawing.Point(265, 330); + this.cancel.Name = "cancel"; + this.cancel.Size = new System.Drawing.Size(112, 25); + this.cancel.TabIndex = 13; + this.cancel.Text = "Cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // MapOptionsForm + // + this.AcceptButton = this.apply; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.ClientSize = new System.Drawing.Size(389, 367); + this.Controls.Add(this.cancel); + this.Controls.Add(this.apply); + this.Controls.Add(groupBox2); + this.Controls.Add(groupBox1); + this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MapOptionsForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Map Options"; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + groupBox2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox levelname; + private System.Windows.Forms.ComboBox config; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button addresource; + private System.Windows.Forms.ListBox resources; + private System.Windows.Forms.Button apply; + private System.Windows.Forms.Button cancel; + + + } +} \ No newline at end of file diff --git a/Source/Interface/MapOptionsForm.cs b/Source/Interface/MapOptionsForm.cs new file mode 100644 index 00000000..7deffc1a --- /dev/null +++ b/Source/Interface/MapOptionsForm.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Map; + +namespace CodeImp.DoomBuilder.Interface +{ + internal partial class MapOptionsForm : Form + { + // Variables + private MapOptions options; + + // Properties + public MapOptions Options { get { return options; } } + + // Constructor + public MapOptionsForm(MapOptions options) + { + // Initialize + InitializeComponent(); + + // Keep settings + this.options = options; + + // Go for all configurations + for(int i = 0; i < General.Configs.Count; i++) + { + // Add config name to list + config.Items.Add(General.Configs[i].name); + + // Is this configuration currently selected? + if(string.Compare(General.Configs[i].filename, options.ConfigFile, true) == 0) + { + // Select this item + config.SelectedIndex = config.Items.Count - 1; + } + } + + // Set the level name + levelname.Text = options.CurrentName; + + // Fill the resources list + foreach(ResourceLocation res in options.Resources) + resources.Items.Add(res); + } + + // OK clicked + private void apply_Click(object sender, EventArgs e) + { + // Configuration selected? + if(config.SelectedIndex == -1) + { + // Select a configuration! + MessageBox.Show(this, "Please select a game configuration to use for editing your map.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + // Level name empty? + if(levelname.Text.Length == 0) + { + // Enter a level name! + MessageBox.Show(this, "Please enter a level name for your map.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + // Apply changes + options.ClearResources(); + options.ConfigFile = General.Configs[config.SelectedIndex].filename; + options.CurrentName = levelname.Text.Trim().ToUpper(); + foreach(ResourceLocation res in resources.Items) options.AddResource(res); + + // Hide window + this.DialogResult = DialogResult.OK; + this.Hide(); + } + + // Cancel clicked + private void cancel_Click(object sender, EventArgs e) + { + // Just hide window + this.DialogResult = DialogResult.Cancel; + this.Hide(); + } + } +} \ No newline at end of file diff --git a/Source/Interface/MapOptionsForm.resx b/Source/Interface/MapOptionsForm.resx new file mode 100644 index 00000000..479f28da --- /dev/null +++ b/Source/Interface/MapOptionsForm.resx @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + True + + + True + + + False + + + True + + + True + + + False + + + True + + + True + + + False + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Source/Interface/ResourceOptionsForm.Designer.cs b/Source/Interface/ResourceOptionsForm.Designer.cs new file mode 100644 index 00000000..b816d179 --- /dev/null +++ b/Source/Interface/ResourceOptionsForm.Designer.cs @@ -0,0 +1,235 @@ +namespace CodeImp.DoomBuilder.Interface +{ + partial class ResourceOptionsForm + { + /// + /// 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.Windows.Forms.Label label1; + System.Windows.Forms.Label label2; + this.tabs = new System.Windows.Forms.TabControl(); + this.wadfiletab = new System.Windows.Forms.TabPage(); + this.browsewad = new System.Windows.Forms.Button(); + this.wadlocation = new System.Windows.Forms.TextBox(); + this.directorytab = new System.Windows.Forms.TabPage(); + this.dir_flats = new System.Windows.Forms.CheckBox(); + this.dir_textures = new System.Windows.Forms.CheckBox(); + this.browsedir = new System.Windows.Forms.Button(); + this.dirlocation = new System.Windows.Forms.TextBox(); + this.cancel = new System.Windows.Forms.Button(); + this.apply = new System.Windows.Forms.Button(); + label1 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); + this.tabs.SuspendLayout(); + this.wadfiletab.SuspendLayout(); + this.directorytab.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(15, 20); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(104, 14); + label1.TabIndex = 0; + label1.Text = "WAD File Resource:"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(15, 75); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(104, 14); + label2.TabIndex = 3; + label2.Text = "Directory Resource:"; + // + // tabs + // + this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabs.Controls.Add(this.wadfiletab); + this.tabs.Controls.Add(this.directorytab); + this.tabs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tabs.ItemSize = new System.Drawing.Size(110, 19); + this.tabs.Location = new System.Drawing.Point(12, 12); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + this.tabs.Size = new System.Drawing.Size(353, 161); + this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabs.TabIndex = 0; + // + // wadfiletab + // + this.wadfiletab.Controls.Add(this.browsewad); + this.wadfiletab.Controls.Add(this.wadlocation); + this.wadfiletab.Controls.Add(label1); + this.wadfiletab.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.wadfiletab.Location = new System.Drawing.Point(4, 23); + this.wadfiletab.Name = "wadfiletab"; + this.wadfiletab.Padding = new System.Windows.Forms.Padding(3); + this.wadfiletab.Size = new System.Drawing.Size(345, 134); + this.wadfiletab.TabIndex = 0; + this.wadfiletab.Text = "From WAD File"; + this.wadfiletab.UseVisualStyleBackColor = true; + // + // browsewad + // + this.browsewad.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.browsewad.Location = new System.Drawing.Point(296, 36); + this.browsewad.Name = "browsewad"; + this.browsewad.Size = new System.Drawing.Size(30, 23); + this.browsewad.TabIndex = 2; + this.browsewad.Text = "..."; + this.browsewad.UseVisualStyleBackColor = true; + // + // wadlocation + // + this.wadlocation.Location = new System.Drawing.Point(17, 37); + this.wadlocation.Name = "wadlocation"; + this.wadlocation.ReadOnly = true; + this.wadlocation.Size = new System.Drawing.Size(273, 20); + this.wadlocation.TabIndex = 1; + // + // directorytab + // + this.directorytab.Controls.Add(this.dir_flats); + this.directorytab.Controls.Add(this.dir_textures); + this.directorytab.Controls.Add(this.browsedir); + this.directorytab.Controls.Add(this.dirlocation); + this.directorytab.Controls.Add(label2); + this.directorytab.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.directorytab.Location = new System.Drawing.Point(4, 23); + this.directorytab.Name = "directorytab"; + this.directorytab.Padding = new System.Windows.Forms.Padding(3); + this.directorytab.Size = new System.Drawing.Size(345, 134); + this.directorytab.TabIndex = 1; + this.directorytab.Text = "From Directory"; + this.directorytab.UseVisualStyleBackColor = true; + // + // dir_flats + // + this.dir_flats.AutoSize = true; + this.dir_flats.Location = new System.Drawing.Point(17, 45); + this.dir_flats.Name = "dir_flats"; + this.dir_flats.Size = new System.Drawing.Size(126, 18); + this.dir_flats.TabIndex = 7; + this.dir_flats.Text = "Load images as flats"; + this.dir_flats.UseVisualStyleBackColor = true; + // + // dir_textures + // + this.dir_textures.AutoSize = true; + this.dir_textures.Location = new System.Drawing.Point(17, 21); + this.dir_textures.Name = "dir_textures"; + this.dir_textures.Size = new System.Drawing.Size(145, 18); + this.dir_textures.TabIndex = 6; + this.dir_textures.Text = "Load images as textures"; + this.dir_textures.UseVisualStyleBackColor = true; + // + // browsedir + // + this.browsedir.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.browsedir.Location = new System.Drawing.Point(296, 91); + this.browsedir.Name = "browsedir"; + this.browsedir.Size = new System.Drawing.Size(30, 23); + this.browsedir.TabIndex = 5; + this.browsedir.Text = "..."; + this.browsedir.UseVisualStyleBackColor = true; + // + // dirlocation + // + this.dirlocation.BackColor = System.Drawing.SystemColors.Control; + this.dirlocation.Location = new System.Drawing.Point(17, 92); + this.dirlocation.Name = "dirlocation"; + this.dirlocation.ReadOnly = true; + this.dirlocation.Size = new System.Drawing.Size(273, 20); + this.dirlocation.TabIndex = 4; + // + // cancel + // + this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancel.Location = new System.Drawing.Point(253, 189); + this.cancel.Name = "cancel"; + this.cancel.Size = new System.Drawing.Size(112, 25); + this.cancel.TabIndex = 15; + this.cancel.Text = "Cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // apply + // + this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.apply.Location = new System.Drawing.Point(135, 189); + this.apply.Name = "apply"; + this.apply.Size = new System.Drawing.Size(112, 25); + this.apply.TabIndex = 14; + this.apply.Text = "OK"; + this.apply.UseVisualStyleBackColor = true; + this.apply.Click += new System.EventHandler(this.apply_Click); + // + // ResourceOptionsForm + // + this.AcceptButton = this.apply; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.ClientSize = new System.Drawing.Size(377, 226); + this.Controls.Add(this.cancel); + this.Controls.Add(this.apply); + this.Controls.Add(this.tabs); + this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ResourceOptionsForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Resource Options"; + this.tabs.ResumeLayout(false); + this.wadfiletab.ResumeLayout(false); + this.wadfiletab.PerformLayout(); + this.directorytab.ResumeLayout(false); + this.directorytab.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage wadfiletab; + private System.Windows.Forms.TabPage directorytab; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.Button apply; + private System.Windows.Forms.TextBox wadlocation; + private System.Windows.Forms.Button browsewad; + private System.Windows.Forms.Button browsedir; + private System.Windows.Forms.TextBox dirlocation; + private System.Windows.Forms.CheckBox dir_flats; + private System.Windows.Forms.CheckBox dir_textures; + } +} \ No newline at end of file diff --git a/Source/Interface/ResourceOptionsForm.cs b/Source/Interface/ResourceOptionsForm.cs new file mode 100644 index 00000000..638ec1d6 --- /dev/null +++ b/Source/Interface/ResourceOptionsForm.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Map; +using System.IO; + +namespace CodeImp.DoomBuilder.Interface +{ + internal partial class ResourceOptionsForm : Form + { + // Variables + private ResourceLocation res; + + // Properties + public ResourceLocation ResourceLocation { get { return res; } } + + // Constructor + public ResourceOptionsForm(ResourceLocation settings) + { + // Initialize + InitializeComponent(); + + // Apply settings from ResourceLocation + this.res = settings; + switch(res.type) + { + // Setup for WAD File + case ResourceLocation.RESOURCE_WAD: + wadfiletab.Select(); + wadlocation.Text = res.location; + break; + + // Setup for Directory + case ResourceLocation.RESOURCE_DIRECTORY: + directorytab.Select(); + dirlocation.Text = res.location; + dir_textures.Checked = res.textures; + dir_flats.Checked = res.flats; + break; + } + } + + // OK clicked + private void apply_Click(object sender, EventArgs e) + { + // Apply settings to ResourceLocation + switch(tabs.SelectedIndex) + { + // Setup WAD File + case ResourceLocation.RESOURCE_WAD: + + // Check if directory is specified + if((wadlocation.Text.Length == 0) || + (!File.Exists(wadlocation.Text))) + { + // No valid wad file specified + MessageBox.Show(this, "Please select a valid WAD File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + else + { + // Apply settings + res.type = ResourceLocation.RESOURCE_WAD; + res.location = wadlocation.Text; + res.textures = false; + res.flats = false; + + // Done + this.DialogResult = DialogResult.OK; + this.Hide(); + } + break; + + // Setup Directory + case ResourceLocation.RESOURCE_DIRECTORY: + + // Check if directory is specified + if((dirlocation.Text.Length == 0) || + (!Directory.Exists(dirlocation.Text))) + { + // No valid directory specified + MessageBox.Show(this, "Please select a valid directory resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + // At least one of the checkboxes must be checked + else if(!dir_flats.Checked && !dir_textures.Checked) + { + // Must select one of the checkboxes + MessageBox.Show(this, "Please choose to load the images as texture or flats, or both.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + else + { + // Apply settings + res.type = ResourceLocation.RESOURCE_WAD; + res.location = dirlocation.Text; + res.textures = dir_textures.Checked; + res.flats = dir_flats.Checked; + + // Done + this.DialogResult = DialogResult.OK; + this.Hide(); + } + break; + } + } + + // Cancel clicked + private void cancel_Click(object sender, EventArgs e) + { + // Just hide + this.DialogResult = DialogResult.Cancel; + this.Hide(); + } + } +} \ No newline at end of file diff --git a/Source/Interface/ResourceOptionsForm.resx b/Source/Interface/ResourceOptionsForm.resx new file mode 100644 index 00000000..d48cbff8 --- /dev/null +++ b/Source/Interface/ResourceOptionsForm.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + False + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Source/Map/Linedef.cs b/Source/Map/Linedef.cs index 6e1e0813..6d3e689f 100644 --- a/Source/Map/Linedef.cs +++ b/Source/Map/Linedef.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using CodeImp.DoomBuilder.Geometry; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class Linedef : IDisposable diff --git a/Source/Map/MapOptions.cs b/Source/Map/MapOptions.cs new file mode 100644 index 00000000..c5ff5c77 --- /dev/null +++ b/Source/Map/MapOptions.cs @@ -0,0 +1,134 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using System.IO; + +#endregion + +namespace CodeImp.DoomBuilder.Map +{ + internal class MapOptions + { + #region ================== Constants + + #endregion + + #region ================== Variables + + // Game configuration + private string configfile; + + // Map header name + private string currentname; + private string previousname; + + // Additional resources + private List resources; + + #endregion + + #region ================== Properties + + public string ConfigFile { get { return configfile; } set { configfile = value; } } + public ICollection Resources { get { return resources; } } + public string PreviousName { get { return previousname; } } + public string CurrentName + { + get { return currentname; } + + set + { + // Change the name, but keep previous name + if(currentname != value) + { + if(previousname == "") previousname = currentname; + currentname = value; + } + } + } + + #endregion + + #region ================== Constructor / Disposer + + // Constructor + public MapOptions() + { + // Initialize + this.previousname = ""; + this.currentname = ""; + this.configfile = ""; + this.resources = new List(); + } + + ~MapOptions() + { + // Clean up + this.resources = null; + } + + #endregion + + #region ================== Methods + + // This adds a resource location and returns the index where the item was added + public int AddResource(ResourceLocation res) + { + // Get a fully qualified path + res.location = Path.GetFullPath(res.location); + + // Go for all items in the list + for(int i = 0; i < resources.Count; i++) + { + // Check if location is already added + if(Path.GetFullPath(resources[i].location) == res.location) + { + // Update the item in the list + resources[i] = res; + return i; + } + } + + // Add to list + resources.Add(res); + return resources.Count - 1; + } + + // This clears all reasource + public void ClearResources() + { + // Clear list + resources.Clear(); + } + + // This removes a resource by index + public void RemoveResource(int index) + { + // Remove the item + resources.RemoveAt(index); + } + + #endregion + } +} diff --git a/Source/Map/MapSet.cs b/Source/Map/MapSet.cs index 0d53e652..6dedc456 100644 --- a/Source/Map/MapSet.cs +++ b/Source/Map/MapSet.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using CodeImp.DoomBuilder.Geometry; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class MapSet : IDisposable diff --git a/Source/Map/ResourceLocation.cs b/Source/Map/ResourceLocation.cs new file mode 100644 index 00000000..48afdf19 --- /dev/null +++ b/Source/Map/ResourceLocation.cs @@ -0,0 +1,58 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +#endregion + +namespace CodeImp.DoomBuilder.Map +{ + internal struct ResourceLocation + { + // Constants + public const int RESOURCE_WAD = 0; + public const int RESOURCE_DIRECTORY = 1; + + // Members + public int type; + public string location; + public bool textures; + public bool flats; + + // Constructor + public ResourceLocation(int type, string location, bool textures, bool flats) + { + // Initialize + this.type = type; + this.location = location; + this.textures = textures; + this.flats = flats; + } + + // This displays the struct as string + public override string ToString() + { + // Simply show location + return location; + } + } +} diff --git a/Source/Map/Sector.cs b/Source/Map/Sector.cs index f2f4e875..ebf72680 100644 --- a/Source/Map/Sector.cs +++ b/Source/Map/Sector.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class Sector : IDisposable diff --git a/Source/Map/Sidedef.cs b/Source/Map/Sidedef.cs index 92715759..a96e05b5 100644 --- a/Source/Map/Sidedef.cs +++ b/Source/Map/Sidedef.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,12 +12,18 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class Sidedef : IDisposable diff --git a/Source/Map/Thing.cs b/Source/Map/Thing.cs index b36c57c7..5dbcbe87 100644 --- a/Source/Map/Thing.cs +++ b/Source/Map/Thing.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using CodeImp.DoomBuilder.Geometry; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class Thing : IDisposable diff --git a/Source/Map/Vertex.cs b/Source/Map/Vertex.cs index b857c310..343eab14 100644 --- a/Source/Map/Vertex.cs +++ b/Source/Map/Vertex.cs @@ -1,4 +1,6 @@ +#region ================== Copyright (c) 2007 Pascal vd Heiden + /* * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com * This program is released under GNU General Public License @@ -10,6 +12,10 @@ * */ +#endregion + +#region ================== Namespaces + using System; using System.Collections; using System.Collections.Generic; @@ -17,6 +23,8 @@ using System.Globalization; using System.Text; using CodeImp.DoomBuilder.Geometry; +#endregion + namespace CodeImp.DoomBuilder.Map { internal class Vertex : IDisposable