mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-29 22:56:07 -04:00
Unlocked map update frame rate (#632)
* Started work on shadows * Removed fps limiter * Fixed build info bug
This commit is contained in:
parent
0018044c83
commit
b13c581beb
17
d2app/app.go
17
d2app/app.go
@ -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)
|
||||
|
@ -135,6 +135,7 @@ func CreateMainMenu(
|
||||
inputManager: inputManager,
|
||||
audioProvider: audioProvider,
|
||||
navigator: navigator,
|
||||
buildInfo: buildInfo,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user