Documentation
¶
Index ¶
Constants ¶
View Source
const ( FalloutCompressStore uint32 = 0x10 // needs research, see fallout1-re/src/plib/db/db.c, de.flags 16 FalloutCompressNone uint32 = 0x20 // as-is, DAT1 sets SizePacked to 0 FalloutCompressLZSS uint32 = 0x40 )
Variables ¶
View Source
var Default = LZSS{
DictionarySize: 4096,
MinMatch: 2,
MaxMatch: 18,
}
Functions ¶
This section is empty.
Types ¶
type FalloutFile ¶
type FalloutFile struct {
// Stream containing compressed file data
//
// All `FalloutFile` functions keep `Stream` position unchanged,
// as long there were no errors
Stream io.ReadSeeker
// File data offset;
// same as in DAT1 file entry
Offset int64
// Size of compressed data in bytes
//
// DAT1 file entry sets it to 0 for uncompressed files;
// in that case, uncompressed size should be used instead
SizePacked int64
// Compression mode
//
// Must be set to one of `FalloutCompress*` constants;
// same as in DAT1 file entry
CompressMode uint32
}
FalloutFile is a small wrapper around LZSS holding minimal required data about DAT1 file entry
func (FalloutFile) Decompress ¶
func (file FalloutFile) Decompress() (bytes []byte, err error)
Decompress returns slice of bytes
Note that this function can handle uncompressed data
func (FalloutFile) ReadBlocks ¶
func (file FalloutFile) ReadBlocks() (blocksBytes [][]byte, err error)
ReadBlocks returns compressed file split into block defined by DAT1
func (FalloutFile) ReadBlocksSize ¶
func (file FalloutFile) ReadBlocksSize() (blocks []int64, err error)
ReadBlocksSize returns a slice containing compressed file blocks sizes
Click to show internal directories.
Click to hide internal directories.