Added timers to see what's taking so long. It's the fonts - 11 seconds to load Chinese characters.

Specifically, putGlyph. Which makes sense, since it's basically rendering 3000 images into the memory for Chinese.
This commit is contained in:
Yair Morgenstern
2019-11-28 22:10:26 +02:00
parent 3816014ae4
commit c1d3ac2604
7 changed files with 300 additions and 300 deletions

View File

@ -32,6 +32,8 @@ internal object DesktopLauncher {
}
private fun packImages() {
val startTime = System.currentTimeMillis()
val settings = TexturePacker.Settings()
// Apparently some chipsets, like NVIDIA Tegra 3 graphics chipset (used in Asus TF700T tablet),
// don't support non-power-of-two texture sizes - kudos @yuroller!
@ -46,6 +48,9 @@ internal object DesktopLauncher {
settings.filterMag = Texture.TextureFilter.MipMapLinearLinear
settings.filterMin = Texture.TextureFilter.MipMapLinearLinear
TexturePacker.process(settings, "../Images", ".", "game")
val texturePackingTime = System.currentTimeMillis() - startTime
println("Packing textures - "+texturePackingTime+"ms")
}
private fun tryActivateDiscord(game: UncivGame) {