mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/atlas: bug fix: possible overflowing on 32bit machines
This commit is contained in:
parent
e270dea460
commit
ea1f596cda
@ -77,7 +77,7 @@ func putImagesOnSourceBackend(graphicsDriver graphicsdriver.Graphics) {
|
|||||||
if i.usedAsSourceCount < math.MaxInt {
|
if i.usedAsSourceCount < math.MaxInt {
|
||||||
i.usedAsSourceCount++
|
i.usedAsSourceCount++
|
||||||
}
|
}
|
||||||
if i.usedAsSourceCount >= baseCountToPutOnSourceBackend*(1<<uint(min(i.usedAsDestinationCount, 31))) {
|
if int64(i.usedAsSourceCount) >= int64(baseCountToPutOnSourceBackend*(1<<uint(min(i.usedAsDestinationCount, 31)))) {
|
||||||
i.putOnSourceBackend(graphicsDriver)
|
i.putOnSourceBackend(graphicsDriver)
|
||||||
i.usedAsSourceCount = 0
|
i.usedAsSourceCount = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user