add palette dat loader
This commit is contained in:
parent
83181a3dde
commit
f615c9bb5f
21
formats/dat/dat.go
Normal file
21
formats/dat/dat.go
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user