d2dc6

package
v0.0.0-...-7f92c57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Overview

Package d2dc6 contains the logic for loading and processing DC6 files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DC6

type DC6 struct {
	Version            int32
	Flags              uint32
	Encoding           uint32
	Termination        []byte // 4 bytes
	Directions         uint32
	FramesPerDirection uint32
	FramePointers      []uint32    // size is Directions*FramesPerDirection
	Frames             []*DC6Frame // size is Directions*FramesPerDirection
}

DC6 represents a DC6 file.

func Load

func Load(data []byte) (*DC6, error)

Load loads a dc6 animation

func New

func New() *DC6

New creates a new, empty DC6

func (*DC6) Clone

func (d *DC6) Clone() *DC6

Clone creates a copy of the DC6

func (*DC6) DecodeFrame

func (d *DC6) DecodeFrame(frameIndex int) []byte

DecodeFrame decodes the given frame to an indexed color texture

func (*DC6) Marshal

func (d *DC6) Marshal() []byte

Marshal encodes dc6 animation back into byte slice

func (*DC6) Unmarshal

func (d *DC6) Unmarshal(data []byte) error

Unmarshal converts bite slice into DC6 structure

type DC6Frame

type DC6Frame struct {
	Flipped    uint32
	Width      uint32
	Height     uint32
	OffsetX    int32
	OffsetY    int32
	Unknown    uint32
	NextBlock  uint32
	Length     uint32
	FrameData  []byte // size is the value of Length
	Terminator []byte // 3 bytes
}

DC6Frame represents a single frame in a DC6.

type DC6FrameHeader

type DC6FrameHeader struct {
	Flipped   int32  `struct:"int32"`
	Width     int32  `struct:"int32"`
	Height    int32  `struct:"int32"`
	OffsetX   int32  `struct:"int32"`
	OffsetY   int32  `struct:"int32"`
	Unknown   uint32 `struct:"uint32"`
	NextBlock uint32 `struct:"uint32"`
	Length    uint32 `struct:"uint32"`
}

DC6FrameHeader represents the header of a frame in a DC6.

type DC6Header

type DC6Header struct {
	Version            int32  `struct:"int32"`
	Flags              uint32 `struct:"uint32"`
	Encoding           uint32 `struct:"uint32"`
	Termination        []byte `struct:"[4]byte"`
	Directions         int32  `struct:"int32"`
	FramesPerDirection int32  `struct:"int32"`
}

DC6Header represents the file header of a DC6 file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL