| 15 | GDREGuiIcons *GDREGuiIcons::singleton = nullptr; |
| 16 | namespace { |
| 17 | static inline Ref<ImageTexture> generate_icon(int p_index, float scale) { |
| 18 | ERR_FAIL_INDEX_V(p_index, gdre_icons_count, nullptr); |
| 19 | Ref<Image> img = memnew(Image); |
| 20 | |
| 21 | #ifdef MODULE_SVG_ENABLED |
| 22 | // Upsample icon generation only if the scale isn't an integer multiplier. |
| 23 | // Generating upsampled icons is slower, and the benefit is hardly visible |
| 24 | // with integer scales. |
| 25 | ImageLoaderSVG img_loader; |
| 26 | img_loader.create_image_from_string(img, gdre_icons_sources[p_index], scale, false, false); |
| 27 | #endif |
| 28 | |
| 29 | return ImageTexture::create_from_image(img); |
| 30 | } |
| 31 | } //namespace |
| 32 | |
| 33 | int get_icon_index(const StringName &p_name) { |
no outgoing calls
no test coverage detected