-
Notifications
You must be signed in to change notification settings - Fork 107
IconForge: Arbitrary Icon Creation Update, Improved Caching, Cleaner I/O #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the IconForge system by adding arbitrary icon generation with support for DMI output, improved caching using Arc and DashMap, and cleaner I/O handling. Key changes include new Rust modules for spritesheet generation, image caching, and blending, along with updated DM macros and documentation to support the new DMI and flatten parameters.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/iconforge/spritesheet.rs | Introduces new structures for spritesheet results with DMI support. |
src/iconforge/image_cache.rs | Implements enhanced caching for UniversalIcon data and DMI file parsing. |
src/iconforge/byond.rs | Adds DM bindings for synchronous and asynchronous icon generation functions. |
src/iconforge/blending.rs | Provides blending operations with a variety of blend modes for RGBA colors. |
dmsrc/iconforge.dm | Updates macros and documentation to include new generate_dmi and flatten flags. |
Comments suppressed due to low confidence (1)
dmsrc/iconforge.dm:6
- Typo in documentation: 'heplful' should be corrected to 'helpful'.
/// These hashes can be heplful for 'smart' caching (see rustg_iconforge_cache_valid), but require extra computation.
What This Does
sprite_name
that caused the error, rather than saying "N/A, in final generation stage".Breaking DM change: add
, FALSE, TRUE
argument to the end of existing calls torustg_iconforge_generate()
orrustg_iconforge_generate_async()
Breaking DM change: The default arguments of the commonly used
uni_icon
API need to be adjusted so that dir and frame are nullArbitrary Icon Generation
It's now technically possible to generate just about any icon that the game can make (excluding certain special operations) with just the uni_icon system and
rustg_iconforge_generate()
, because it now supports multi-dir and animated icons. However, the main benefit of IconForge is still parallelization and caching.I got this idea because it would make tgstation/tgstation#90940 run significantly faster with very little effort.
I tested this using the linked TG PR with the following method replacement:
The output was exactly as expected.
I did some tracy profiling, and it's actually faster now, due to changes in how caching and I/O works