Dispose previous altas when replacing it to avoid OutOfMemory exceptions
This commit is contained in:
parent
125bb1270e
commit
3640874b35
1 changed files with 3 additions and 2 deletions
|
@ -70,7 +70,7 @@ object ImageGetter {
|
||||||
return getImage("UnitIcons/$unitName").apply { this.color=color }
|
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 productionCircleColor = Color.BROWN.cpy().lerp(Color.WHITE,0.5f)!!
|
||||||
val goldCircleColor = Color.GOLD.cpy().lerp(Color.WHITE,0.5f)!!
|
val goldCircleColor = Color.GOLD.cpy().lerp(Color.WHITE,0.5f)!!
|
||||||
fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{
|
fun getImprovementIcon(improvementName:String, size:Float=20f):Actor{
|
||||||
|
@ -102,13 +102,14 @@ object ImageGetter {
|
||||||
|
|
||||||
fun getBlue() = Color(0x004085bf)
|
fun getBlue() = Color(0x004085bf)
|
||||||
|
|
||||||
fun getCircle() = getImage("OtherIcons/Circle") // This is used, like, everywhere
|
fun getCircle() = getImage("OtherIcons/Circle")
|
||||||
|
|
||||||
fun getBackground(color:Color): Drawable {
|
fun getBackground(color:Color): Drawable {
|
||||||
return getDrawable(whiteDotLocation).tint(color)
|
return getDrawable(whiteDotLocation).tint(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun refreshAltas() {
|
fun refreshAltas() {
|
||||||
|
atlas.dispose() // To avoid OutOfMemory exceptions
|
||||||
atlas = TextureAtlas("game.atlas")
|
atlas = TextureAtlas("game.atlas")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue