public static CompressionType GetAlgorithm(VoidPtr addr, int length) { BinTag compTag = *(BinTag *)addr; if (compTag == YAZ0.Tag) { return(CompressionType.RunLengthYAZ0); } else if (compTag == YAY0.Tag) { return(CompressionType.RunLengthYAY0); } else { CompressionHeader *cmpr = (CompressionHeader *)addr; if (cmpr->ExpandedSize < length) { return(CompressionType.None); } if (!cmpr->HasLegitCompression()) { return(CompressionType.None); } //Check to make sure we're not reading a tag if (IsTag((byte *)addr)) { return(CompressionType.None); } return(cmpr->Algorithm); } }
public BRESHeader(int size, int numSections) { _tag = Tag; _endian = 0xFEFF; _version = 0; _fileSize = (uint)size; _rootOffset = 0x10; _numSections = (ushort)numSections; }
public static uint GetExpandedLength(VoidPtr addr, int length) { BinTag compTag = *(BinTag *)addr; if (compTag == YAZ0.Tag) { return(((YAZ0 *)addr)->_unCompDataLen); } if (compTag == YAY0.Tag) { return(((YAY0 *)addr)->_unCompDataLen); } return(((CompressionHeader *)addr)->ExpandedSize); }
public WTE(short width, short height) { this.tag = "WTE\0"; this.width = width; this.height = height; }
public ROOTHeader(int size, int numEntries) { _tag = Tag; _size = size; _master = new ResourceGroup(numEntries); }
internal static ResourceNode TryParse(DataSource source) { BinTag tag = ((RSTMHeader *)source.Address)->_header._tag; return(tag == RSTMHeader.Tag || tag == CSTMHeader.Tag || tag == FSTMHeader.Tag ? new RSTMNode() : null); }