mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48: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"
|
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 .
|
//go:generate gofmt -w .
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -38,5 +38,8 @@ func TextImage() (image.Image, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
img, _, err := image.Decode(bytes.NewBuffer(b))
|
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