add editor hack for fixing open areas in existing ra maps

This commit is contained in:
Chris Forbes
2011-05-30 21:59:25 +12:00
parent 5531715652
commit f84312acb9
2 changed files with 37 additions and 7 deletions

View File

@@ -415,5 +415,25 @@ namespace OpenRA.Editor
showActorNamesToolStripMenuItem.Checked ^= true;
surface1.ShowActorNames = showActorNamesToolStripMenuItem.Checked;
}
void FixOpenAreas(object sender, EventArgs e)
{
dirty = true;
var r = new Random();
for (var j = surface1.Map.Bounds.Top; j < surface1.Map.Bounds.Bottom; j++)
for (var i = surface1.Map.Bounds.Left; i < surface1.Map.Bounds.Right; i++)
{
var tr = surface1.Map.MapTiles.Value[i, j];
if (tr.type == 0xff || tr.type == 0xffff || tr.type == 1 || tr.type == 2)
tr.index = (byte)r.Next(0,
Rules.TileSets[surface1.Map.Tileset].Tiles[tr.type].TileBitmapBytes.Count);
surface1.Map.MapTiles.Value[i, j] = tr;
}
surface1.Chunks.Clear();
surface1.Invalidate();
}
}
}