|
1 |
| -/// Generates a spritesheet at: [file_path][spritesheet_name]_[size_id].png |
| 1 | +/// Generates a spritesheet at: [file_path][spritesheet_name]_[size_id].[png or dmi] |
2 | 2 | /// The resulting spritesheet arranges icons in a random order, with the position being denoted in the "sprites" return value.
|
3 | 3 | /// All icons have the same y coordinate, and their x coordinate is equal to `icon_width * position`.
|
4 | 4 | ///
|
5 | 5 | /// hash_icons is a boolean (0 or 1), and determines if the generator will spend time creating hashes for the output field dmi_hashes.
|
6 |
| -/// These hashes can be heplful for 'smart' caching (see rustg_iconforge_cache_valid), but require extra computation. |
| 6 | +/// These hashes can be helpful for 'smart' caching (see rustg_iconforge_cache_valid), but require extra computation. |
| 7 | +/// |
| 8 | +/// generate_dmi is a boolean (0 or 1), and determines if the generator will save the sheet as a DMI or stripped PNG file. |
| 9 | +/// DMI files can be used to replace bulk Insert() operations, PNGs are more useful for asset transport or UIs. DMI generation is slower due to more metadata. |
| 10 | +/// flatten is a boolean (0 or 1), and determines if the DMI output will be flattened to a single frame/dir if unscoped (null/0 dir or frame values). |
| 11 | +/// PNGs are always flattened, regardless of argument. |
7 | 12 | ///
|
8 | 13 | /// Spritesheet will contain all sprites listed within "sprites".
|
9 | 14 | /// "sprites" format:
|
|
32 | 37 | /// "error" = "[A string, empty if there were no errors.]"
|
33 | 38 | /// )
|
34 | 39 | /// In the case of an unrecoverable panic from within Rust, this function ONLY returns a string containing the error.
|
35 |
| -#define rustg_iconforge_generate(file_path, spritesheet_name, sprites, hash_icons) RUSTG_CALL(RUST_G, "iconforge_generate")(file_path, spritesheet_name, sprites, "[hash_icons]") |
| 40 | +#define rustg_iconforge_generate(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]") |
36 | 41 | /// Returns a job_id for use with rustg_iconforge_check()
|
37 |
| -#define rustg_iconforge_generate_async(file_path, spritesheet_name, sprites, hash_icons) RUSTG_CALL(RUST_G, "iconforge_generate_async")(file_path, spritesheet_name, sprites, "[hash_icons]") |
| 42 | +#define rustg_iconforge_generate_async(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate_async")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]") |
38 | 43 | /// Returns the status of an async job_id, or its result if it is completed. See RUSTG_JOB DEFINEs.
|
39 | 44 | #define rustg_iconforge_check(job_id) RUSTG_CALL(RUST_G, "iconforge_check")("[job_id]")
|
40 | 45 | /// Clears all cached DMIs and images, freeing up memory.
|
|
0 commit comments