mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Fix frame counters to int64 (#337)
This commit is contained in:
parent
ebedb24e43
commit
b0454b874e
@ -190,8 +190,8 @@ type Context struct {
|
|||||||
players *players
|
players *players
|
||||||
driver *driver.Player
|
driver *driver.Player
|
||||||
sampleRate int
|
sampleRate int
|
||||||
frames int
|
frames int64
|
||||||
writtenBytes int
|
writtenBytes int64
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -247,7 +247,7 @@ func (c *Context) Update() error {
|
|||||||
}
|
}
|
||||||
c.frames++
|
c.frames++
|
||||||
bytesPerFrame := c.sampleRate * bytesPerSample * channelNum / ebiten.FPS
|
bytesPerFrame := c.sampleRate * bytesPerSample * channelNum / ebiten.FPS
|
||||||
l := (c.frames * bytesPerFrame) - c.writtenBytes
|
l := (c.frames * int64(bytesPerFrame)) - c.writtenBytes
|
||||||
l &= mask
|
l &= mask
|
||||||
c.writtenBytes += l
|
c.writtenBytes += l
|
||||||
buf := make([]byte, l)
|
buf := make([]byte, l)
|
||||||
|
@ -32,7 +32,7 @@ type runContext struct {
|
|||||||
fps int
|
fps int
|
||||||
currentFPS float64
|
currentFPS float64
|
||||||
runningSlowly bool
|
runningSlowly bool
|
||||||
frames int
|
frames int64
|
||||||
lastUpdated int64
|
lastUpdated int64
|
||||||
lastFPSUpdated int64
|
lastFPSUpdated int64
|
||||||
m sync.RWMutex
|
m sync.RWMutex
|
||||||
|
Loading…
Reference in New Issue
Block a user