mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
b6bc683991
commit
c92ccfff79
@ -45,6 +45,13 @@ func max(a, b int) int {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func min(a, b int) int {
|
||||||
|
if a < b {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
hooks.AppendHookOnBeforeUpdate(func() error {
|
hooks.AppendHookOnBeforeUpdate(func() error {
|
||||||
backendsM.Lock()
|
backendsM.Lock()
|
||||||
@ -686,7 +693,9 @@ func BeginFrame() error {
|
|||||||
panic("shareable: all the images must be not-shared before the game starts")
|
panic("shareable: all the images must be not-shared before the game starts")
|
||||||
}
|
}
|
||||||
minSize = 1024
|
minSize = 1024
|
||||||
maxSize = max(minSize, restorable.MaxImageSize())
|
|
||||||
|
// The maximum size is 8192 no matter what the available sizes are (#1453).
|
||||||
|
maxSize = min(max(minSize, restorable.MaxImageSize()), 8192)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user