Documentation
¶
Overview ¶
"triad" describes a storage unit used in the game files. It consists of a "main" file (no extension), a "stream" file (.stream), and a "GPU" file (.gpu_resources). The stream and GPU files are optional.
Index ¶
- Variables
- type DataDir
- type DataType
- type File
- func (f *File) Exists(typ DataType) bool
- func (f *File) ID() FileID
- func (f *File) Open(ctx context.Context, typ DataType) (io.ReadSeekCloser, error)
- func (f *File) OpenMulti(ctx context.Context, types ...DataType) (io.ReadCloser, error)
- func (f *File) Read(typ DataType) ([]byte, error)
- func (f *File) TriadIDs() []Hash
- type FileData
- type FileID
- type Hash
- type HeaderData
- type ThinHash
- type Triad
- type TypeData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Returned when the file exists, but doesn't have the // requested data type. ErrFileDataTypeNotExist = errors.New("requested file data type doesn't exist") )
Functions ¶
This section is empty.
Types ¶
type DataDir ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) OpenMulti ¶ added in v0.3.0
Returns a MultiReader concatenating the given data stream types. Skips any specified types that don't exist. If you need seeking functionality, use Open(). Call Close() on returned reader when done.
type Hash ¶
type Hash struct{ Value uint64 }
func ParseHash ¶ added in v0.5.20
ParseHash parses a big endian murmur64 hash. Ignores 0x prefix if present.
func (Hash) MarshalText ¶ added in v0.6.0
func (Hash) StringEndian ¶ added in v0.1.7
type HeaderData ¶
type HeaderData struct {
MagicNum [4]byte // 0x11 0x00 0x00 0xF0
NumTypes uint32
NumFiles uint32
Unk00 [20]byte
ApproxMainSize uint64 // aligned by 256 / weirdly offset
ApproxGPUSize uint64 // aligned by 256 / weirdly offset
Unk01 [24]byte
}
Unk means the data's purpose is unknown.
type Triad ¶
type Triad struct {
ID Hash
MainPath string
StreamPath string // optional
GPUpath string // optional
Header HeaderData
Types []TypeData
Files []FileData
}
A triad consists of a main file, a stream file and a GPU resource file. The stream file and GPU resource file are optional.
func (*Triad) HasDataType ¶
Click to show internal directories.
Click to hide internal directories.