Source the palette name from data
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -12,7 +13,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"code.ur.gs/lupine/ordoor/internal/data/rle"
|
||||
"code.ur.gs/lupine/ordoor/internal/palettes"
|
||||
)
|
||||
|
||||
type SpriteHeader struct {
|
||||
@@ -53,12 +53,12 @@ type Sprite struct {
|
||||
Data []byte
|
||||
}
|
||||
|
||||
func (s *Sprite) ToImage() *image.Paletted {
|
||||
func (s *Sprite) ToImage(palette color.Palette) *image.Paletted {
|
||||
return &image.Paletted{
|
||||
Pix: s.Data,
|
||||
Stride: int(s.Width),
|
||||
Rect: image.Rect(0, 0, int(s.Width), int(s.Height)),
|
||||
Palette: palettes.DefaultPalette(),
|
||||
Palette: palette,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user