[Fixing indentation]
This commit is contained in:
@@ -118,7 +118,7 @@ namespace OpenRa.FileFormats
|
||||
for( int i = 0 ; i < 128 ; i++ )
|
||||
for( int j = 0 ; j < 128 ; j++ )
|
||||
{
|
||||
MapTiles[j, i].image = (byte)ms.ReadByte();
|
||||
MapTiles[j, i].image = (byte)ms.ReadByte();
|
||||
if( MapTiles[ j, i ].tile == 0xff || MapTiles[ j, i ].tile == 0xffff )
|
||||
MapTiles[ j, i ].image = (byte)( i % 4 + ( j % 4 ) * 4 );
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace OpenRa.FileFormats
|
||||
readonly Dictionary<uint, PackageEntry> index;
|
||||
readonly bool isRmix, isEncrypted;
|
||||
readonly long dataStart;
|
||||
readonly Stream s;
|
||||
readonly Stream s;
|
||||
|
||||
public Package(string filename)
|
||||
{
|
||||
this.filename = filename;
|
||||
s = FileSystem.Open(filename);
|
||||
s = FileSystem.Open(filename);
|
||||
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
uint signature = reader.ReadUInt32();
|
||||
|
||||
isRmix = 0 == (signature & ~(uint)(MixFileFlags.Checksum | MixFileFlags.Encrypted));
|
||||
@@ -50,7 +50,7 @@ namespace OpenRa.FileFormats
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
byte[] keyblock = reader.ReadBytes(80);
|
||||
byte[] blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
|
||||
byte[] blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
|
||||
|
||||
uint[] h = ReadUints(reader, 2);
|
||||
|
||||
@@ -117,9 +117,9 @@ namespace OpenRa.FileFormats
|
||||
|
||||
public Stream GetContent(uint hash)
|
||||
{
|
||||
PackageEntry e;
|
||||
if (!index.TryGetValue(hash, out e))
|
||||
return null;
|
||||
PackageEntry e;
|
||||
if (!index.TryGetValue(hash, out e))
|
||||
return null;
|
||||
|
||||
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
|
||||
byte[] data = new byte[ e.Length ];
|
||||
|
||||
@@ -39,11 +39,11 @@ namespace OpenRa.FileFormats
|
||||
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
|
||||
BinaryReader reader = new BinaryReader(ms);
|
||||
|
||||
int len = name.Length >> 2;
|
||||
int len = name.Length >> 2;
|
||||
uint result = 0;
|
||||
|
||||
while (len-- != 0)
|
||||
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
|
||||
while (len-- != 0)
|
||||
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace OpenRa.FileFormats
|
||||
}
|
||||
|
||||
h.Image = CopyImageData( h.RefImage.Image );
|
||||
Format40.DecodeInto(ReadCompressedData(stream, h), h.Image);
|
||||
Format40.DecodeInto(ReadCompressedData(stream, h), h.Image);
|
||||
break;
|
||||
}
|
||||
case Format.Format80:
|
||||
|
||||
Reference in New Issue
Block a user