IconForge: DMI Generation, Code Reorganization, Improved Caching, Cleaner I/O#213
Merged
ZeWaka merged 14 commits intotgstation:masterfrom Jul 4, 2025
Merged
Conversation
vinylspiders
reviewed
May 1, 2025
There was a problem hiding this comment.
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.
ZeWaka
approved these changes
Jun 29, 2025
itsmeow
added a commit
to BeeStation/rust-g
that referenced
this pull request
Feb 26, 2026
itsmeow
added a commit
to BeeStation/rust-g
that referenced
this pull request
Feb 26, 2026
* fixes the clippy lints on nightly (tgstation#215) * Adds a new time function, `formatted_timestamp` (tgstation#214) * dmi_create_png is rgba instead of rgb (tgstation#217) * add useragent to byond installer * crate internal updates (tgstation#218) * v3.9.0 (tgstation#219) * Enable pathfinder by default (tgstation#220) * Fix clippy URL lifetime lint (tgstation#223) * Improve DM test functionality on Windows, fix regressions (tgstation#221) * Adds `roll_dice`, an advanced xdy dice roller. (tgstation#216) Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com> * v3.11.0 (tgstation#224) * Fix TOML dme test failing (tgstation#227) * hash: optimize file hashing (tgstation#228) * IconForge: DMI Generation, Code Reorganization, Improved Caching, Cleaner I/O (tgstation#213) * Adds a new `uuid` module (tgstation#229) * IconForge: BYOND Parity + Tests, Optimizations, New Transforms (tgstation#230) * `clippy` lints for tgstation#230 (tgstation#233) * Adds `http_request_fire_and_forget` (tgstation#232) * DMI metadata reading and injection (tgstation#234) * 4.0.0 (tgstation#235) * dmi: Add QR code generation (tgstation#226) * Bump `dmi` to 0.5.0, optimize `dmi_read_metadata` (tgstation#238) * Update CI to target 516.1666 (tgstation#237) * 4.1.0 (tgstation#239) * makes `rustg_noise_poisson_map` around 8x faster (tgstation#240) * IconForge: Headless Icon Generation (tgstation#236) * `cargo update` & `cargo upgrade` & `png` fix (tgstation#241) * assorted optimizations to `cellularnoise`, `dbpnoise`, and `worleynoise` (tgstation#243) * v4.2.0 (tgstation#242) * Fix attempt for CI * hash: Adds ChaCha20 CSPRNG functions, updates TOTP generator, adds Base32 (tgstation#225) * Handle errors in panic hook explicitly (tgstation#245) * do not store Git information static (tgstation#247) * Prevent `decode_base64` and `decode_base32` from panicking if given invalid base64 (tgstation#244) * 4.3.0 (tgstation#249) * fix iconforge generate_headless on win for bad paths not panicing (tgstation#248) * 5.0.0 (tgstation#250) * redo iconforge errors - 5.0.1 (tgstation#252) * 6.0.0 - drop windows 7 support (tgstation#251) * fix spritesheet gen on linux (tgstation#255) * cargo update and clippy (tgstation#253) * 6.0.1 - and `cargo update` (tgstation#256) --------- Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> Co-authored-by: ZeWaka <zewakagamer@gmail.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: Comrade Niobe <126028983+ComradeNiobe@users.noreply.github.com> Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com> Co-authored-by: Y0SH1M4S73R <y0sh1m4s73r@gmail.com> Co-authored-by: Ivy <distributivgesetz93@gmail.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This Does
sprite_namethat caused the error, rather than saying "N/A, in final generation stage".Breaking DM change: add
, FALSE, TRUEargument to the end of existing calls torustg_iconforge_generate()orrustg_iconforge_generate_async()Breaking DM change: The default arguments of the commonly used
uni_iconAPI 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