mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Change the way to generate assets not to use unsafe; Unsafe doesn't work in GopherJS at least
This commit is contained in:
parent
b769e0eb6c
commit
b85bae38e9
@ -22,7 +22,7 @@ import (
|
||||
|
||||
const FileNameText = "text.png"
|
||||
|
||||
//go:generate go-bindata -nocompress -pkg=assets -nomemcopy text.png
|
||||
//go:generate go-bindata -nocompress -pkg=assets text.png
|
||||
//go:generate gofmt -w .
|
||||
|
||||
const (
|
||||
@ -38,5 +38,8 @@ func TextImage() (image.Image, error) {
|
||||
return nil, err
|
||||
}
|
||||
img, _, err := image.Decode(bytes.NewBuffer(b))
|
||||
return img, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return img, nil
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user