From fa8e271f2ac2c2113bc379cd6f4457994169748e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 19 Jun 2021 18:52:05 +0900 Subject: [PATCH] internal/atlas: Bug fix: Set the minimum texture size to 8192px Closes #1675 Updates #1674 --- internal/atlas/image.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index e4347e52d..20dd0162c 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -45,6 +45,13 @@ func max(a, b int) int { return b } +func min(a, b int) int { + if a < b { + return a + } + return b +} + func init() { hooks.AppendHookOnBeforeUpdate(func() error { backendsM.Lock() @@ -70,17 +77,10 @@ func resolveDeferred() { // Actual time duration is increased in an exponential way for each usages as a rendering target. const baseCountToPutOnAtlas = 10 -func min(a, b uint) uint { - if a < b { - return a - } - return b -} - func putImagesOnAtlas() error { for i := range imagesToPutOnAtlas { i.usedAsSourceCount++ - if i.usedAsSourceCount >= baseCountToPutOnAtlas*(1<= baseCountToPutOnAtlas*(1<