mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-14 15:07:26 +01:00
212 lines
7.7 KiB
Go
212 lines
7.7 KiB
Go
// Code generated by go-bindata.
|
|
// sources:
|
|
// arcadefont.png
|
|
// DO NOT EDIT!
|
|
|
|
// +build example
|
|
|
|
package assets
|
|
|
|
import (
|
|
"fmt"
|
|
"io/ioutil"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
type asset struct {
|
|
bytes []byte
|
|
info os.FileInfo
|
|
}
|
|
|
|
type bindataFileInfo struct {
|
|
name string
|
|
size int64
|
|
mode os.FileMode
|
|
modTime time.Time
|
|
}
|
|
|
|
func (fi bindataFileInfo) Name() string {
|
|
return fi.name
|
|
}
|
|
func (fi bindataFileInfo) Size() int64 {
|
|
return fi.size
|
|
}
|
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
|
return fi.mode
|
|
}
|
|
func (fi bindataFileInfo) ModTime() time.Time {
|
|
return fi.modTime
|
|
}
|
|
func (fi bindataFileInfo) IsDir() bool {
|
|
return false
|
|
}
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
|
return nil
|
|
}
|
|
|
|
var _arcadefontPng = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x80\x00\x00\x000\b\x03\x00\x00\x00\xee*\x82\x8c\x00\x00\x00\x06PLTE\x00\x00\x00\xff\xff\xff\xa5\u065f\xdd\x00\x00\x00\x01tRNS\x00@\xe6\xd8f\x00\x00\x03\x98IDATx\x9c\xc4X\x89\x96\xac(\f\xe5\xd6\xf3\xff\u007f9\xd3B\x96\x9b\x18\u0469\xe99/\u0765\x82\x81\xec\v~F\x00\xa0\xd7\xf5\x10\xf3t=\xdf#\xe1\xdbCY\xf4\x0e0>\xbb\x97F\xf9\xdc{\x8e\xe6\xbf\b*\xa2\xfc\\%X,\xf7\r\ti\x18\x90\xf9\xbf(bm#sNN|\xdeW\x98\xbes\x80W\xa4\x8d~B];\xc1\t\x89\x13\x14\u01e7\xa1\x8e\x9d\x01{P\x04\x10\x8f\xa3\x19\xfbz\x9a@\x1e\x99\xb5\xf5\x0e\xffG\xc2,>\x01\xb2]\xb7o\xe6(\x99@\x12G2\xff\xd6r\u04cc\x8b!\t\xd1\xe8\x89\tYE\xeb\x04\xbd\xc8\u007f\xef\xc7H\x174a\xf2\x10\x05\xd5i\xff\x85\x9b\xfc\nli\x81\x9d,9\xcfZ\xa63\x92\x87\x11s\xa2\xc3\xce\u0248\x884\x83\xb5\xf0\u03f4m(y\xbd\a*G\x8d\xaf\x8b\xe5\x05\xba[*\x1b\xe9^\x9c?6\xfcy<&\x1f8=B\xc02\x12}\x01q\x1cQOq\xbb\x85\x88N\xf5\xd0I\xcd\xe5Q\t$cJ\"\xc8\u0487)HA\xc1u\xe3\xda\xd79\x90\u034ff\xc1\xf0x\x82\xe5*\x962\xe6]A\xb0\x90\xbd\xec\xef\x02\x93\x8f\xa4\xf7\x87\xaa\x9f\xe9',SM#Hp\xd4\x1b\xdb^'\x95\x13\x96\xf1\x85\xa4\xc2\xe4\xdd\xccj\x8a\x8eb1\x9b/\xf4!\rc1\xd8\xc8\xf4;\xf0*\u05c0\x95~\t\u007fR\x84i\xc65\xa4o\u0709\xd9\t\x91\xe69l\v\xfe\xe9\x84\u04df\xf4\xa5\x19\vP\xf7_\xfe\x91\x8d\xd8\xe9u\x8c\xceM\xf2\x04,\x9c\x89!\xc8g\xe6!wd\xe4\u0152*\xfdf\xf3\x16*J\u06e8\x1c\xc1\x19\xe3u\x9b\xe7\xfc\xa03ro\xea{\x16\x91\x198\u0167\xfc\xe7q^\xa1\x98`P\xee\xbc+\xa3\xb9\xbe\xab\xa4Y\xde\xcf\xe9\x15K\xd3\"\x97*\x0f\xdc\xca\u0499e\xe2r\u01c6\a\t\u01a9\x01A\xed\x94\x16\x8e\x00T\f\u01e5\xdcI\xd3;\u03ce5R)\xa9\xb6\xe8\u0096\xff\u03c9\xe0\r\x1c\x1e\x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00\xff\xff\"\xd9\xed\u04b0\xcb\xea\x95\x00\x00\x00\x00IEND\xaeB`\x82")
|
|
|
|
func arcadefontPngBytes() ([]byte, error) {
|
|
return _arcadefontPng, nil
|
|
}
|
|
|
|
func arcadefontPng() (*asset, error) {
|
|
bytes, err := arcadefontPngBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "arcadefont.png", size: 1008, mode: os.FileMode(420), modTime: time.Unix(1463226773, 0)}
|
|
a := &asset{bytes: bytes, info: info}
|
|
return a, nil
|
|
}
|
|
|
|
// Asset loads and returns the asset for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func Asset(name string) ([]byte, error) {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
|
}
|
|
return a.bytes, nil
|
|
}
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
|
|
// MustAsset is like Asset but panics when Asset would return an error.
|
|
// It simplifies safe initialization of global variables.
|
|
func MustAsset(name string) []byte {
|
|
a, err := Asset(name)
|
|
if err != nil {
|
|
panic("asset: Asset(" + name + "): " + err.Error())
|
|
}
|
|
|
|
return a
|
|
}
|
|
|
|
// AssetInfo loads and returns the asset info for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func AssetInfo(name string) (os.FileInfo, error) {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
|
}
|
|
return a.info, nil
|
|
}
|
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
|
}
|
|
|
|
// AssetNames returns the names of the assets.
|
|
func AssetNames() []string {
|
|
names := make([]string, 0, len(_bindata))
|
|
for name := range _bindata {
|
|
names = append(names, name)
|
|
}
|
|
return names
|
|
}
|
|
|
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
|
var _bindata = map[string]func() (*asset, error){
|
|
"arcadefont.png": arcadefontPng,
|
|
}
|
|
|
|
// AssetDir returns the file names below a certain
|
|
// directory embedded in the file by go-bindata.
|
|
// For example if you run go-bindata on data/... and data contains the
|
|
// following hierarchy:
|
|
// data/
|
|
// foo.txt
|
|
// img/
|
|
// a.png
|
|
// b.png
|
|
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
|
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
|
// AssetDir("") will return []string{"data"}.
|
|
func AssetDir(name string) ([]string, error) {
|
|
node := _bintree
|
|
if len(name) != 0 {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
pathList := strings.Split(cannonicalName, "/")
|
|
for _, p := range pathList {
|
|
node = node.Children[p]
|
|
if node == nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
}
|
|
}
|
|
if node.Func != nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
rv := make([]string, 0, len(node.Children))
|
|
for childName := range node.Children {
|
|
rv = append(rv, childName)
|
|
}
|
|
return rv, nil
|
|
}
|
|
|
|
type bintree struct {
|
|
Func func() (*asset, error)
|
|
Children map[string]*bintree
|
|
}
|
|
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
|
"arcadefont.png": {arcadefontPng, map[string]*bintree{}},
|
|
}}
|
|
|
|
// RestoreAsset restores an asset under the given directory
|
|
func RestoreAsset(dir, name string) error {
|
|
data, err := Asset(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
info, err := AssetInfo(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// RestoreAssets restores an asset under the given directory recursively
|
|
func RestoreAssets(dir, name string) error {
|
|
children, err := AssetDir(name)
|
|
// File
|
|
if err != nil {
|
|
return RestoreAsset(dir, name)
|
|
}
|
|
// Dir
|
|
for _, child := range children {
|
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _filePath(dir, name string) string {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
|
}
|