ebiten/internal/gamepaddb/gamepaddb_tmpl.tpl
Kenny Goodin ca8ee8e23b internal/gamepaddb: generate respective controller dbs for each platform
Replace singular embedded controller database file with separate generated
files for each supported platform. The controller database file is some
~500KB, so this change should reduce the overall binary size per
platform.
2024-03-26 12:07:23 -04:00

23 lines
571 B
Smarty

{{.License}}
{{.DoNotEdit}}
{{.BuildTag}}
package gamepaddb
func init() {
if err := Update(controllerBytes); err != nil {
panic(err)
}
{{if eq .SDLPlatform "Windows" }}
if err := Update(glfwControllerBytes); err != nil {
panic(err)
}
{{end}}}
var controllerBytes = []byte{ {{ range $index, $element := .ControllerBytes }}{{ if $index }},{{ end }}{{ $element }}{{ end }} }
{{if eq .SDLPlatform "Windows" }}
var glfwControllerBytes = []byte{ {{ range $index, $element := .GLFWGamePads }}{{ if $index }},{{ end }}{{ $element }}{{ end }} }
{{end}}