sprite

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutfitPalette [hsiHSteps * hsiSIValues][3]uint8

Functions

func OutfitPaletteRGB added in v1.8.0

func OutfitPaletteRGB() [][3]uint8

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(datPath, sprPath string, serverToClient map[uint16]uint16) (*Cache, error)

func (*Cache) Dat

func (c *Cache) Dat() *DatFile

func (*Cache) EffectPNG added in v1.8.0

func (c *Cache) EffectPNG(id uint16, frame int) ([]byte, error)

func (*Cache) MissilePNG added in v1.8.0

func (c *Cache) MissilePNG(id uint16, direction int) ([]byte, error)

func (*Cache) OutfitPNG

func (c *Cache) OutfitPNG(looktype uint16, head, body, legs, feet, addons, direction int, mount uint16, animFrames ...int) ([]byte, error)

func (*Cache) PNG

func (c *Cache) PNG(id uint16) ([]byte, error)

func (*Cache) PNGByServerID

func (c *Cache) PNGByServerID(id uint16) ([]byte, error)

func (*Cache) Spr

func (c *Cache) Spr() *SpriteFile

type DatFile

type DatFile struct {
	Signature    uint32
	ItemCount    uint16
	OutfitCount  uint16
	EffectCount  uint16
	MissileCount uint16
	Items        map[uint16]*DatItem
	Outfits      map[uint16]*DatItem
	Effects      map[uint16]*DatItem
	Missiles     map[uint16]*DatItem
}

func ParseDATFromReader added in v1.9.0

func ParseDATFromReader(r io.Reader) (*DatFile, error)

type DatItem

type DatItem struct {
	ClientID    uint16
	Width       uint8
	Height      uint8
	ColorLayers uint8
	XDiv        uint8
	YDiv        uint8
	ZDiv        uint8
	AnimCount   uint8
	SpriteIDs   []uint32
	Flags       map[uint8][]byte
}

type OBDEntry added in v1.10.0

type OBDEntry struct {
	Category string
	ID       uint16
	DatItem  *DatItem
	Sprites  map[uint32]*image.RGBA
}

type OBDFile added in v1.10.0

type OBDFile struct {
	Version uint16
	Entries []OBDEntry
}

func ParseOBD added in v1.10.0

func ParseOBD(r io.Reader) (*OBDFile, error)

type SpriteFile

type SpriteFile struct {
	// contains filtered or unexported fields
}

func ParseSPRFromBytes added in v1.9.0

func ParseSPRFromBytes(data []byte) (*SpriteFile, error)

func (*SpriteFile) Close

func (s *SpriteFile) Close() error

func (*SpriteFile) GetRGBA

func (s *SpriteFile) GetRGBA(id uint32) (*image.RGBA, error)

func (*SpriteFile) RawSpriteData added in v1.2.0

func (s *SpriteFile) RawSpriteData(id uint32) ([]byte, error)

func (*SpriteFile) SetRGBA added in v1.13.0

func (s *SpriteFile) SetRGBA(id uint32, img *image.RGBA)

func (*SpriteFile) Signature added in v1.2.0

func (s *SpriteFile) Signature() uint32

func (*SpriteFile) SpriteCount added in v1.2.0

func (s *SpriteFile) SpriteCount() uint32

Jump to

Keyboard shortcuts

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