From 1626e408228e604f8716de3deb677ce24bc6451f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 17 Jul 2018 00:52:50 +0900 Subject: [PATCH] Refactoring: Avoid using const FPS --- graphicscontext.go | 2 +- run.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/graphicscontext.go b/graphicscontext.go index 2cd5e378e..12c078573 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -82,7 +82,7 @@ func (c *graphicsContext) initializeIfNeeded() error { } func (c *graphicsContext) Update(afterFrameUpdate func()) error { - updateCount := clock.Update(FPS) + updateCount := clock.Update(defaultTPS) if err := c.initializeIfNeeded(); err != nil { return err diff --git a/run.go b/run.go index 579c6c868..290c02508 100644 --- a/run.go +++ b/run.go @@ -29,10 +29,12 @@ import ( "github.com/hajimehoshi/ebiten/internal/ui" ) +const defaultTPS = 60 + // FPS represents how many times game updating happens in a second (60). // // BUG: This actually represents TPS, not FPS. -const FPS = 60 +const FPS = defaultTPS // CurrentFPS returns the current number of frames per second of rendering. //