Fix frame counters to int64 (#337)

This commit is contained in:
Hajime Hoshi 2017-04-06 00:45:28 +09:00
parent ebedb24e43
commit b0454b874e
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -32,7 +32,7 @@ type runContext struct {
fps int
currentFPS float64
runningSlowly bool
frames int
frames int64
lastUpdated int64
lastFPSUpdated int64
m sync.RWMutex