diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index 7594f33f..693a3eb3 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -238,6 +238,7 @@ #define party_member_list_all party_member_list(1) +#define art_cache_clear sfall_func0("art_cache_clear") #define attack_is_aimed sfall_func0("attack_is_aimed") #define car_gas_amount sfall_func0("car_gas_amount") #define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index 7bfd1cdb..ff4374c7 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -560,6 +560,9 @@ Some utility/math functions are available: - returns the setting value from the AI packet of an object (critter) - use AI_CAP_* constants from define_extra.h for the aiParam argument to get AI value +> void sfall_func0("art_cache_clear") +- clears the cache of FRM image files loaded into memory + ------------------------ ------ MORE INFO ------- ------------------------ diff --git a/sfall/Modules/Scripting/Handlers/Anims.cpp b/sfall/Modules/Scripting/Handlers/Anims.cpp index 3be3cb91..af25a3b5 100644 --- a/sfall/Modules/Scripting/Handlers/Anims.cpp +++ b/sfall/Modules/Scripting/Handlers/Anims.cpp @@ -116,5 +116,9 @@ void sf_explosions_metarule(OpcodeContext& ctx) { ctx.setReturn(result); } +void sf_art_cache_flush(OpcodeContext& ctx) { + __asm call fo::funcoffs::art_flush_; +} + } } diff --git a/sfall/Modules/Scripting/Handlers/Anims.h b/sfall/Modules/Scripting/Handlers/Anims.h index f22ff1cc..372aa582 100644 --- a/sfall/Modules/Scripting/Handlers/Anims.h +++ b/sfall/Modules/Scripting/Handlers/Anims.h @@ -36,5 +36,7 @@ void sf_reg_anim_take_out(OpcodeContext&); void sf_reg_anim_turn_towards(OpcodeContext&); void sf_explosions_metarule(OpcodeContext&); +void sf_art_cache_flush(OpcodeContext&); + } } diff --git a/sfall/Modules/Scripting/Handlers/Metarule.cpp b/sfall/Modules/Scripting/Handlers/Metarule.cpp index 59712045..1de2f748 100644 --- a/sfall/Modules/Scripting/Handlers/Metarule.cpp +++ b/sfall/Modules/Scripting/Handlers/Metarule.cpp @@ -20,6 +20,7 @@ #include "..\..\ScriptExtender.h" #include "..\Arrays.h" #include "..\OpcodeContext.h" +#include "Anims.h" #include "Interface.h" #include "Misc.h" #include "Objects.h" @@ -77,6 +78,7 @@ static const SfallMetarule* currentMetarule; - arg1, arg2, ... - argument types for automatic validation */ static const SfallMetarule metarules[] = { + {"art_cache_clear", sf_art_cache_flush, 0, 0}, {"attack_is_aimed", sf_attack_is_aimed, 0, 0}, {"car_gas_amount", sf_car_gas_amount, 0, 0}, {"create_win", sf_create_win, 5, 6, {ARG_STRING, ARG_INT, ARG_INT, ARG_INT, ARG_INT, ARG_INT}},