// Code generated by "esc -o bindata.go -pkg gfx -include .*(frag|ply|vert) -modtime 1337 -private data"; DO NOT EDIT.

package gfx

import (
	"bytes"
	"compress/gzip"
	"encoding/base64"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path"
	"sync"
	"time"
)

type _escLocalFS struct{}

var _escLocal _escLocalFS

type _escStaticFS struct{}

var _escStatic _escStaticFS

type _escDirectory struct {
	fs   http.FileSystem
	name string
}

type _escFile struct {
	compressed string
	size       int64
	modtime    int64
	local      string
	isDir      bool

	once sync.Once
	data []byte
	name string
}

func (_escLocalFS) Open(name string) (http.File, error) {
	f, present := _escData[path.Clean(name)]
	if !present {
		return nil, os.ErrNotExist
	}
	return os.Open(f.local)
}

func (_escStaticFS) prepare(name string) (*_escFile, error) {
	f, present := _escData[path.Clean(name)]
	if !present {
		return nil, os.ErrNotExist
	}
	var err error
	f.once.Do(func() {
		f.name = path.Base(name)
		if f.size == 0 {
			return
		}
		var gr *gzip.Reader
		b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed))
		gr, err = gzip.NewReader(b64)
		if err != nil {
			return
		}
		f.data, err = ioutil.ReadAll(gr)
	})
	if err != nil {
		return nil, err
	}
	return f, nil
}

func (fs _escStaticFS) Open(name string) (http.File, error) {
	f, err := fs.prepare(name)
	if err != nil {
		return nil, err
	}
	return f.File()
}

func (dir _escDirectory) Open(name string) (http.File, error) {
	return dir.fs.Open(dir.name + name)
}

func (f *_escFile) File() (http.File, error) {
	type httpFile struct {
		*bytes.Reader
		*_escFile
	}
	return &httpFile{
		Reader:   bytes.NewReader(f.data),
		_escFile: f,
	}, nil
}

func (f *_escFile) Close() error {
	return nil
}

func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) {
	if !f.isDir {
		return nil, fmt.Errorf(" escFile.Readdir: '%s' is not directory", f.name)
	}

	fis, ok := _escDirs[f.local]
	if !ok {
		return nil, fmt.Errorf(" escFile.Readdir: '%s' is directory, but we have no info about content of this dir, local=%s", f.name, f.local)
	}
	limit := count
	if count <= 0 || limit > len(fis) {
		limit = len(fis)
	}

	if len(fis) == 0 && count > 0 {
		return nil, io.EOF
	}

	return fis[0:limit], nil
}

func (f *_escFile) Stat() (os.FileInfo, error) {
	return f, nil
}

func (f *_escFile) Name() string {
	return f.name
}

func (f *_escFile) Size() int64 {
	return f.size
}

func (f *_escFile) Mode() os.FileMode {
	return 0
}

func (f *_escFile) ModTime() time.Time {
	return time.Unix(f.modtime, 0)
}

func (f *_escFile) IsDir() bool {
	return f.isDir
}

func (f *_escFile) Sys() interface{} {
	return f
}

// _escFS returns a http.Filesystem for the embedded assets. If useLocal is true,
// the filesystem's contents are instead used.
func _escFS(useLocal bool) http.FileSystem {
	if useLocal {
		return _escLocal
	}
	return _escStatic
}

// _escDir returns a http.Filesystem for the embedded assets on a given prefix dir.
// If useLocal is true, the filesystem's contents are instead used.
func _escDir(useLocal bool, name string) http.FileSystem {
	if useLocal {
		return _escDirectory{fs: _escLocal, name: name}
	}
	return _escDirectory{fs: _escStatic, name: name}
}

// _escFSByte returns the named file from the embedded assets. If useLocal is
// true, the filesystem's contents are instead used.
func _escFSByte(useLocal bool, name string) ([]byte, error) {
	if useLocal {
		f, err := _escLocal.Open(name)
		if err != nil {
			return nil, err
		}
		b, err := ioutil.ReadAll(f)
		_ = f.Close()
		return b, err
	}
	f, err := _escStatic.prepare(name)
	if err != nil {
		return nil, err
	}
	return f.data, nil
}

// _escFSMustByte is the same as _escFSByte, but panics if name is not present.
func _escFSMustByte(useLocal bool, name string) []byte {
	b, err := _escFSByte(useLocal, name)
	if err != nil {
		panic(err)
	}
	return b
}

// _escFSString is the string version of _escFSByte.
func _escFSString(useLocal bool, name string) (string, error) {
	b, err := _escFSByte(useLocal, name)
	return string(b), err
}

// _escFSMustString is the string version of _escFSMustByte.
func _escFSMustString(useLocal bool, name string) string {
	return string(_escFSMustByte(useLocal, name))
}

var _escData = map[string]*_escFile{

	"/data/shader.frag": {
		name:    "shader.frag",
		local:   "data/shader.frag",
		size:    675,
		modtime: 1337,
		compressed: `
H4sIAAAAAAAC/3yR0WvCMBDGn3N/xYEv7RBxRbex4sNQt5eJIA72JjFNNSzmJE3dxvB/HzXadrP0Lcn9
vu+73HUO0maKDA6GfRRkJUAnkakyEp8XTy+r8fx1vljN5pMp9v9WltP35dti6mu317W6NALQ/JtyF2gS
3BV5IxyGmBuVkt2hMg5TyzczSmTcgN5VaMZ3ey1tNEEnv1xuG/n7ij9IMTihY9Jkm+CHCk41cYdc77c8
BlDGq4VX+mtUmI2JbBIDUO48UjR/DoADqQR3XJmgOIX4Ayz7VE5sMbj88fQoeHY15EdgrPTC0SWasbWV
/COGuqq+gP+682yiSXA+dcu2wxa7lk6KbwblHHt2s+62pvRsPYgdAa7tygdvV1053vgthDEcfwMAAP//
CQD5EqMCAAA=
`,
	},

	"/data/shader.vert": {
		name:    "shader.vert",
		local:   "data/shader.vert",
		size:    401,
		modtime: 1337,
		compressed: `
H4sIAAAAAAAC/2yQTU/EIBCGz+VXvImX7Z7WiqdNT3s28WC8GkLRjAGmobTWGP+7oR+hMdxg5nmYd7ib
TBiIPeTjBZqDEcKqbx7jybJWMXVaXGqMnt45ODgVJfrAn0an5iuZrycVA83Xgnf/z3PcGbvjBb6pQR6T
0RI9D5SqpWcfMkb+xpZDiZI71YD8i5lvzKG7CsFjXF29mtu9QczMxNTBKfKndKrxI6oP+/a8ZUJb/AGc
jwvifNihWmahzXmrfdpSzPF+/wIAAP//bRPYZJEBAAA=
`,
	},

	"/data/textplane.ply": {
		name:    "textplane.ply",
		local:   "data/textplane.ply",
		size:    641,
		modtime: 1337,
		compressed: `
H4sIAAAAAAAC/5yPUUvEMBCE3/Mr5u0UvJL0BK2P+kOONN16gTQpyda2/nqhd9SzURTzkuHbnWG2d7No
Q+w0QydjLVQhhQldR57xEkkzNahnPDvyDUWUxcMjbtJQQ95ij3Eci/o8KkJ8vUMKQzSE1jp6wo5p4t5p
T+elnSBHS/IbRaYJ96KPoafIM1oXNGPagnkL3rfAZx6fmXzmSlvAa7dWG0L5OXc2MQZz0hGDXbsfrW+s
oSTIN8cT6YaikIVcHnKxz5H6QtSVEOr7nd+DqqqqroTYy/8mrZUuSern2/7W6HLaARIK5fIfoMRHAAAA
//+RWX8WgQIAAA==
`,
	},

	"/data": {
		name:  "data",
		local: `data`,
		isDir: true,
	},
}

var _escDirs = map[string][]os.FileInfo{

	"data": {
		_escData["/data/shader.frag"],
		_escData["/data/shader.vert"],
		_escData["/data/textplane.ply"],
	},
}
