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

This commit is contained in:
(no author)
2007-07-18 16:15:06 +00:00
parent 471759d25c
commit b624a82567
2 changed files with 16 additions and 9 deletions

View File

@@ -43,14 +43,12 @@ namespace OpenRa.FileFormats
Width = int.Parse(map.GetValue("Width", "0"));
Height = int.Parse(map.GetValue("Height", "0"));
UnpackTileData(ReadMapPack(file));
UnpackTileData( ReadPackedSection( file.GetSection( "MapPack" ) ) );
ReadTrees(file);
}
static MemoryStream ReadMapPack(IniFile file)
static MemoryStream ReadPackedSection(IniSection mapPackSection)
{
IniSection mapPackSection = file.GetSection("MapPack");
StringBuilder sb = new StringBuilder();
for (int i = 1; ; i++)
{
@@ -120,6 +118,14 @@ namespace OpenRa.FileFormats
}
}
void UnpackOverlayData( MemoryStream ms )
{
for( int i = 0 ; i < 128 ; i++ )
for( int j = 0 ; j < 128 ; j++ )
MapTiles[ j, i ].overlay = ReadByte( ms );
}
void ReadTrees( IniFile file )
{
IniSection terrain = file.GetSection( "TERRAIN" );

View File

@@ -8,6 +8,7 @@ namespace OpenRa.FileFormats
{
public ushort tile;
public byte image;
public byte overlay;
public override int GetHashCode() { return tile.GetHashCode() ^ image.GetHashCode(); }