mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/clock: rename CurrentFPS/TPS -> ActualFPS/TPS
This commit is contained in:
parent
f25dda1318
commit
2fc691f661
@ -27,8 +27,8 @@ var (
|
||||
// lastSystemTime indicates the logical time in the game, so this can be bigger than the curren time.
|
||||
lastSystemTime int64
|
||||
|
||||
currentFPS float64
|
||||
currentTPS float64
|
||||
actualFPS float64
|
||||
actualTPS float64
|
||||
prevTPS int64
|
||||
lastUpdated int64
|
||||
fpsCount = 0
|
||||
@ -44,16 +44,16 @@ func init() {
|
||||
lastUpdated = n
|
||||
}
|
||||
|
||||
func CurrentFPS() float64 {
|
||||
func ActualFPS() float64 {
|
||||
m.Lock()
|
||||
v := currentFPS
|
||||
v := actualFPS
|
||||
m.Unlock()
|
||||
return v
|
||||
}
|
||||
|
||||
func CurrentTPS() float64 {
|
||||
func ActualTPS() float64 {
|
||||
m.Lock()
|
||||
v := currentTPS
|
||||
v := actualTPS
|
||||
m.Unlock()
|
||||
return v
|
||||
}
|
||||
@ -120,8 +120,8 @@ func updateFPSAndTPS(now int64, count int) {
|
||||
if time.Second > time.Duration(now-lastUpdated) {
|
||||
return
|
||||
}
|
||||
currentFPS = float64(fpsCount) * float64(time.Second) / float64(now-lastUpdated)
|
||||
currentTPS = float64(tpsCount) * float64(time.Second) / float64(now-lastUpdated)
|
||||
actualFPS = float64(fpsCount) * float64(time.Second) / float64(now-lastUpdated)
|
||||
actualTPS = float64(tpsCount) * float64(time.Second) / float64(now-lastUpdated)
|
||||
lastUpdated = now
|
||||
fpsCount = 0
|
||||
tpsCount = 0
|
||||
|
4
run.go
4
run.go
@ -88,7 +88,7 @@ const DefaultTPS = ui.DefaultTPS
|
||||
//
|
||||
// CurrentFPS is concurrent-safe.
|
||||
func CurrentFPS() float64 {
|
||||
return clock.CurrentFPS()
|
||||
return clock.ActualFPS()
|
||||
}
|
||||
|
||||
var (
|
||||
@ -426,7 +426,7 @@ func MaxTPS() int {
|
||||
//
|
||||
// CurrentTPS is concurrent-safe.
|
||||
func CurrentTPS() float64 {
|
||||
return clock.CurrentTPS()
|
||||
return clock.ActualTPS()
|
||||
}
|
||||
|
||||
// SyncWithFPS is a special TPS value that means TPS syncs with FPS.
|
||||
|
Loading…
Reference in New Issue
Block a user