From 3640874b3517e02896150d5114141dc55bdf9414 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 24 May 2019 14:33:59 +0300 Subject: [PATCH] Dispose previous altas when replacing it to avoid OutOfMemory exceptions --- core/src/com/unciv/ui/utils/ImageGetter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/utils/ImageGetter.kt b/core/src/com/unciv/ui/utils/ImageGetter.kt index 0d3bf55449..9a76ecb8a9 100644 --- a/core/src/com/unciv/ui/utils/ImageGetter.kt +++ b/core/src/com/unciv/ui/utils/ImageGetter.kt @@ -70,7 +70,7 @@ object ImageGetter { return getImage("UnitIcons/$unitName").apply { this.color=color } } - val foodCircleColor = colorFromRGB(129, 199, 132)// .GREEN.cpy().lerp(Color.WHITE,0.5f) + val foodCircleColor = colorFromRGB(129, 199, 132) val productionCircleColor = Color.BROWN.cpy().lerp(Color.WHITE,0.5f)!! val goldCircleColor = Color.GOLD.cpy().lerp(Color.WHITE,0.5f)!! fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{ @@ -102,13 +102,14 @@ object ImageGetter { fun getBlue() = Color(0x004085bf) - fun getCircle() = getImage("OtherIcons/Circle") // This is used, like, everywhere + fun getCircle() = getImage("OtherIcons/Circle") fun getBackground(color:Color): Drawable { return getDrawable(whiteDotLocation).tint(color) } fun refreshAltas() { + atlas.dispose() // To avoid OutOfMemory exceptions atlas = TextureAtlas("game.atlas") }