Unlocked map update frame rate (#632)

* Started work on shadows

* Removed fps limiter

* Fixed build info bug
This commit is contained in:
Tim Sarbin 2020-07-27 15:00:50 -04:00 committed by GitHub
parent 0018044c83
commit b13c581beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -88,11 +88,16 @@ func Create(gitBranch, gitCommit string,
tAllocSamples: createZeroedRing(nSamplesTAlloc),
}
if result.gitBranch == "" {
result.gitBranch = "Local Build"
}
return result
}
// Run executes the application and kicks off the entire game process
func (a *App) Run() error {
profileOption := kingpin.Flag("profile", "Profiles the program, one of (cpu, mem, block, goroutine, trace, thread, mutex)").String()
kingpin.Parse()
@ -115,10 +120,6 @@ func (a *App) Run() error {
a.ToMainMenu()
if a.gitBranch == "" {
a.gitBranch = "Local Build"
}
if err := a.renderer.Run(a.update, 800, 600, windowTitle); err != nil {
return err
}
@ -415,12 +416,10 @@ func (a *App) render(target d2interface.Surface) error {
func (a *App) advance(elapsed, current float64) error {
elapsedLastScreenAdvance := (current - a.lastScreenAdvance) * a.timeScale
if elapsedLastScreenAdvance > defaultFPS {
a.lastScreenAdvance = current
a.lastScreenAdvance = current
if err := d2screen.Advance(elapsedLastScreenAdvance); err != nil {
return err
}
if err := d2screen.Advance(elapsedLastScreenAdvance); err != nil {
return err
}
d2ui.Advance(elapsed)

View File

@ -135,6 +135,7 @@ func CreateMainMenu(
inputManager: inputManager,
audioProvider: audioProvider,
navigator: navigator,
buildInfo: buildInfo,
}
}