docs: Update

This commit is contained in:
Hajime Hoshi 2018-01-06 02:59:32 +09:00
parent 407cc6a0e2
commit a76d564147
18 changed files with 13 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

View File

@ -78,7 +78,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
ebitenImage, _, err = ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest)
ebitenImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "ebiten.png"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -118,11 +118,11 @@ func playerBarRect() (x, y, w, h int) {
func NewPlayer(audioContext *audio.Context) (*Player, error) {
const bytesPerSample = 4 // TODO: This should be defined in audio package
wavF, err := ebitenutil.OpenFile("_resources/audio/jab.wav")
wavF, err := ebitenutil.OpenFile(ebitenutil.JoinStringsIntoFilePath("_resources", "audio", "jab.wav"))
if err != nil {
return nil, err
}
mp3F, err := ebitenutil.OpenFile("_resources/audio/classic.mp3")
mp3F, err := ebitenutil.OpenFile(ebitenutil.JoinStringsIntoFilePath("_resources", "audio", "classic.mp3"))
if err != nil {
return nil, err
}
@ -184,9 +184,6 @@ func (p *Player) update() error {
b := ebiten.IsRunnableInBackground()
ebiten.SetRunnableInBackground(!b)
}
if err := p.audioContext.Update(); err != nil {
return err
}
return nil
}

View File

@ -131,7 +131,7 @@ Inverted: %s [I]`, hue, saturation, value, msgInverted)
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -65,7 +65,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -116,7 +116,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
bgImage, _, err = ebitenutil.NewImageFromFile("_resources/images/tile.png", ebiten.FilterNearest)
bgImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "tile.png"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -49,7 +49,7 @@ var keyboardImage *ebiten.Image
func init() {
var err error
keyboardImage, _, err = ebitenutil.NewImageFromFile("_resources/images/keyboard/keyboard.png", ebiten.FilterNearest)
keyboardImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "keyboard", "keyboard.png"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -115,11 +115,11 @@ func min(a, b int) int {
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}
fiveyearsImage, _, err = ebitenutil.NewImageFromFile("_resources/images/fiveyears.jpg", ebiten.FilterNearest)
fiveyearsImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "fiveyears.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -66,7 +66,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -73,7 +73,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -198,9 +198,6 @@ func update(screen *ebiten.Image) error {
}
addNote(220*math.Exp2(float64(i-1)/12.0), 1.0)
}
if err := audioContext.Update(); err != nil {
return err
}
if ebiten.IsRunningSlowly() {
return nil
}

View File

@ -66,7 +66,7 @@ func update(screen *ebiten.Image) error {
func main() {
var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}

View File

@ -141,7 +141,7 @@ Press <- or -> to change the number of sprites`, ebiten.CurrentFPS(), spri
func main() {
var err error
img, _, err := ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest)
img, _, err := ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "ebiten.png"), ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}