Documentation
¶
Index ¶
- Constants
- func GetDefaultPalette() color.Palette
- func GetPaletteOverrideMap(cache *LbxCache, lbxFile *LbxFile, filename string) (map[int]color.Palette, error)
- func ReadByte(reader io.Reader) (byte, error)
- func ReadUint16(reader io.Reader) (uint16, error)
- func ReadUint16Big(reader io.Reader) (uint16, error)
- func ReadUint32(reader io.Reader) (uint32, error)
- type LbxCache
- type LbxFile
- func (lbx *LbxFile) GetPalette(entry int) (color.Palette, error)
- func (lbx *LbxFile) GetReader(entry int) (*bytes.Reader, error)
- func (lbxFile *LbxFile) RawData(entry int) ([]byte, error)
- func (lbx *LbxFile) ReadImages(entry int) ([]*image.Paletted, error)
- func (lbx *LbxFile) ReadImagesWithPalette(entry int, palette color.Palette, forcePalette bool) ([]*image.Paletted, error)
- func (lbx *LbxFile) ReadTerrainImages(entry int) ([]image.Image, error)
- func (lbx *LbxFile) TotalEntries() int
- type PaletteInfo
Constants ¶
View Source
const LbxSignature = 0x0000fead
Variables ¶
This section is empty.
Functions ¶
func GetDefaultPalette ¶
func GetPaletteOverrideMap ¶
func GetPaletteOverrideMap(cache *LbxCache, lbxFile *LbxFile, filename string) (map[int]color.Palette, error)
some lbx images implicitly use a palette from a specific entry * return a mapping from lbx entry -> palette to be used for that entry, e.g. * lbx.ReadImagesWithPalette(3, overrideMap[3])
Types ¶
type LbxFile ¶
type LbxFile struct { Signature uint32 Version uint16 Data [][]byte // most lbx files have an extra strings section Strings []string }
func (*LbxFile) GetPalette ¶
return just the palette for a given entry, or nil if there is no custom palette
func (*LbxFile) ReadImagesWithPalette ¶
func (lbx *LbxFile) ReadImagesWithPalette(entry int, palette color.Palette, forcePalette bool) ([]*image.Paletted, error)
a nil palette means to use the default palette
func (*LbxFile) ReadTerrainImages ¶
terrain.lbx has a special format that is different from regular graphics
func (*LbxFile) TotalEntries ¶
type PaletteInfo ¶
Click to show internal directories.
Click to hide internal directories.