Skip to content

Commit

Permalink
Renamed the Systems enum to Platform to be more accurate. (MTARC)
Browse files Browse the repository at this point in the history
  • Loading branch information
IcySon55 committed Aug 21, 2017
1 parent 5418e0d commit ca92bd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/archive/archive_mt/MTARC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MTARC
private Header Header;
private int HeaderLength = 12;
private ByteOrder ByteOrder = ByteOrder.LittleEndian;
private Systems System;
private Platform System;

public MTARC(Stream input)
{
Expand All @@ -28,7 +28,7 @@ public MTARC(Stream input)
{
br.ByteOrder = ByteOrder = ByteOrder.BigEndian;
HeaderLength = 8;
System = Systems.PS3;
System = Platform.PS3;
}

// Header
Expand All @@ -40,7 +40,7 @@ public MTARC(Stream input)
Files.AddRange(entries.Select(metadata =>
{
br.BaseStream.Position = metadata.Offset;
var level = (System == Systems.CTR ? metadata.CompressedSize != (metadata.UncompressedSize & 0x00FFFFFF) : metadata.CompressedSize != (metadata.UncompressedSize >> 3)) ? CompressionLevel.Optimal : CompressionLevel.NoCompression;
var level = (System == Platform.CTR ? metadata.CompressedSize != (metadata.UncompressedSize & 0x00FFFFFF) : metadata.CompressedSize != (metadata.UncompressedSize >> 3)) ? CompressionLevel.Optimal : CompressionLevel.NoCompression;

return new MTArcFileInfo
{
Expand Down
8 changes: 4 additions & 4 deletions src/archive/archive_mt/MTArcSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MTArcFileInfo : ArchiveFileInfo
{
public FileMetadata Metadata { get; set; }
public CompressionLevel CompressionLevel { get; set; }
public Systems System { get; set; }
public Platform System { get; set; }

public override Stream FileData
{
Expand All @@ -25,7 +25,7 @@ public override Stream FileData
}
}

public override long? FileSize => System == Systems.CTR ? Metadata.UncompressedSize & 0x00FFFFFF : Metadata.UncompressedSize >> 3;
public override long? FileSize => System == Platform.CTR ? Metadata.UncompressedSize & 0x00FFFFFF : Metadata.UncompressedSize >> 3;

public void Write(Stream output, long offset, ByteOrder byteOrder)
{
Expand All @@ -49,13 +49,13 @@ public void Write(Stream output, long offset, ByteOrder byteOrder)
Metadata.CompressedSize = (int)FileData.Length;
}

Metadata.UncompressedSize = System == Systems.CTR ? (int)(FileData.Length & 0xFF000000) : (int)(FileData.Length << 3);
Metadata.UncompressedSize = System == Platform.CTR ? (int)(FileData.Length & 0xFF000000) : (int)(FileData.Length << 3);
}
}
}
}

public enum Systems
public enum Platform
{
CTR,
PS3
Expand Down

0 comments on commit ca92bd7

Please sign in to comment.