diff --git a/ecsact/wasm/detail/guest_imports/env.hh b/ecsact/wasm/detail/guest_imports/env.hh index 299bec1..31fdb97 100644 --- a/ecsact/wasm/detail/guest_imports/env.hh +++ b/ecsact/wasm/detail/guest_imports/env.hh @@ -150,6 +150,20 @@ const auto guest_env_module_imports = allowed_guest_imports_t{ }; }, }, + { + "ecsact_system_execution_context_stream_toggle", + []() -> minst_import_resolve_func { + return { + wasm_functype_new_4_0( + wasm_valtype_new(WASM_I32), // context + wasm_valtype_new(WASM_I32), // component_id + wasm_valtype_new(WASM_I32), // streaming_enabled + wasm_valtype_new(WASM_I32) // indexed_fields + ), + &wasm_ecsact_system_execution_context_stream_toggle, + }; + }, + }, }; } // namespace ecsact::wasm::detail diff --git a/ecsact/wasm/detail/wasm_ecsact_system_execution.cc b/ecsact/wasm/detail/wasm_ecsact_system_execution.cc index 5c63bc6..cb99d24 100644 --- a/ecsact/wasm/detail/wasm_ecsact_system_execution.cc +++ b/ecsact/wasm/detail/wasm_ecsact_system_execution.cc @@ -290,3 +290,21 @@ wasm_trap_t* wasm_ecsact_system_execution_context_entity( return nullptr; } + +wasm_trap_t* wasm_ecsact_system_execution_context_stream_toggle( + const wasm_val_vec_t* args, + wasm_val_vec_t* results +) { + debug_trace_method("ecsact_system_execution_context_stream_toggle"); + + auto ctx = get_execution_context(args->data[0]); + auto memory = get_execution_context_memory(args->data[0]); + + ecsact_system_execution_context_add( + ctx, + ecsact_id_from_wasm_i32(args->data[1]), + get_const_void_ptr(args->data[2], memory) + ); + + return nullptr; +} diff --git a/ecsact/wasm/detail/wasm_ecsact_system_execution.h b/ecsact/wasm/detail/wasm_ecsact_system_execution.h index b88a3ff..9f66bf4 100644 --- a/ecsact/wasm/detail/wasm_ecsact_system_execution.h +++ b/ecsact/wasm/detail/wasm_ecsact_system_execution.h @@ -65,4 +65,9 @@ wasm_trap_t* wasm_ecsact_system_execution_context_entity( wasm_val_vec_t* results ); +wasm_trap_t* wasm_ecsact_system_execution_context_stream_toggle( + const wasm_val_vec_t* args, + wasm_val_vec_t* results +); + #endif // WASM_ECSACT_SYSTEM_EXECUTION__H