1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-09-06 11:34:15 -04:00
OpenDiablo2/main.go

44 lines
1.1 KiB
Go
Raw Normal View History

2019-10-24 09:31:59 -04:00
package main
import (
"log"
"github.com/OpenDiablo2/OpenDiablo2/d2app"
2019-10-24 09:31:59 -04:00
ebiten_input "github.com/OpenDiablo2/OpenDiablo2/d2core/d2input/ebiten"
2020-06-28 19:31:10 -04:00
ebiten2 "github.com/OpenDiablo2/OpenDiablo2/d2core/d2audio/ebiten"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2input"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2term"
2019-10-24 09:31:59 -04:00
)
2019-11-06 22:12:15 -05:00
// GitBranch is set by the CI build process to the name of the branch
//nolint:gochecknoglobals This is filled in by the build system
var GitBranch string
2019-11-06 22:12:15 -05:00
// GitCommit is set by the CI build process to the commit hash
//nolint:gochecknoglobals This is filled in by the build system
var GitCommit string
2019-10-24 09:31:59 -04:00
func main() {
log.SetFlags(log.Lshortfile)
log.Println("OpenDiablo2 - Open source Diablo 2 engine")
2020-06-28 19:31:10 -04:00
// Initialize our providers
audio, err := ebiten2.CreateAudio()
2020-06-28 19:31:10 -04:00
if err != nil {
panic(err)
}
2020-06-28 21:40:52 -04:00
d2input.Initialize(ebiten_input.InputService{}) // TODO d2input singleton must be init before d2term
term, err := d2term.Initialize()
2020-02-08 21:02:37 -05:00
if err != nil {
log.Fatal(err)
}
app := d2app.Create(GitBranch, GitCommit, term, audio)
app.Run()
}