Skip to content

Commit

Permalink
IconForge: GAGS (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow authored Jan 19, 2025
1 parent 61e61c3 commit 0eb5a04
Show file tree
Hide file tree
Showing 3 changed files with 649 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ The default features are:
* git: Functions for robustly checking the current git revision.
* hash: Faster replacement for `md5`, support for SHA-1, SHA-256, and SHA-512.
* http: Asynchronous HTTP(s) client supporting most standard methods.
* iconforge: A much faster replacement for the spritesheet generation system used by [/tg/station].
* iconforge: A much faster replacement for various bulk DM /icon operations such as [/tg/station]'s asset subsystem spritesheet generation and GAGS bundle generation.
* json: Function to check JSON validity.
* log: Faster log output.
* noise: 2d Perlin noise.
Expand Down
14 changes: 14 additions & 0 deletions dmsrc/iconforge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
#define rustg_iconforge_cache_valid(input_hash, dmi_hashes, sprites) RUSTG_CALL(RUST_G, "iconforge_cache_valid")(input_hash, dmi_hashes, sprites)
/// Returns a job_id for use with rustg_iconforge_check()
#define rustg_iconforge_cache_valid_async(input_hash, dmi_hashes, sprites) RUSTG_CALL(RUST_G, "iconforge_cache_valid_async")(input_hash, dmi_hashes, sprites)
/// Provided a /datum/greyscale_config typepath, JSON string containing the greyscale config, and path to a DMI file containing the base icons,
/// Loads that config into memory for later use by rustg_iconforge_gags(). The config_path is the unique identifier used later.
/// JSON Config schema: https://hackmd.io/@tgstation/GAGS-Layer-Types
/// Unsupported features: color_matrix layer type, 'or' blend_mode. May not have BYOND parity with animated icons or varying dirs between layers.
/// Returns "OK" if successful, otherwise, returns a string containing the error.
#define rustg_iconforge_load_gags_config(config_path, config_json, config_icon_path) RUSTG_CALL(RUST_G, "iconforge_load_gags_config")("[config_path]", config_json, config_icon_path)
/// Given a config_path (previously loaded by rustg_iconforge_load_gags_config), and a string of hex colors formatted as "#ff00ff#ffaa00"
/// Outputs a DMI containing all of the states within the config JSON to output_dmi_path, creating any directories leading up to it if necessary.
/// Returns "OK" if successful, otherwise, returns a string containing the error.
#define rustg_iconforge_gags(config_path, colors, output_dmi_path) RUSTG_CALL(RUST_G, "iconforge_gags")("[config_path]", colors, output_dmi_path)
/// Returns a job_id for use with rustg_iconforge_check()
#define rustg_iconforge_load_gags_config_async(config_path, config_json, config_icon_path) RUSTG_CALL(RUST_G, "iconforge_load_gags_config_async")("[config_path]", config_json, config_icon_path)
/// Returns a job_id for use with rustg_iconforge_check()
#define rustg_iconforge_gags_async(config_path, colors, output_dmi_path) RUSTG_CALL(RUST_G, "iconforge_gags_async")("[config_path]", colors, output_dmi_path)

#define RUSTG_ICONFORGE_BLEND_COLOR "BlendColor"
#define RUSTG_ICONFORGE_BLEND_ICON "BlendIcon"
Expand Down
Loading

0 comments on commit 0eb5a04

Please sign in to comment.