make editor use pickany metadata
This commit is contained in:
@@ -154,7 +154,12 @@ namespace OpenRA.Editor
|
||||
var z = u + v * template.Size.X;
|
||||
if (tile.TileBitmapBytes[z] != null)
|
||||
Map.MapTiles[u + pos.X, v + pos.Y] =
|
||||
new TileReference<ushort, byte> { type = Brush.N, image = (byte)z, index = (byte)z };
|
||||
new TileReference<ushort, byte>
|
||||
{
|
||||
type = Brush.N,
|
||||
index = template.PickAny ? byte.MaxValue : (byte)z,
|
||||
image = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4)*4) : (byte)z,
|
||||
};
|
||||
|
||||
var ch = new int2((pos.X + u) / ChunkSize, (pos.Y + v) / ChunkSize);
|
||||
if (Chunks.ContainsKey(ch))
|
||||
@@ -290,7 +295,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
var tr = Map.MapTiles[u * ChunkSize + i, v * ChunkSize + j];
|
||||
var tile = TileSet.tiles[tr.type];
|
||||
var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0;
|
||||
var index = (tr.image < tile.TileBitmapBytes.Count) ? tr.image : (byte)0;
|
||||
var rawImage = tile.TileBitmapBytes[index];
|
||||
for (var x = 0; x < 24; x++)
|
||||
for (var y = 0; y < 24; y++)
|
||||
|
||||
@@ -98,11 +98,11 @@ namespace OpenRA.FileFormats
|
||||
return missingTile;
|
||||
}
|
||||
|
||||
public TerrainType GetTerrainType( TileReference<ushort, byte> r )
|
||||
public TerrainType GetTerrainType(TileReference<ushort, byte> r)
|
||||
{
|
||||
var tt = walk[ r.type ].TerrainType;
|
||||
var tt = walk[r.type].TerrainType;
|
||||
TerrainType ret;
|
||||
if( !tt.TryGetValue( r.image, out ret ) )
|
||||
if (!tt.TryGetValue(r.image, out ret))
|
||||
return 0;// Default zero (walkable)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
[TEM0]
|
||||
Name=CLEAR1
|
||||
pickany=yes
|
||||
width=1
|
||||
height=1
|
||||
tiletype0=0
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
width=1
|
||||
height=1
|
||||
Name=CLEAR1
|
||||
pickany=yes
|
||||
tiletype0=0
|
||||
tiletype1=0
|
||||
tiletype2=0
|
||||
|
||||
Reference in New Issue
Block a user