From 50bc6745d8d1f0c5c0e6fbf5518be64bfb2aea83 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Sat, 30 Nov 2024 13:35:09 -0800 Subject: [PATCH] feat: new clone registry core function --- ecsact/runtime/core.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ecsact/runtime/core.h b/ecsact/runtime/core.h index c392b4c7..ad4fbc3a 100644 --- a/ecsact/runtime/core.h +++ b/ecsact/runtime/core.h @@ -50,6 +50,16 @@ ECSACT_CORE_API_FN(void, ecsact_destroy_registry) ecsact_registry_id registry ); +/** + * Creates a new registry from an existing one with all its entities and + * components intact. + */ +ECSACT_CORE_API_FN(void, ecsact_clone_registry) +( // + ecsact_registry_id registry, + const char* registry_name +); + /** * Destroy all entities */ @@ -295,6 +305,7 @@ ECSACT_CORE_API_FN(ecsact_stream_error, ecsact_stream) #else # define FOR_EACH_ECSACT_CORE_API_FN(fn, ...) \ fn(ecsact_create_registry, __VA_ARGS__); \ + fn(ecsact_clone_registry, __VA_ARGS__); \ fn(ecsact_destroy_registry, __VA_ARGS__); \ fn(ecsact_clear_registry, __VA_ARGS__); \ fn(ecsact_create_entity, __VA_ARGS__); \