Fixes & Resources support

This commit is contained in:
Paul Chote
2010-04-01 22:02:04 +13:00
committed by Bob
parent 705e3eb2f6
commit c366b7c7fc
7 changed files with 32 additions and 49 deletions

View File

@@ -88,16 +88,12 @@ namespace OpenRA.FileFormats
public byte[] GetBytes(TileReference<ushort,byte> r)
{
Terrain tile;
Log.Write("Attempting to load tile {0} {1}",r.type,r.image);
try {
if( tiles.TryGetValue( r.type, out tile ) )
return tile.TileBitmapBytes[ r.image ];
}
catch (System.ArgumentOutOfRangeException)
{
tiles.TryGetValue( 0xfffe, out tile );
return tile.TileBitmapBytes[ 0 ];
}
catch (System.ArgumentOutOfRangeException) { }
byte[] missingTile = new byte[ 24 * 24 ];
for( int i = 0 ; i < missingTile.Length ; i++ )
missingTile[ i ] = 0x36;