mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +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
|
||||
driver *driver.Player
|
||||
sampleRate int
|
||||
frames int
|
||||
writtenBytes int
|
||||
frames int64
|
||||
writtenBytes int64
|
||||
}
|
||||
|
||||
var (
|
||||
@ -247,7 +247,7 @@ func (c *Context) Update() error {
|
||||
}
|
||||
c.frames++
|
||||
bytesPerFrame := c.sampleRate * bytesPerSample * channelNum / ebiten.FPS
|
||||
l := (c.frames * bytesPerFrame) - c.writtenBytes
|
||||
l := (c.frames * int64(bytesPerFrame)) - c.writtenBytes
|
||||
l &= mask
|
||||
c.writtenBytes += l
|
||||
buf := make([]byte, l)
|
||||
|
@ -32,7 +32,7 @@ type runContext struct {
|
||||
fps int
|
||||
currentFPS float64
|
||||
runningSlowly bool
|
||||
frames int
|
||||
frames int64
|
||||
lastUpdated int64
|
||||
lastFPSUpdated int64
|
||||
m sync.RWMutex
|
||||
|
Loading…
Reference in New Issue
Block a user