remove the dependency on file2byteslice

Specify the version explicitly instead.
This commit is contained in:
Hajime Hoshi 2022-08-23 16:25:15 +09:00
parent de20b855b9
commit b858f36d54
11 changed files with 54 additions and 80 deletions

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=vorbis_test -input=./test_mono.ogg -output=./testmonoogg_test.go -var=test_mono_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=vorbis_test -input=./test_tooshort.ogg -output=./testtooshortogg_test.go -var=test_tooshort_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=vorbis_test -input=./test_mono.ogg -output=./testmonoogg_test.go -var=test_mono_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=vorbis_test -input=./test_tooshort.ogg -output=./testtooshortogg_test.go -var=test_tooshort_ogg
//go:generate gofmt -s -w .
package vorbis

View File

@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=gobind.go -output=gobind.src.go -var gobindsrc
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=gobind.go -output=gobind.src.go -var gobindsrc
package main

View File

@ -13,7 +13,7 @@
// limitations under the License.
//go:generate go run gen.go
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -input text.png -output text.png.go -package ebitenutil -var textPng
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -input text.png -output text.png.go -package ebitenutil -var textPng
package ebitenutil

View File

@ -26,10 +26,10 @@ import (
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"text/template"
"github.com/hajimehoshi/file2byteslice"
"golang.org/x/image/font"
"golang.org/x/image/font/opentype"
@ -247,15 +247,16 @@ func outputKeyboardImage() (map[ebiten.Key]image.Rectangle, error) {
return nil, err
}
out, err := os.Create("../../resources/images/keyboard/keyboard.go")
if err != nil {
cmd := exec.Command("go", "run", "github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0",
"-output", "../../resources/images/keyboard/keyboard.go",
"-package", "keyboard",
"-var", "Keyboard_png")
cmd.Stdin = &buf
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return nil, err
}
defer out.Close()
if err := file2byteslice.Write(out, &buf, false, "", "keyboard", "Keyboard_png"); err != nil {
return nil, err
}
return keyMap, nil
}

View File

@ -12,39 +12,39 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./audio/jab.wav -output=./audio/jab.go -var=Jab_wav
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./audio/jump.ogg -output=./audio/jump.go -var=Jump_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./audio/ragtime.mp3 -output=./audio/ragtime.mp3.go -var=Ragtime_mp3
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./audio/ragtime.ogg -output=./audio/ragtime.ogg.go -var=Ragtime_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=fonts -input=./fonts/mplus-1p-regular.ttf -output=./fonts/mplus1pregular.go -var=MPlus1pRegular_ttf
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=fonts -input=./fonts/pressstart2p.ttf -output=./fonts/pressstart2p.go -var=PressStart2P_ttf
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/ebiten.png -output=./images/ebiten.go -var=Ebiten_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/fiveyears.jpg -output=./images/fiveyears.go -var=FiveYears_jpg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/gophers.jpg -output=./images/gophers.go -var=Gophers_jpg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/runner.png -output=./images/runner.go -var=Runner_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/smoke.png -output=./images/smoke.go -var=Smoke_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/spritesheet.png -output=./images/spritesheet.go -var=Spritesheet_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/tile.png -output=./images/tile.go -var=Tile_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/tiles.png -output=./images/tiles.go -var=Tiles_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=images -input=./images/ui.png -output=./images/ui.go -var=UI_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./images/audio/alert.png -output=./images/audio/alert.go -var=Alert_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./images/audio/pause.png -output=./images/audio/pause.go -var=Pause_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=audio -input=./images/audio/play.png -output=./images/audio/play.go -var=Play_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=blocks -input=./images/blocks/background.png -output=./images/blocks/background.go -var=Background_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=blocks -input=./images/blocks/blocks.png -output=./images/blocks/blocks.go -var=Blocks_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=flappy -input=./images/flappy/gopher.png -output=./images/flappy/gopher.go -var=Gopher_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=flappy -input=./images/flappy/tiles.png -output=./images/flappy/tiles.go -var=Tiles_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=mascot -input=./images/mascot/out01.png -output=./images/mascot/out01.go -var=Out01_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=mascot -input=./images/mascot/out02.png -output=./images/mascot/out02.go -var=Out02_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=mascot -input=./images/mascot/out03.png -output=./images/mascot/out03.go -var=Out03_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=shader -input=./images/shader/gopher.png -output=./images/shader/gopher.go -var=Gopher_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=shader -input=./images/shader/gopherbg.png -output=./images/shader/gopherbg.go -var=GopherBg_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=shader -input=./images/shader/normal.png -output=./images/shader/normal.go -var=Normal_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=shader -input=./images/shader/noise.png -output=./images/shader/noise.go -var=Noise_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=platformer -input=./images/platformer/background.png -output=./images/platformer/background.go -var=Background_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=platformer -input=./images/platformer/left.png -output=./images/platformer/left.go -var=Left_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=platformer -input=./images/platformer/mainchar.png -output=./images/platformer/mainchar.go -var=MainChar_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=platformer -input=./images/platformer/right.png -output=./images/platformer/right.go -var=Right_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./audio/jab.wav -output=./audio/jab.go -var=Jab_wav
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./audio/jump.ogg -output=./audio/jump.go -var=Jump_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./audio/ragtime.mp3 -output=./audio/ragtime.mp3.go -var=Ragtime_mp3
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./audio/ragtime.ogg -output=./audio/ragtime.ogg.go -var=Ragtime_ogg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=fonts -input=./fonts/mplus-1p-regular.ttf -output=./fonts/mplus1pregular.go -var=MPlus1pRegular_ttf
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=fonts -input=./fonts/pressstart2p.ttf -output=./fonts/pressstart2p.go -var=PressStart2P_ttf
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/ebiten.png -output=./images/ebiten.go -var=Ebiten_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/fiveyears.jpg -output=./images/fiveyears.go -var=FiveYears_jpg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/gophers.jpg -output=./images/gophers.go -var=Gophers_jpg
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/runner.png -output=./images/runner.go -var=Runner_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/smoke.png -output=./images/smoke.go -var=Smoke_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/spritesheet.png -output=./images/spritesheet.go -var=Spritesheet_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/tile.png -output=./images/tile.go -var=Tile_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/tiles.png -output=./images/tiles.go -var=Tiles_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=images -input=./images/ui.png -output=./images/ui.go -var=UI_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./images/audio/alert.png -output=./images/audio/alert.go -var=Alert_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./images/audio/pause.png -output=./images/audio/pause.go -var=Pause_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=audio -input=./images/audio/play.png -output=./images/audio/play.go -var=Play_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=blocks -input=./images/blocks/background.png -output=./images/blocks/background.go -var=Background_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=blocks -input=./images/blocks/blocks.png -output=./images/blocks/blocks.go -var=Blocks_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=flappy -input=./images/flappy/gopher.png -output=./images/flappy/gopher.go -var=Gopher_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=flappy -input=./images/flappy/tiles.png -output=./images/flappy/tiles.go -var=Tiles_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=mascot -input=./images/mascot/out01.png -output=./images/mascot/out01.go -var=Out01_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=mascot -input=./images/mascot/out02.png -output=./images/mascot/out02.go -var=Out02_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=mascot -input=./images/mascot/out03.png -output=./images/mascot/out03.go -var=Out03_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=shader -input=./images/shader/gopher.png -output=./images/shader/gopher.go -var=Gopher_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=shader -input=./images/shader/gopherbg.png -output=./images/shader/gopherbg.go -var=GopherBg_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=shader -input=./images/shader/normal.png -output=./images/shader/normal.go -var=Normal_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=shader -input=./images/shader/noise.png -output=./images/shader/noise.go -var=Noise_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=platformer -input=./images/platformer/background.png -output=./images/platformer/background.go -var=Background_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=platformer -input=./images/platformer/left.png -output=./images/platformer/left.go -var=Left_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=platformer -input=./images/platformer/mainchar.png -output=./images/platformer/mainchar.go -var=MainChar_png
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=platformer -input=./images/platformer/right.png -output=./images/platformer/right.go -var=Right_png
//go:generate gofmt -s -w .
package resources

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -17,11 +17,11 @@
package main
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=default.go -output=default_go.go -var=default_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=texel.go -output=texel_go.go -var=texel_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=lighting.go -output=lighting_go.go -var=lighting_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=radialblur.go -output=radialblur_go.go -var=radialblur_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=chromaticaberration.go -output=chromaticaberration_go.go -var=chromaticaberration_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=dissolve.go -output=dissolve_go.go -var=dissolve_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=water.go -output=water_go.go -var=water_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=crt.go -output=crt_go.go -var=crt_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=default.go -output=default_go.go -var=default_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=texel.go -output=texel_go.go -var=texel_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=lighting.go -output=lighting_go.go -var=lighting_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=radialblur.go -output=radialblur_go.go -var=radialblur_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=chromaticaberration.go -output=chromaticaberration_go.go -var=chromaticaberration_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=dissolve.go -output=dissolve_go.go -var=dissolve_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=water.go -output=water_go.go -var=water_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=crt.go -output=crt_go.go -var=crt_go -buildtags=example

1
go.mod
View File

@ -6,7 +6,6 @@ require (
github.com/ebitengine/purego v0.0.0-20220820193322-ffec45151ddb
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad
github.com/hajimehoshi/bitmapfont/v2 v2.2.1
github.com/hajimehoshi/file2byteslice v0.0.0-20210813153925-5340248a8f41
github.com/hajimehoshi/go-mp3 v0.3.3
github.com/hajimehoshi/oto/v2 v2.4.0-alpha.0.20220820194526-65562ecb133c
github.com/jakecoffman/cp v1.2.1

2
go.sum
View File

@ -5,8 +5,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad h1:kX51IjbsJP
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/hajimehoshi/bitmapfont/v2 v2.2.1 h1:y7zcy02/UgO24IL3COqYtrRZzhRucNBtmCo/SNU648k=
github.com/hajimehoshi/bitmapfont/v2 v2.2.1/go.mod h1:wjrYAy8vKgj9JsFgnYAOK346/uvE22TlmqouzdnYIs0=
github.com/hajimehoshi/file2byteslice v0.0.0-20210813153925-5340248a8f41 h1:s01qIIRG7vN/5ndLwkDktjx44ulFk6apvAjVBYR50Yo=
github.com/hajimehoshi/file2byteslice v0.0.0-20210813153925-5340248a8f41/go.mod h1:CqqAHp7Dk/AqQiwuhV1yT2334qbA/tFWQW0MD2dGqUE=
github.com/hajimehoshi/go-mp3 v0.3.3 h1:cWnfRdpye2m9ElSoVqneYRcpt/l3ijttgjMeQh+r+FE=
github.com/hajimehoshi/go-mp3 v0.3.3/go.mod h1:qMJj/CSDxx6CGHiZeCgbiq2DSUkbK0UbtXShQcnfyMM=
github.com/hajimehoshi/oto v0.6.1 h1:7cJz/zRQV4aJvMSSRqzN2TImoVVMpE0BCY4nrNJaDOM=

View File

@ -18,7 +18,7 @@
//
// curl --location --remote-name https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package gamepaddb -input=./gamecontrollerdb.txt -output=./gamecontrollerdb.txt.go -var=gamecontrollerdbTxt
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package gamepaddb -input=./gamecontrollerdb.txt -output=./gamecontrollerdb.txt.go -var=gamecontrollerdbTxt
package gamepaddb

View File

@ -1,24 +0,0 @@
// Copyright 2022 The Ebitengine Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build tools
// +build tools
// This file is to force adding dependencies to go.mod.
package ebiten
import (
_ "github.com/hajimehoshi/file2byteslice"
)