diff --git a/code/__DEFINES/rust_g.dm b/code/__DEFINES/rust_g.dm new file mode 100644 index 000000000000..a905fd5186fb --- /dev/null +++ b/code/__DEFINES/rust_g.dm @@ -0,0 +1,7 @@ +// rust_g.dm - DM API for rust_g extension library +#define RUST_G "rust_g" + +#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname) + +#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text) +/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")() diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 4289fd5ad0bf..92f7b21bb700 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -1,13 +1,10 @@ -//location of the rust-g library -#define RUST_G "rust_g" - //wrapper macros for easier grepping #define DIRECT_OUTPUT(A, B) A << B #define SEND_IMAGE(target, image) DIRECT_OUTPUT(target, image) #define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound) #define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text) #define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text) -#define WRITE_LOG(log, text) call(RUST_G, "log_write")(log, text) +#define WRITE_LOG(log, text) rustg_log_write(log, text) //print a warning message to world.log #define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].") @@ -156,7 +153,7 @@ /* Close open log handles. This should be called as late as possible, and no logging should hapen after. */ /proc/shutdown_logging() - call(RUST_G, "log_close_all")() + rustg_log_close_all() /* Helper procs for building detailed log lines */ @@ -176,6 +173,3 @@ return "[A.loc] [COORD(T)] ([A.loc.type])" else if(A.loc) return "[A.loc] (0, 0, 0) ([A.loc.type])" - -//this is only used here (for now) -#undef RUST_G diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index 28a3ec23b971..a31fb63c3191 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -225,7 +225,7 @@ GLOBAL_LIST_EMPTY(asset_datums) var/res_name = "spritesheet_[name].css" var/fname = "data/spritesheets/[res_name]" - call("rust_g", "file_write")(generate_css(), fname) + text2file(generate_css(), fname) register_asset(res_name, file(fname)) for(var/size_id in sizes) @@ -249,7 +249,7 @@ GLOBAL_LIST_EMPTY(asset_datums) // save flattened version var/fname = "data/spritesheets/[name]_[size_id].png" fcopy(size[SPRSZ_ICON], fname) - var/error = call("rust_g", "dmi_strip_metadata")(fname) + var/error = rustg_dmi_strip_metadata(fname) if(length(error)) stack_trace("Failed to strip [name]_[size_id].png: [error]") size[SPRSZ_STRIPPED] = icon(fname) diff --git a/tgstation.dme b/tgstation.dme index eb2a29943a9d..d4cbb36a1adb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -73,6 +73,7 @@ #include "code\__DEFINES\research.dm" #include "code\__DEFINES\robots.dm" #include "code\__DEFINES\role_preferences.dm" +#include "code\__DEFINES\rust_g.dm" #include "code\__DEFINES\say.dm" #include "code\__DEFINES\shuttles.dm" #include "code\__DEFINES\sight.dm"