add central-conflict and marooned-ii via new importer

This commit is contained in:
Chris Forbes
2010-08-01 18:02:02 +12:00
parent 0f33913bf6
commit 724df5ad54
15 changed files with 1348 additions and 60 deletions

View File

@@ -31,8 +31,9 @@ namespace MapConverter
Game.InitializeEngineWithMods(mods); Game.InitializeEngineWithMods(mods);
var map = MapConverter.Import(inputFile); var map = MapConverter.Import(inputFile);
Directory.CreateDirectory(outputPath); Directory.CreateDirectory(outputPath);
map.Package = new Folder(outputPath);
map.Save(outputPath); map.Save(outputPath);
} }
} }

View File

@@ -76,8 +76,8 @@ namespace MapConverter
{"v18","v18"}, {"v18","v18"},
// Crates // Crates
{"wcrate","crate"}, // {"wcrate","crate"},
{"scrate","crate"}, // {"scrate","crate"},
}; };
int MapSize; int MapSize;

View File

@@ -39,27 +39,27 @@
this.actorPalette = new System.Windows.Forms.FlowLayoutPanel(); this.actorPalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.resourcePalette = new System.Windows.Forms.FlowLayoutPanel(); this.resourcePalette = new System.Windows.Forms.FlowLayoutPanel();
this.tt = new System.Windows.Forms.ToolTip(this.components); this.surface1 = new OpenRA.Editor.Surface();
this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.exotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.cCRedAlertMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cCRedAlertMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.bitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.exotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.resizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.spawnpointsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.spawnpointsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.surface1 = new OpenRA.Editor.Surface(); this.tt = new System.Windows.Forms.ToolTip(this.components);
this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
this.toolStripContainer1.ContentPanel.SuspendLayout(); this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout(); this.toolStripContainer1.SuspendLayout();
@@ -148,7 +148,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(190, 630); this.tabPage2.Size = new System.Drawing.Size(190, 655);
this.tabPage2.TabIndex = 1; this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Actors"; this.tabPage2.Text = "Actors";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
@@ -160,7 +160,7 @@
this.actorPalette.Dock = System.Windows.Forms.DockStyle.Fill; this.actorPalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.actorPalette.Location = new System.Drawing.Point(3, 3); this.actorPalette.Location = new System.Drawing.Point(3, 3);
this.actorPalette.Name = "actorPalette"; this.actorPalette.Name = "actorPalette";
this.actorPalette.Size = new System.Drawing.Size(184, 624); this.actorPalette.Size = new System.Drawing.Size(184, 649);
this.actorPalette.TabIndex = 2; this.actorPalette.TabIndex = 2;
// //
// tabPage3 // tabPage3
@@ -168,7 +168,7 @@
this.tabPage3.Controls.Add(this.resourcePalette); this.tabPage3.Controls.Add(this.resourcePalette);
this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(190, 630); this.tabPage3.Size = new System.Drawing.Size(190, 655);
this.tabPage3.TabIndex = 2; this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Resources"; this.tabPage3.Text = "Resources";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
@@ -180,12 +180,18 @@
this.resourcePalette.Dock = System.Windows.Forms.DockStyle.Fill; this.resourcePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.resourcePalette.Location = new System.Drawing.Point(0, 0); this.resourcePalette.Location = new System.Drawing.Point(0, 0);
this.resourcePalette.Name = "resourcePalette"; this.resourcePalette.Name = "resourcePalette";
this.resourcePalette.Size = new System.Drawing.Size(190, 630); this.resourcePalette.Size = new System.Drawing.Size(190, 655);
this.resourcePalette.TabIndex = 3; this.resourcePalette.TabIndex = 3;
// //
// tt // surface1
// //
this.tt.ShowAlways = true; this.surface1.BackColor = System.Drawing.Color.Black;
this.surface1.Dock = System.Windows.Forms.DockStyle.Fill;
this.surface1.Location = new System.Drawing.Point(0, 0);
this.surface1.Name = "surface1";
this.surface1.Size = new System.Drawing.Size(783, 681);
this.surface1.TabIndex = 5;
this.surface1.Text = "surface1";
// //
// menuStrip1 // menuStrip1
// //
@@ -224,6 +230,11 @@
this.newToolStripMenuItem.Text = "&New..."; this.newToolStripMenuItem.Text = "&New...";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewClicked); this.newToolStripMenuItem.Click += new System.EventHandler(this.NewClicked);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// openToolStripMenuItem // openToolStripMenuItem
// //
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
@@ -232,11 +243,6 @@
this.openToolStripMenuItem.Text = "&Open..."; this.openToolStripMenuItem.Text = "&Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenClicked); this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenClicked);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// saveToolStripMenuItem // saveToolStripMenuItem
// //
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
@@ -257,18 +263,6 @@
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
// //
// exotToolStripMenuItem
//
this.exotToolStripMenuItem.Name = "exotToolStripMenuItem";
this.exotToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exotToolStripMenuItem.Text = "E&xit";
this.exotToolStripMenuItem.Click += new System.EventHandler(this.CloseClicked);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
//
// toolStripMenuItem1 // toolStripMenuItem1
// //
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -284,6 +278,7 @@
this.cCRedAlertMapToolStripMenuItem.Name = "cCRedAlertMapToolStripMenuItem"; this.cCRedAlertMapToolStripMenuItem.Name = "cCRedAlertMapToolStripMenuItem";
this.cCRedAlertMapToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.cCRedAlertMapToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.cCRedAlertMapToolStripMenuItem.Text = "&C&&C / Red Alert Map..."; this.cCRedAlertMapToolStripMenuItem.Text = "&C&&C / Red Alert Map...";
this.cCRedAlertMapToolStripMenuItem.Click += new System.EventHandler(this.ImportLegacyMapClicked);
// //
// bitmapToolStripMenuItem // bitmapToolStripMenuItem
// //
@@ -292,6 +287,18 @@
this.bitmapToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.bitmapToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.bitmapToolStripMenuItem.Text = "&Bitmap..."; this.bitmapToolStripMenuItem.Text = "&Bitmap...";
// //
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
//
// exotToolStripMenuItem
//
this.exotToolStripMenuItem.Name = "exotToolStripMenuItem";
this.exotToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exotToolStripMenuItem.Text = "E&xit";
this.exotToolStripMenuItem.Click += new System.EventHandler(this.CloseClicked);
//
// mapToolStripMenuItem // mapToolStripMenuItem
// //
this.mapToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mapToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -307,7 +314,7 @@
// //
this.propertiesToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("propertiesToolStripMenuItem.Image"))); this.propertiesToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("propertiesToolStripMenuItem.Image")));
this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem"; this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem";
this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
this.propertiesToolStripMenuItem.Text = "&Properties..."; this.propertiesToolStripMenuItem.Text = "&Properties...";
this.propertiesToolStripMenuItem.Click += new System.EventHandler(this.PropertiesClicked); this.propertiesToolStripMenuItem.Click += new System.EventHandler(this.PropertiesClicked);
// //
@@ -315,32 +322,26 @@
// //
this.resizeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("resizeToolStripMenuItem.Image"))); this.resizeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("resizeToolStripMenuItem.Image")));
this.resizeToolStripMenuItem.Name = "resizeToolStripMenuItem"; this.resizeToolStripMenuItem.Name = "resizeToolStripMenuItem";
this.resizeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.resizeToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
this.resizeToolStripMenuItem.Text = "&Resize..."; this.resizeToolStripMenuItem.Text = "&Resize...";
this.resizeToolStripMenuItem.Click += new System.EventHandler(this.ResizeClicked); this.resizeToolStripMenuItem.Click += new System.EventHandler(this.ResizeClicked);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6);
// //
// spawnpointsToolStripMenuItem // spawnpointsToolStripMenuItem
// //
this.spawnpointsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("spawnpointsToolStripMenuItem.Image"))); this.spawnpointsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("spawnpointsToolStripMenuItem.Image")));
this.spawnpointsToolStripMenuItem.Name = "spawnpointsToolStripMenuItem"; this.spawnpointsToolStripMenuItem.Name = "spawnpointsToolStripMenuItem";
this.spawnpointsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.spawnpointsToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
this.spawnpointsToolStripMenuItem.Text = "&Spawnpoints"; this.spawnpointsToolStripMenuItem.Text = "&Spawnpoints";
this.spawnpointsToolStripMenuItem.Click += new System.EventHandler(this.SpawnPointsClicked); this.spawnpointsToolStripMenuItem.Click += new System.EventHandler(this.SpawnPointsClicked);
// //
// surface1 // tt
// //
this.surface1.BackColor = System.Drawing.Color.Black; this.tt.ShowAlways = true;
this.surface1.Dock = System.Windows.Forms.DockStyle.Fill;
this.surface1.Location = new System.Drawing.Point(0, 0);
this.surface1.Name = "surface1";
this.surface1.Size = new System.Drawing.Size(783, 681);
this.surface1.TabIndex = 5;
this.surface1.Text = "surface1";
// //
// Form1 // Form1
// //

View File

@@ -401,5 +401,26 @@ namespace OpenRA.Editor
{ {
Close(); Close();
} }
void ImportLegacyMapClicked(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog { Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" })
if (DialogResult.OK == ofd.ShowDialog())
{
/* massive hack: we should be able to call NewMap() with the imported Map object,
* but something's not right internally in it, unless loaded via the real maploader */
var savePath = Path.Combine(Path.GetTempPath(), "OpenRA.Import");
Directory.CreateDirectory(savePath);
var map = LegacyMapImporter.Import(ofd.FileName);
map.Package = new Folder(savePath);
map.Save(savePath);
LoadMap(savePath);
loadedMapName = null; /* editor needs to think this hasnt been saved */
Directory.Delete(savePath, true);
}
}
} }
} }

View File

@@ -120,12 +120,6 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>309, 17</value> <value>309, 17</value>
</metadata> </metadata>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="folderBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>182, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
@@ -144,7 +138,7 @@
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAACeklE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAACeklE
QVQ4T6WTWUiUURiG/4suurJIjUIwskQsEANDqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF QVQ4T6WTWUiUURiG/4suurJIjUIwskQsEANDqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
sEIoFInQcqHE1CwoKsXUUMnt6Z+RLMtA8OK5OZz3Oe/5OEcAhPWwpnBaodZZmqfjWmY5GSo98XJNwq9D sEIoFInQcqHE1CwoKsXUUMnt6Z+RLMtA8OK5OZz3Oe/5OEcAhPWwpnBaodZZmqfjWmY5GSo98XJNwq9D
1yQIilLhFaYIMIQuxZaZJ4uy6FS1T2BUIUKdNsdPhL9pqpEp/ne18PiiE94RCjzDco0C+rs1zIzXGvkx 1yQIilLhFaYIMIQuxZaZJ4uy6FS1T2BUIUKdNsdPhL9pqpEp/ne18PiiE94RCjzDco0C+rs1zIzXGvkx
@@ -161,7 +155,7 @@
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAACMklE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAACMklE
QVQ4T6WT3UuTcRTH9y90303QRbc1NYZrMRs86hzKsmFoIb09kqZpunxJUqxMxZYvkK1w6sTlahJOKvIF QVQ4T6WT3UuTcRTH9y90303QRbc1NYZrMRs86hzKsmFoIb09kqZpunxJUqxMxZYvkK1w6sTlahJOKvIF
TJEUMZaSlZkrWuJQU3QiGHz7nZ+wn0vrQh84Nw98Puc553wfBQDFXorDL18EQOXuXEGHaxlPHItoafbj TJEUMZaSlZkrWuJQU3QiGHz7nZ+wn0vrQh84Nw98Puc553wfBQDFXorDL18EQOXuXEGHaxlPHItoafbj
kXUW9XU/YLnnxd3yaZSWfEZR4Qfk5Y7japaHoVBwAYF9vUBd7Tq9/Oeztr4BfVIfTic95xUUuJ4tcUFl kXUW9XU/YLnnxd3yaZSWfEZR4Qfk5Y7japaHoVBwAYF9vUBd7Tq9/Oeztr4BfVIfTic95xUUuJ4tcUFl
@@ -221,7 +215,7 @@
XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS
fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+ fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+
tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/ tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEQAACxEBf2RfkQAAAN5JREFUOE+FUwEOAyEI 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEAAACxABrSO9dQAAAN5JREFUOE+FUwEOAyEI
8+k+7X7GoFBWmZdtISYgtS3csrXsFtvzf2Mv8/8d4Hkec2SLM+IHzJsjdwVAcxQrtl8OsDgBxPMGgKJG 8+k+7X7GoFBWmZdtISYgtS3csrXsFtvzf2Mv8/8d4Hkec2SLM+IHzJsjdwVAcxQrtl8OsDgBxPMGgKJG
SQkwMlI2zSCS+cuL0YCceHEDAcBbM6gTQOhDDpnBxHqVOsmgdYvmfCxk7q+JpDZN4yQOJhOAOtmslGna SQkwMlI2zSCS+cuL0YCceHEDAcBbM6gTQOhDDpnBxHqVOsmgdYvmfCxk7q+JpDZN4yQOJhOAOtmslGna
MYE3AN2HeBEmyvhYZ44mL5rRXkijgoAZAA3nCVBzbzM5vuE8x8xmbGIzqE1LkNwHOO2RZmZOjQYTjoWF MYE3AN2HeBEmyvhYZ44mL5rRXkijgoAZAA3nCVBzbzM5vuE8x8xmbGIzqE1LkNwHOO2RZmZOjQYTjoWF
@@ -231,7 +225,7 @@
<data name="bitmapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bitmapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAACR0lE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAACR0lE
QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL
xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S
lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V
@@ -248,7 +242,7 @@
<data name="propertiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="propertiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAACCklE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAACCklE
QVQ4T6WT30tTUQDHz39QD0UQSpAPIkgPyR60AiUiyoGBL4qZjOyt0tZP9tBDk1AsXIhj93ILdd27DPPH QVQ4T6WT30tTUQDHz39QD0UQSpAPIkgPyR60AiUiyoGBL4qZjOyt0tZP9tBDk1AsXIhj93ILdd27DPPH
3VwrUrdK2ioJHAgVOdoPaQsarBg43L6ec+akuRsEPnw5D4fP5/vlXg4BQHaSf8LjjwdqaTA2cg+y1Ith 3VwrUrdK2ioJHAgVOdoPaQsarBg43L6ec+akuRsEPnw5D4fP5/vlXg4BQHaSf8LjjwdqaTA2cg+y1Ith
qxmi5Tas/SYWk+QRoPgmtNsLcPq7GYX8+XoTqaUL+KR2cAmDxeBgqeBv2NhWzwUFOBk4g5/zRxB3V8Es qxmi5Tas/SYWk+QRoPgmtNsLcPq7GYX8+XoTqaUL+KR2cAmDxeBgqeBv2NhWzwUFOBk4g5/zRxB3V8Es
@@ -263,7 +257,7 @@
<data name="resizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="resizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAADLklE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAADLklE
QVQ4T3WS60/ScRjFf39CL3rR1ovurduWbbU2t7ZqdlkXt7Lrym6O1VoXcdYqQ54wKlGxABE1CzWF0nIm QVQ4T3WS60/ScRjFf39CL3rR1ovurduWbbU2t7ZqdlkXt7Lrym6O1VoXcdYqQ54wKlGxABE1CzWF0nIm
lZcoTbyUNJFIzDJSJK+E0qy8wInvz+i2erazfd+cz3m+zw4nTS+FLOeZNim3Vp6UU5sqvf5MSZqnyjhV lZcoTbyUNJFIzDJSJK+E0qy8wInvz+i2erazfd+cz3m+zw4nTS+FLOeZNim3Vp6UU5sqvf5MSZqnyjhV
pfKUvEx54kqp8rCkWHVQVKSJPHtbs+tUgSYiOicVAMfEqfR1dVFCGSqrX94cHQeN/aXhbyD3Zz91uf3U pfKUvEx54kqp8rCkWHVQVKSJPHtbs+tUgSYiOicVAMfEqfR1dVFCGSqrX94cHQeN/aXhbyD3Zz91uf3U
@@ -283,7 +277,7 @@
<data name="spawnpointsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="spawnpointsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsRAAALEQF/ZF+RAAABrUlE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAABrUlE
QVQ4T6WTWyhDcRzHl8g1D/IkxZ4mjcgDB0U5ubbVbJLkkubJSt7w6M1eENHUENrktmzJ3HKEiSh7US5l QVQ4T6WTWyhDcRzHl8g1D/IkxZ4mjcgDB0U5ubbVbJLkkubJSt7w6M1eENHUENrktmzJ3HKEiSh7US5l
QiK5JUXpy/9f/9O2zhY59at//c/n87uc35EBkP0nAsL6Bi33E9CpeBINJElHthIkvBNKChh8YVPi1Cpn QiK5JUXpy/9f/9O2zhY59at//c/n87uc35EBkP0nAsL6Bi33E9CpeBINJElHthIkvBNKChh8YVPi1Cpn
Eo7ANSnJwQUMfnLEobVejZbaCnis8VRiyFSgXJ4QWOAPO5fXYJ2xo1HD48QcRSV5CfHSAn94fV0gL9Jn Eo7ANSnJwQUMfnLEobVejZbaCnis8VRiyFSgXJ4QWOAPO5fXYJ2xo1HD48QcRSV5CfHSAn94fV0gL9Jn
@@ -294,4 +288,10 @@
vP+uv56/AehVvkSccelEAAAAAElFTkSuQmCC vP+uv56/AehVvkSccelEAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="folderBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>182, 17</value>
</metadata>
</root> </root>

View File

@@ -0,0 +1,354 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 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 LICENSE.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using OpenRA;
using OpenRA.FileFormats;
namespace OpenRA.Editor
{
public class LegacyMapImporter
{
// Mapping from ra overlay index to type string
static string[] raOverlayNames =
{
"sbag", "cycl", "brik", "fenc", "wood",
"gold01", "gold02", "gold03", "gold04",
"gem01", "gem02", "gem03", "gem04",
"v12", "v13", "v14", "v15", "v16", "v17", "v18",
"fpls", "wcrate", "scrate", "barb", "sbag",
};
static Dictionary<string, Pair<byte, byte>> overlayResourceMapping = new Dictionary<string, Pair<byte, byte>>()
{
// RA Gems, Gold
{ "gold01", new Pair<byte,byte>(1,0) },
{ "gold02", new Pair<byte,byte>(1,1) },
{ "gold03", new Pair<byte,byte>(1,2) },
{ "gold04", new Pair<byte,byte>(1,3) },
{ "gem01", new Pair<byte,byte>(2,0) },
{ "gem02", new Pair<byte,byte>(2,1) },
{ "gem03", new Pair<byte,byte>(2,2) },
{ "gem04", new Pair<byte,byte>(2,3) },
// cnc tiberium
{ "ti1", new Pair<byte,byte>(1,0) },
{ "ti2", new Pair<byte,byte>(1,1) },
{ "ti3", new Pair<byte,byte>(1,2) },
{ "ti4", new Pair<byte,byte>(1,3) },
{ "ti5", new Pair<byte,byte>(1,4) },
{ "ti6", new Pair<byte,byte>(1,5) },
{ "ti7", new Pair<byte,byte>(1,6) },
{ "ti8", new Pair<byte,byte>(1,7) },
{ "ti9", new Pair<byte,byte>(1,8) },
{ "ti10", new Pair<byte,byte>(1,9) },
{ "ti11", new Pair<byte,byte>(1,10) },
{ "ti12", new Pair<byte,byte>(1,11) },
};
static Dictionary<string, string> overlayActorMapping = new Dictionary<string, string>() {
// Fences
{"sbag","sbag"},
{"cycl","cycl"},
{"brik","brik"},
{"fenc","fenc"},
{"wood","wood"},
// Fields
{"v12","v12"},
{"v13","v13"},
{"v14","v14"},
{"v15","v15"},
{"v16","v16"},
{"v17","v17"},
{"v18","v18"},
// Crates
// {"wcrate","crate"},
// {"scrate","crate"},
};
int MapSize;
int ActorCount = 0;
Map Map = new Map();
LegacyMapImporter(string filename)
{
ConvertIniMap(filename);
}
public static Map Import(string filename)
{
var converter = new LegacyMapImporter(filename);
return converter.Map;
}
enum IniMapFormat { RedAlert = 3, /* otherwise, cnc (2 variants exist, we don't care to differentiate) */ };
public void ConvertIniMap(string iniFile)
{
var file = new IniFile(FileSystem.Open(iniFile));
var basic = file.GetSection("Basic");
var map = file.GetSection("Map");
var legacyMapFormat = (IniMapFormat)int.Parse(basic.GetValue("NewINIFormat", "0"));
var XOffset = int.Parse(map.GetValue("X", "0"));
var YOffset = int.Parse(map.GetValue("Y", "0"));
var Width = int.Parse(map.GetValue("Width", "0"));
var Height = int.Parse(map.GetValue("Height", "0"));
MapSize = (legacyMapFormat == IniMapFormat.RedAlert) ? 128 : 64;
Map.Title = basic.GetValue("Name", "(null)");
Map.Author = "Westwood Studios";
Map.Tileset = Truncate(map.GetValue("Theater", "TEMPERAT"), 8);
Map.MapSize.X = MapSize;
Map.MapSize.Y = MapSize;
Map.TopLeft = new int2(XOffset, YOffset);
Map.BottomRight = new int2(XOffset + Width, YOffset + Height);
Map.Selectable = true;
if (legacyMapFormat == IniMapFormat.RedAlert)
{
UnpackRATileData(ReadPackedSection(file.GetSection("MapPack")));
UnpackRAOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
ReadRATrees(file);
// TODO: Fixme
//tileset = new TileSet("tileSet.til","templates.ini",fileMapping[Pair.New("ra",Map.Tileset)].First);
}
else // CNC
{
UnpackCncTileData(FileSystem.Open(iniFile.Substring(0, iniFile.Length - 4) + ".bin"));
ReadCncOverlay(file);
ReadCncTrees(file);
// TODO: Fixme
//tileset = new TileSet("tileSet.til","templates.ini",fileMapping[Pair.New("cnc",Map.Tileset)].First);
}
LoadActors(file, "STRUCTURES");
LoadActors(file, "UNITS");
LoadActors(file, "INFANTRY");
LoadSmudges(file, "SMUDGE");
var wp = file.GetSection("Waypoints")
.Where(kv => int.Parse(kv.Value) > 0)
.Select(kv => Pair.New(int.Parse(kv.Key),
LocationFromMapOffset(int.Parse(kv.Value), MapSize)))
.Where(a => a.First < 8)
.ToArray();
Map.PlayerCount = wp.Count();
foreach (var kv in wp)
Map.Waypoints.Add("spawn" + kv.First, kv.Second);
}
static int2 LocationFromMapOffset(int offset, int mapSize)
{
return new int2(offset % mapSize, offset / mapSize);
}
static MemoryStream ReadPackedSection(IniSection mapPackSection)
{
StringBuilder sb = new StringBuilder();
for (int i = 1; ; i++)
{
string line = mapPackSection.GetValue(i.ToString(), null);
if (line == null)
break;
sb.Append(line.Trim());
}
byte[] data = Convert.FromBase64String(sb.ToString());
List<byte[]> chunks = new List<byte[]>();
BinaryReader reader = new BinaryReader(new MemoryStream(data));
try
{
while (true)
{
uint length = reader.ReadUInt32() & 0xdfffffff;
byte[] dest = new byte[8192];
byte[] src = reader.ReadBytes((int)length);
/*int actualLength =*/
Format80.DecodeInto(src, dest);
chunks.Add(dest);
}
}
catch (EndOfStreamException) { }
MemoryStream ms = new MemoryStream();
foreach (byte[] chunk in chunks)
ms.Write(chunk, 0, chunk.Length);
ms.Position = 0;
return ms;
}
static byte ReadByte(Stream s)
{
int ret = s.ReadByte();
if (ret == -1)
throw new NotImplementedException();
return (byte)ret;
}
static ushort ReadWord(Stream s)
{
ushort ret = ReadByte(s);
ret |= (ushort)(ReadByte(s) << 8);
return ret;
}
void UnpackRATileData(MemoryStream ms)
{
Map.MapTiles = new TileReference<ushort, byte>[MapSize, MapSize];
for (int i = 0; i < MapSize; i++)
for (int j = 0; j < MapSize; j++)
Map.MapTiles[i, j] = new TileReference<ushort, byte>();
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
Map.MapTiles[i, j].type = ReadWord(ms);
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
{
Map.MapTiles[i, j].index = ReadByte(ms);
if (Map.MapTiles[i, j].type == 0xff || Map.MapTiles[i, j].type == 0xffff)
Map.MapTiles[i, j].index = byte.MaxValue;
}
}
void UnpackRAOverlayData(MemoryStream ms)
{
Map.MapResources = new TileReference<byte, byte>[MapSize, MapSize];
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
{
byte o = ReadByte(ms);
var res = Pair.New((byte)0, (byte)0);
if (o != 255 && overlayResourceMapping.ContainsKey(raOverlayNames[o]))
res = overlayResourceMapping[raOverlayNames[o]];
Map.MapResources[i, j] = new TileReference<byte, byte>(res.First, res.Second);
if (o != 255 && overlayActorMapping.ContainsKey(raOverlayNames[o]))
Map.Actors.Add("Actor" + ActorCount, new ActorReference("Actor" + ActorCount++, overlayActorMapping[raOverlayNames[o]], new int2(i, j), "Neutral"));
}
}
void ReadRATrees(IniFile file)
{
IniSection terrain = file.GetSection("TERRAIN", true);
if (terrain == null)
return;
foreach (KeyValuePair<string, string> kv in terrain)
{
var loc = int.Parse(kv.Key);
Map.Actors.Add("Actor" + ActorCount, new ActorReference("Actor" + ActorCount++, kv.Value.ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), "Neutral"));
}
}
void UnpackCncTileData(Stream ms)
{
Map.MapTiles = new TileReference<ushort, byte>[MapSize, MapSize];
for (int i = 0; i < MapSize; i++)
for (int j = 0; j < MapSize; j++)
Map.MapTiles[i, j] = new TileReference<ushort, byte>();
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
{
Map.MapTiles[i, j].type = ReadByte(ms);
Map.MapTiles[i, j].index = ReadByte(ms);
if (Map.MapTiles[i, j].type == 0xff)
Map.MapTiles[i, j].index = byte.MaxValue;
}
}
void ReadCncOverlay(IniFile file)
{
IniSection overlay = file.GetSection("OVERLAY", true);
if (overlay == null)
return;
Map.MapResources = new TileReference<byte, byte>[MapSize, MapSize];
foreach (KeyValuePair<string, string> kv in overlay)
{
var loc = int.Parse(kv.Key);
int2 cell = new int2(loc % MapSize, loc / MapSize);
var res = Pair.New((byte)0, (byte)0);
if (overlayResourceMapping.ContainsKey(kv.Value.ToLower()))
res = overlayResourceMapping[kv.Value.ToLower()];
Map.MapResources[cell.X, cell.Y] = new TileReference<byte, byte>(res.First, res.Second);
if (overlayActorMapping.ContainsKey(kv.Value.ToLower()))
Map.Actors.Add("Actor" + ActorCount, new ActorReference("Actor" + ActorCount++, overlayActorMapping[kv.Value.ToLower()], new int2(cell.X, cell.Y), "Neutral"));
}
}
void ReadCncTrees(IniFile file)
{
IniSection terrain = file.GetSection("TERRAIN", true);
if (terrain == null)
return;
foreach (KeyValuePair<string, string> kv in terrain)
{
var loc = int.Parse(kv.Key);
Map.Actors.Add("Actor" + ActorCount, new ActorReference("Actor" + ActorCount++, kv.Value.Split(',')[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), "Neutral"));
}
}
void LoadActors(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//num=owner,type,health,location,facing,...
var parts = s.Value.Split(',');
var loc = int.Parse(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
Map.Actors.Add("Actor" + ActorCount, new ActorReference("Actor" + ActorCount++, parts[1].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), parts[0]));
}
}
void LoadSmudges(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//loc=type,loc,depth
var parts = s.Value.Split(',');
var loc = int.Parse(parts[1]);
Map.Smudges.Add(new SmudgeReference(parts[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), int.Parse(parts[2])));
}
}
static string Truncate(string s, int maxLength)
{
return s.Length <= maxLength ? s : s.Substring(0, maxLength);
}
}
}

View File

@@ -58,6 +58,7 @@
<Compile Include="Form1.Designer.cs"> <Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="LegacyMapImporter.cs" />
<Compile Include="NewMapDialog.cs"> <Compile Include="NewMapDialog.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@@ -22,6 +22,7 @@ namespace OpenRA.Editor
Application.CurrentCulture = CultureInfo.InvariantCulture; Application.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args)); Application.Run(new Form1(args));
} }
} }

View File

@@ -15,6 +15,8 @@ using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Thirdparty; using OpenRA.Thirdparty;
using System;
using System.Diagnostics;
namespace OpenRA.Editor namespace OpenRA.Editor
{ {
@@ -252,7 +254,7 @@ namespace OpenRA.Editor
Map.Actors[id] = new ActorReference(id,Actor.Info.Name.ToLowerInvariant(), GetBrushLocation(), owner); Map.Actors[id] = new ActorReference(id,Actor.Info.Name.ToLowerInvariant(), GetBrushLocation(), owner);
} }
Random r = new Random(); System.Random r = new System.Random();
void DrawWithResource() void DrawWithResource()
{ {
Map.MapResources[GetBrushLocation().X, GetBrushLocation().Y] Map.MapResources[GetBrushLocation().X, GetBrushLocation().Y]
@@ -288,10 +290,11 @@ namespace OpenRA.Editor
Bitmap RenderChunk(int u, int v) Bitmap RenderChunk(int u, int v)
{ {
var bitmap = new Bitmap(ChunkSize * 24, ChunkSize * 24); var bitmap = new Bitmap(ChunkSize * 24, ChunkSize * 24);
bitmap.SetPixel(0, 0, Color.Green); bitmap.SetPixel(0, 0, Color.Green);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe unsafe
@@ -308,7 +311,7 @@ namespace OpenRA.Editor
var rawImage = tile.TileBitmapBytes[index]; var rawImage = tile.TileBitmapBytes[index];
for (var x = 0; x < 24; x++) for (var x = 0; x < 24; x++)
for (var y = 0; y < 24; y++) for (var y = 0; y < 24; y++)
p[ (j * 24 + y) * stride + i * 24 + x ] = Palette.GetColor(rawImage[x + 24 * y]).ToArgb(); p[(j * 24 + y) * stride + i * 24 + x] = Palette.GetColor(rawImage[x + 24 * y]).ToArgb();
if (Map.MapResources[u * ChunkSize + i, v * ChunkSize + j].type != 0) if (Map.MapResources[u * ChunkSize + i, v * ChunkSize + j].type != 0)
{ {

Binary file not shown.

View File

@@ -0,0 +1 @@
7063c02f2b8930b9556b1cc9013659500d5bc03c

View File

@@ -0,0 +1,518 @@
Selectable: True
MapFormat: 2
Title: Central Conflict
Description:
Author: Westwood Studios
PlayerCount: 8
Tileset: TEMPERAT
MapSize: 128,128
TopLeft: 16,16
BottomRight: 112,112
Players:
Actors:
ActorReference@Actor0:
Id: Actor0
Type: tc05
Location: 73,64
Owner: Neutral
ActorReference@Actor1:
Id: Actor1
Type: tc05
Location: 59,60
Owner: Neutral
ActorReference@Actor2:
Id: Actor2
Type: t01
Location: 63,61
Owner: Neutral
ActorReference@Actor3:
Id: Actor3
Type: t01
Location: 62,61
Owner: Neutral
ActorReference@Actor4:
Id: Actor4
Type: t02
Location: 66,61
Owner: Neutral
ActorReference@Actor5:
Id: Actor5
Type: tc05
Location: 67,61
Owner: Neutral
ActorReference@Actor6:
Id: Actor6
Type: tc05
Location: 64,48
Owner: Neutral
ActorReference@Actor7:
Id: Actor7
Type: tc03
Location: 58,50
Owner: Neutral
ActorReference@Actor8:
Id: Actor8
Type: tc02
Location: 64,51
Owner: Neutral
ActorReference@Actor9:
Id: Actor9
Type: tc02
Location: 28,21
Owner: Neutral
ActorReference@Actor10:
Id: Actor10
Type: tc02
Location: 28,26
Owner: Neutral
ActorReference@Actor11:
Id: Actor11
Type: tc02
Location: 26,25
Owner: Neutral
ActorReference@Actor12:
Id: Actor12
Type: tc03
Location: 39,22
Owner: Neutral
ActorReference@Actor13:
Id: Actor13
Type: tc05
Location: 40,25
Owner: Neutral
ActorReference@Actor14:
Id: Actor14
Type: t01
Location: 66,28
Owner: Neutral
ActorReference@Actor15:
Id: Actor15
Type: t01
Location: 77,29
Owner: Neutral
ActorReference@Actor16:
Id: Actor16
Type: t01
Location: 77,32
Owner: Neutral
ActorReference@Actor17:
Id: Actor17
Type: t02
Location: 80,31
Owner: Neutral
ActorReference@Actor18:
Id: Actor18
Type: tc05
Location: 83,31
Owner: Neutral
ActorReference@Actor19:
Id: Actor19
Type: tc05
Location: 91,38
Owner: Neutral
ActorReference@Actor20:
Id: Actor20
Type: t08
Location: 90,42
Owner: Neutral
ActorReference@Actor21:
Id: Actor21
Type: t08
Location: 81,37
Owner: Neutral
ActorReference@Actor22:
Id: Actor22
Type: t10
Location: 104,49
Owner: Neutral
ActorReference@Actor23:
Id: Actor23
Type: t12
Location: 103,47
Owner: Neutral
ActorReference@Actor24:
Id: Actor24
Type: t12
Location: 98,48
Owner: Neutral
ActorReference@Actor25:
Id: Actor25
Type: t12
Location: 55,65
Owner: Neutral
ActorReference@Actor26:
Id: Actor26
Type: t14
Location: 50,82
Owner: Neutral
ActorReference@Actor27:
Id: Actor27
Type: t01
Location: 68,93
Owner: Neutral
ActorReference@Actor28:
Id: Actor28
Type: tc02
Location: 64,107
Owner: Neutral
ActorReference@Actor29:
Id: Actor29
Type: tc01
Location: 60,102
Owner: Neutral
ActorReference@Actor30:
Id: Actor30
Type: t17
Location: 60,106
Owner: Neutral
ActorReference@Actor31:
Id: Actor31
Type: tc01
Location: 82,97
Owner: Neutral
ActorReference@Actor32:
Id: Actor32
Type: tc02
Location: 81,102
Owner: Neutral
ActorReference@Actor33:
Id: Actor33
Type: t02
Location: 73,97
Owner: Neutral
ActorReference@Actor34:
Id: Actor34
Type: tc03
Location: 104,100
Owner: Neutral
ActorReference@Actor35:
Id: Actor35
Type: tc05
Location: 109,109
Owner: Neutral
ActorReference@Actor36:
Id: Actor36
Type: tc04
Location: 103,109
Owner: Neutral
ActorReference@Actor37:
Id: Actor37
Type: t01
Location: 47,99
Owner: Neutral
ActorReference@Actor38:
Id: Actor38
Type: tc04
Location: 39,99
Owner: Neutral
ActorReference@Actor39:
Id: Actor39
Type: tc01
Location: 33,86
Owner: Neutral
ActorReference@Actor40:
Id: Actor40
Type: tc01
Location: 35,88
Owner: Neutral
ActorReference@Actor41:
Id: Actor41
Type: tc05
Location: 45,82
Owner: Neutral
ActorReference@Actor42:
Id: Actor42
Type: tc03
Location: 44,84
Owner: Neutral
ActorReference@Actor43:
Id: Actor43
Type: tc04
Location: 27,71
Owner: Neutral
ActorReference@Actor44:
Id: Actor44
Type: tc05
Location: 27,57
Owner: Neutral
ActorReference@Actor45:
Id: Actor45
Type: t01
Location: 37,62
Owner: Neutral
ActorReference@Actor46:
Id: Actor46
Type: t03
Location: 32,57
Owner: Neutral
ActorReference@Actor47:
Id: Actor47
Type: t06
Location: 27,44
Owner: Neutral
ActorReference@Actor48:
Id: Actor48
Type: t06
Location: 29,47
Owner: Neutral
ActorReference@Actor49:
Id: Actor49
Type: t06
Location: 25,47
Owner: Neutral
ActorReference@Actor50:
Id: Actor50
Type: t08
Location: 47,52
Owner: Neutral
ActorReference@Actor51:
Id: Actor51
Type: t10
Location: 50,51
Owner: Neutral
ActorReference@Actor52:
Id: Actor52
Type: tc05
Location: 49,48
Owner: Neutral
ActorReference@Actor53:
Id: Actor53
Type: t01
Location: 54,42
Owner: Neutral
ActorReference@Actor54:
Id: Actor54
Type: t05
Location: 53,39
Owner: Neutral
ActorReference@Actor55:
Id: Actor55
Type: tc05
Location: 35,40
Owner: Neutral
ActorReference@Actor56:
Id: Actor56
Type: t01
Location: 37,36
Owner: Neutral
ActorReference@Actor57:
Id: Actor57
Type: t01
Location: 36,25
Owner: Neutral
ActorReference@Actor58:
Id: Actor58
Type: t01
Location: 89,68
Owner: Neutral
ActorReference@Actor59:
Id: Actor59
Type: t02
Location: 96,70
Owner: Neutral
ActorReference@Actor60:
Id: Actor60
Type: tc05
Location: 101,69
Owner: Neutral
ActorReference@Actor61:
Id: Actor61
Type: tc05
Location: 94,80
Owner: Neutral
ActorReference@Actor62:
Id: Actor62
Type: t01
Location: 92,88
Owner: Neutral
ActorReference@Actor63:
Id: Actor63
Type: t02
Location: 93,89
Owner: Neutral
ActorReference@Actor64:
Id: Actor64
Type: t02
Location: 16,16
Owner: Neutral
ActorReference@Actor65:
Id: Actor65
Type: t05
Location: 60,27
Owner: Neutral
ActorReference@Actor66:
Id: Actor66
Type: t05
Location: 48,27
Owner: Neutral
ActorReference@Actor67:
Id: Actor67
Type: tc05
Location: 99,31
Owner: Neutral
ActorReference@Actor68:
Id: Actor68
Type: tc05
Location: 92,26
Owner: Neutral
ActorReference@Actor69:
Id: Actor69
Type: tc05
Location: 78,75
Owner: Neutral
ActorReference@Actor70:
Id: Actor70
Type: tc04
Location: 62,93
Owner: Neutral
ActorReference@Actor71:
Id: Actor71
Type: tc01
Location: 67,90
Owner: Neutral
ActorReference@Actor72:
Id: Actor72
Type: tc04
Location: 24,24
Owner: Neutral
ActorReference@Actor73:
Id: Actor73
Type: tc05
Location: 88,58
Owner: Neutral
ActorReference@Actor74:
Id: Actor74
Type: tc05
Location: 99,102
Owner: Neutral
ActorReference@Actor75:
Id: Actor75
Type: tc04
Location: 25,100
Owner: Neutral
ActorReference@Actor76:
Id: Actor76
Type: tc03
Location: 48,103
Owner: Neutral
ActorReference@Actor77:
Id: Actor77
Type: tc02
Location: 48,94
Owner: Neutral
ActorReference@Actor78:
Id: Actor78
Type: tc01
Location: 71,31
Owner: Neutral
ActorReference@Actor79:
Id: Actor79
Type: t17
Location: 70,31
Owner: Neutral
ActorReference@Actor80:
Id: Actor80
Type: tc02
Location: 73,32
Owner: Neutral
ActorReference@Actor81:
Id: Actor81
Type: mine
Location: 46,22
Owner: Neutral
ActorReference@Actor82:
Id: Actor82
Type: mine
Location: 73,27
Owner: Neutral
ActorReference@Actor83:
Id: Actor83
Type: mine
Location: 36,45
Owner: Neutral
ActorReference@Actor84:
Id: Actor84
Type: mine
Location: 33,77
Owner: Neutral
ActorReference@Actor85:
Id: Actor85
Type: mine
Location: 104,82
Owner: Neutral
ActorReference@Actor86:
Id: Actor86
Type: mine
Location: 109,104
Owner: Neutral
ActorReference@Actor87:
Id: Actor87
Type: mine
Location: 18,109
Owner: Neutral
ActorReference@Actor88:
Id: Actor88
Type: mine
Location: 58,61
Owner: Neutral
ActorReference@Actor89:
Id: Actor89
Type: mine
Location: 78,65
Owner: Neutral
ActorReference@Actor90:
Id: Actor90
Type: mine
Location: 82,76
Owner: Neutral
ActorReference@Actor91:
Id: Actor91
Type: mine
Location: 76,89
Owner: Neutral
ActorReference@Actor92:
Id: Actor92
Type: mine
Location: 53,91
Owner: Neutral
ActorReference@Actor93:
Id: Actor93
Type: mine
Location: 50,74
Owner: Neutral
ActorReference@Actor94:
Id: Actor94
Type: mine
Location: 101,26
Owner: Neutral
ActorReference@Actor95:
Id: Actor95
Type: mine
Location: 95,34
Owner: Neutral
Waypoints:
spawn0: 20,36
spawn1: 108,92
spawn2: 34,104
spawn3: 105,20
spawn4: 57,19
spawn5: 75,108
spawn6: 19,71
spawn7: 104,60
Smudges:
Rules:

Binary file not shown.

View File

@@ -0,0 +1 @@
b36b36596bc0ad9300247436d15c37749d5842de

View File

@@ -0,0 +1,386 @@
Selectable: True
MapFormat: 2
Title: Marooned II
Description:
Author: Westwood Studios
PlayerCount: 6
Tileset: TEMPERAT
MapSize: 128,128
TopLeft: 16,16
BottomRight: 112,112
Players:
Actors:
ActorReference@Actor0:
Id: Actor0
Type: mine
Location: 63,74
Owner: Neutral
ActorReference@Actor1:
Id: Actor1
Type: mine
Location: 92,30
Owner: Neutral
ActorReference@Actor2:
Id: Actor2
Type: mine
Location: 81,25
Owner: Neutral
ActorReference@Actor3:
Id: Actor3
Type: mine
Location: 43,28
Owner: Neutral
ActorReference@Actor4:
Id: Actor4
Type: mine
Location: 40,72
Owner: Neutral
ActorReference@Actor5:
Id: Actor5
Type: mine
Location: 97,76
Owner: Neutral
ActorReference@Actor6:
Id: Actor6
Type: mine
Location: 26,63
Owner: Neutral
ActorReference@Actor7:
Id: Actor7
Type: mine
Location: 50,46
Owner: Neutral
ActorReference@Actor8:
Id: Actor8
Type: mine
Location: 64,90
Owner: Neutral
ActorReference@Actor9:
Id: Actor9
Type: mine
Location: 44,99
Owner: Neutral
ActorReference@Actor10:
Id: Actor10
Type: tc04
Location: 80,78
Owner: Neutral
ActorReference@Actor11:
Id: Actor11
Type: tc03
Location: 78,85
Owner: Neutral
ActorReference@Actor12:
Id: Actor12
Type: tc01
Location: 83,87
Owner: Neutral
ActorReference@Actor13:
Id: Actor13
Type: t17
Location: 66,88
Owner: Neutral
ActorReference@Actor14:
Id: Actor14
Type: t16
Location: 57,79
Owner: Neutral
ActorReference@Actor15:
Id: Actor15
Type: t15
Location: 60,69
Owner: Neutral
ActorReference@Actor16:
Id: Actor16
Type: t14
Location: 65,80
Owner: Neutral
ActorReference@Actor17:
Id: Actor17
Type: t13
Location: 62,92
Owner: Neutral
ActorReference@Actor18:
Id: Actor18
Type: t11
Location: 85,101
Owner: Neutral
ActorReference@Actor19:
Id: Actor19
Type: t08
Location: 87,100
Owner: Neutral
ActorReference@Actor20:
Id: Actor20
Type: t08
Location: 97,40
Owner: Neutral
ActorReference@Actor21:
Id: Actor21
Type: t11
Location: 98,39
Owner: Neutral
ActorReference@Actor22:
Id: Actor22
Type: t08
Location: 100,41
Owner: Neutral
ActorReference@Actor23:
Id: Actor23
Type: t07
Location: 96,35
Owner: Neutral
ActorReference@Actor24:
Id: Actor24
Type: t06
Location: 85,37
Owner: Neutral
ActorReference@Actor25:
Id: Actor25
Type: t02
Location: 83,47
Owner: Neutral
ActorReference@Actor26:
Id: Actor26
Type: t01
Location: 54,33
Owner: Neutral
ActorReference@Actor27:
Id: Actor27
Type: t03
Location: 43,47
Owner: Neutral
ActorReference@Actor28:
Id: Actor28
Type: tc02
Location: 51,28
Owner: Neutral
ActorReference@Actor29:
Id: Actor29
Type: tc01
Location: 37,25
Owner: Neutral
ActorReference@Actor30:
Id: Actor30
Type: t17
Location: 31,26
Owner: Neutral
ActorReference@Actor31:
Id: Actor31
Type: t15
Location: 32,65
Owner: Neutral
ActorReference@Actor32:
Id: Actor32
Type: t14
Location: 37,64
Owner: Neutral
ActorReference@Actor33:
Id: Actor33
Type: t13
Location: 62,83
Owner: Neutral
ActorReference@Actor34:
Id: Actor34
Type: t11
Location: 90,70
Owner: Neutral
ActorReference@Actor35:
Id: Actor35
Type: t10
Location: 74,65
Owner: Neutral
ActorReference@Actor36:
Id: Actor36
Type: tc01
Location: 81,21
Owner: Neutral
ActorReference@Actor37:
Id: Actor37
Type: t17
Location: 96,27
Owner: Neutral
ActorReference@Actor38:
Id: Actor38
Type: tc05
Location: 45,55
Owner: Neutral
ActorReference@Actor39:
Id: Actor39
Type: tc04
Location: 35,58
Owner: Neutral
ActorReference@Actor40:
Id: Actor40
Type: t16
Location: 46,61
Owner: Neutral
ActorReference@Actor41:
Id: Actor41
Type: t13
Location: 45,50
Owner: Neutral
ActorReference@Actor42:
Id: Actor42
Type: t12
Location: 43,39
Owner: Neutral
ActorReference@Actor43:
Id: Actor43
Type: tc02
Location: 68,36
Owner: Neutral
ActorReference@Actor44:
Id: Actor44
Type: t07
Location: 72,72
Owner: Neutral
ActorReference@Actor45:
Id: Actor45
Type: t06
Location: 42,58
Owner: Neutral
ActorReference@Actor46:
Id: Actor46
Type: t06
Location: 22,63
Owner: Neutral
ActorReference@Actor47:
Id: Actor47
Type: t10
Location: 22,56
Owner: Neutral
ActorReference@Actor48:
Id: Actor48
Type: t08
Location: 34,82
Owner: Neutral
ActorReference@Actor49:
Id: Actor49
Type: tc04
Location: 54,101
Owner: Neutral
ActorReference@Actor50:
Id: Actor50
Type: tc01
Location: 61,47
Owner: Neutral
ActorReference@Actor51:
Id: Actor51
Type: t17
Location: 57,32
Owner: Neutral
ActorReference@Actor52:
Id: Actor52
Type: tc01
Location: 81,36
Owner: Neutral
ActorReference@Actor53:
Id: Actor53
Type: t16
Location: 87,52
Owner: Neutral
ActorReference@Actor54:
Id: Actor54
Type: t16
Location: 102,48
Owner: Neutral
ActorReference@Actor55:
Id: Actor55
Type: t15
Location: 94,60
Owner: Neutral
ActorReference@Actor56:
Id: Actor56
Type: tc02
Location: 103,76
Owner: Neutral
ActorReference@Actor57:
Id: Actor57
Type: t16
Location: 96,85
Owner: Neutral
ActorReference@Actor58:
Id: Actor58
Type: tc04
Location: 95,84
Owner: Neutral
ActorReference@Actor59:
Id: Actor59
Type: tc05
Location: 86,39
Owner: Neutral
ActorReference@Actor60:
Id: Actor60
Type: tc04
Location: 49,21
Owner: Neutral
ActorReference@Actor61:
Id: Actor61
Type: tc01
Location: 45,40
Owner: Neutral
ActorReference@Actor62:
Id: Actor62
Type: t16
Location: 27,52
Owner: Neutral
ActorReference@Actor63:
Id: Actor63
Type: tc02
Location: 72,103
Owner: Neutral
ActorReference@Actor64:
Id: Actor64
Type: t16
Location: 81,102
Owner: Neutral
ActorReference@Actor65:
Id: Actor65
Type: t17
Location: 78,57
Owner: Neutral
ActorReference@Actor66:
Id: Actor66
Type: tc01
Location: 37,75
Owner: Neutral
ActorReference@Actor67:
Id: Actor67
Type: tc01
Location: 61,41
Owner: Neutral
ActorReference@Actor68:
Id: Actor68
Type: t16
Location: 79,42
Owner: Neutral
ActorReference@Actor69:
Id: Actor69
Type: tc04
Location: 98,56
Owner: Neutral
Waypoints:
spawn0: 94,47
spawn1: 81,94
spawn2: 36,42
spawn3: 35,92
spawn4: 64,27
spawn5: 80,72
Smudges:
Rules: