mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 04:09:35 +07:00
Dispose previous altas when replacing it to avoid OutOfMemory exceptions
This commit is contained in:
parent
125bb1270e
commit
3640874b35
@ -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")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user