perf(render): Improved yield render performance for modded images

This commit is contained in:
yairm210
2025-02-05 11:20:25 +02:00
parent 9bc468eea9
commit 0dfed62cfc
4 changed files with 10 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -641,6 +641,13 @@ ResourceIcons/Circle
orig: 178, 178
offset: 0, 0
index: -1
StatIcons/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

@ -32,7 +32,7 @@ class YieldGroup : HorizontalGroup() {
}
fun getIcon(statName: String) =
ImageGetter.getStatIcon(statName).surroundWithCircle(12f)
ImageGetter.getStatIcon(statName).surroundWithCircle(12f, circleImageLocation = "StatIcons/Circle")
.apply { circle.color = ImageGetter.CHARCOAL; circle.color.a = 0.5f }
private fun getStatIconsTable(statName: String, number: Int): Table {

View File

@ -31,13 +31,14 @@ If you use external tools and multiple atlases, you will need to maintain this f
### Rendering Performance
Images that are packed together are much faster to render together.
Images that are packed together are much faster to render together. If most of the images in your mod are using images from the mod, we want to be able to wrap them from images *also* from your mod.
To allow for faster rendering for icons, which has a major performance effect, you can copy the ["OtherIcons/circle.png"](https://github.com/yairm210/Unciv/blob/master/android/Images.Icons/OtherIcons/Circle.png) to:
- "ImprovementIcons/Circle.png" for improvements
- "ResourceIcons/Circle.png" for resources
- "TechIcons/Circle.png" for technologies
- "ConstructionIcons/Circle.png" for buildings and units
- "StatIcons/Circle.png" for stats
### Texture packer settings