git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1195 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-13 11:12:16 +00:00
parent 9ffe1d2845
commit d4a7e5fb9e
10 changed files with 102 additions and 100 deletions

View File

@@ -24,28 +24,26 @@ namespace OpenRa.FileFormats
if( countStr == null || startStr == null || pattern == null )
break;
//try
int count = int.Parse( countStr );
int start = int.Parse( startStr, NumberStyles.HexNumber );
for( int i = 0 ; i < count ; i++ )
{
int count = int.Parse( countStr );
int start = int.Parse( startStr, NumberStyles.HexNumber );
for( int i = 0 ; i < count ; i++ )
Stream s;
try
{
Stream s;
try
{
s = mixFile.GetContent( string.Format( pattern, i + 1 ) );
}
catch { continue; }
Terrain t = new Terrain( s, pal );
if( tiles.ContainsKey( (ushort)( start + i ) ) )
continue;
tiles.Add( (ushort)( start + i ), t );
s = mixFile.GetContent( string.Format( pattern, i + 1 ) );
}
catch { continue; }
Terrain t = new Terrain( s, pal );
if( tiles.ContainsKey( (ushort)( start + i ) ) )
continue;
tiles.Add( (ushort)( start + i ), t );
}
//catch { }
}
tileIdFile.Close();
}
public byte[] GetBytes(TileReference r) { return tiles[r.tile].TileBitmapBytes[r.image]; }
}
}