From 0dfed62cfc62fba91ff904179609949787cf4fe4 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Wed, 5 Feb 2025 11:20:25 +0200 Subject: [PATCH] perf(render): Improved yield render performance for modded images --- android/Images.Icons/StatIcons/Circle.png | Bin 0 -> 1459 bytes android/assets/Icons.atlas | 7 +++++++ .../unciv/ui/components/tilegroups/YieldGroup.kt | 2 +- docs/Modders/Images-and-Audio.md | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 android/Images.Icons/StatIcons/Circle.png diff --git a/android/Images.Icons/StatIcons/Circle.png b/android/Images.Icons/StatIcons/Circle.png new file mode 100644 index 0000000000000000000000000000000000000000..3d919503e924b6f00bc3580841d00a5c08249cda GIT binary patch literal 1459 zcmZXUdo^%GrE!~T%1L5e8%n86WzUpd zsbLsthH=Sd>R44aZ!YeVTqAYd{_*gV2zI?81A#)ZN0~K-Z174NZLRj!Mc6+ zUs;#4y1FWp$(H3T%2`-gn4O)So}QkPGdVf=C38iNR4N7e-%6I`ynXu?Q~~?t1d&Me zQ4SD7p%6%5hlYked}aPS=Dq{;1qcL!H*$cU`5#~~fIM*)lmhY1f>S{U&<6&o9&Cgrz~#HP1~UvPEc09BfXiSts8O6eknf3ixO z`idmTE@K=i=3Xi9dtKWx=8sr*zOa#^N-!GipUbg+Xng9YLf+Z2y@CaM&2|gDKoqCs z{W5|BJE2X@j+1cIbDk7~mlYVE+{;D55sW?I59sGk`4zNxl2waw?o8g9NPJ)8rB&5@u?QEj;!4{)SE#@& zFt5f^bPCa|xH$vUg#rouQFl>EcIK4~XSW7Y(8-%F_8*RQo_6D(FD>rftg#(yVuSYh zyNT#ww9MzvU32xO4s=HJkb|ET-ltgkc0Q(5_;%{;P4+ggkJ9q()V4$)DKiczpz)54 zStRbL%MEs;%fpx0h;}veWR!XR<=YCZ#nOfm@_AR^=7w!GYdS1U>#v(7_o2Di$E^0;Y>L{iz zI!D(8_z)K-yg~-AqbA^ZL!OjPFJdip0fgf1mx-FeTeQFn)V;;vn+xD literal 0 HcmV?d00001 diff --git a/android/assets/Icons.atlas b/android/assets/Icons.atlas index 3934d07d58..50d270726a 100644 --- a/android/assets/Icons.atlas +++ b/android/assets/Icons.atlas @@ -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 diff --git a/core/src/com/unciv/ui/components/tilegroups/YieldGroup.kt b/core/src/com/unciv/ui/components/tilegroups/YieldGroup.kt index 37b12920a8..1857753922 100644 --- a/core/src/com/unciv/ui/components/tilegroups/YieldGroup.kt +++ b/core/src/com/unciv/ui/components/tilegroups/YieldGroup.kt @@ -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 { diff --git a/docs/Modders/Images-and-Audio.md b/docs/Modders/Images-and-Audio.md index be1e4ab06e..766bffef4c 100644 --- a/docs/Modders/Images-and-Audio.md +++ b/docs/Modders/Images-and-Audio.md @@ -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