add palette dat loader

This commit is contained in:
Alex Yatskov 2018-12-16 14:09:18 -08:00
parent 83181a3dde
commit f615c9bb5f

21
formats/dat/dat.go Normal file
View File

@ -0,0 +1,21 @@
package dat
import (
"encoding/binary"
"io"
"github.com/FooSoft/lazarus/math"
)
type Palette struct {
Colors [256]math.Color3b
}
func NewFromReader(r io.Reader) (*Palette, error) {
p := new(Palette)
if err := binary.Read(r, binary.LittleEndian, p); err != nil {
return nil, err
}
return p, nil
}