perf(render): Minimized texture swaps for improvements/resources

This commit is contained in:
yairm210 2025-02-05 09:16:59 +02:00
parent c2e83c9ee9
commit bdf2d43176
4 changed files with 18 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -627,6 +627,20 @@ OtherIcons/Circle
orig: 178, 178
offset: 0, 0
index: -1
ImprovementIcons/Circle
rotate: false
xy: 289, 1590
size: 178, 178
orig: 178, 178
offset: 0, 0
index: -1
ResourceIcons/Circle
rotate: false
xy: 289, 1590
size: 178, 178
orig: 178, 178
offset: 0, 0
index: -1
OtherIcons/Cities
rotate: false
xy: 208, 1436

View File

@ -163,6 +163,8 @@ class PortraitResource(name: String, size: Float, amount: Int = 0) : Portrait(Ty
}
}
override fun getCircleImage() = ImageGetter.getImage("ResourceIcons/Circle")
override fun getDefaultInnerBackgroundTint(): Color =
ruleset.tileResources[imageName]?.resourceType?.getColor() ?: Color.WHITE
@ -220,6 +222,8 @@ class PortraitImprovement(name: String, size: Float, dim: Boolean = false, isPil
addActor(pillagedIcon)
}
}
override fun getCircleImage() = ImageGetter.getImage("ImprovementIcons/Circle")
private fun getColorFromStats(stats: Stats): Color {
if (stats.asSequence().none { it.value > 0 })