Skip to content

package content_archive

import "kaiju/engine/assets/content_archive"

Functions

CreateArchiveFromFiles

func CreateArchiveFromFiles(outPath string, files []SourceContent, key []byte) error

CreateArchiveFromFolder

func CreateArchiveFromFolder(inPath, outPath string, key []byte) error

Types

Archive

struct

type Archive struct {
    // Has unexported fields.
}

Archive manages the packed assets.

OpenArchiveFile

func OpenArchiveFile(path string, key []byte) (*Archive, error)

OpenArchiveFromBytes

func OpenArchiveFromBytes(data []byte, key []byte) (*Archive, error)

Archive.Exists

func (a *Archive) Exists(name string) bool

Archive.Read

func (a *Archive) Read(name string) ([]byte, error)

Asset

struct

type Asset struct {
    Name   string
    Offset uint64
    Size   uint32
    CRC    uint32 // CRC32 of original (deobf) data.
    Data   []byte // Loaded/cached deobf data.
}

Asset holds metadata.

SourceContent

struct

type SourceContent struct {
    Key              string
    FullPath         string
    CustomSerializer func(rawData []byte) ([]byte, error)
}