@@ -53,13 +53,26 @@ ECSACT_CORE_API_FN(void, ecsact_destroy_registry)
5353/**
5454 * Creates a new registry from an existing one with all its entities and
5555 * components intact.
56+ *
57+ * If `ecsact_hash_registry` is defined then the cloned registry hash must
58+ * match the original registry.
5659 */
5760ECSACT_CORE_API_FN (ecsact_registry_id , ecsact_clone_registry )
5861( //
5962 ecsact_registry_id registry ,
6063 const char * registry_name
6164);
6265
66+ /**
67+ * Creates a hash of current state of the registry. The algorithm is
68+ * implementation defined, but must represent both user state and internal
69+ * state.
70+ */
71+ ECSACT_CORE_API_FN (uint64_t , ecsact_hash_registry )
72+ ( //
73+ ecsact_registry_id registry
74+ );
75+
6376/**
6477 * Destroy all entities
6578 */
@@ -307,6 +320,7 @@ ECSACT_CORE_API_FN(ecsact_stream_error, ecsact_stream)
307320 fn(ecsact_create_registry, __VA_ARGS__); \
308321 fn(ecsact_destroy_registry, __VA_ARGS__); \
309322 fn(ecsact_clone_registry, __VA_ARGS__); \
323+ fn(ecsact_hash_registry, __VA_ARGS__); \
310324 fn(ecsact_clear_registry, __VA_ARGS__); \
311325 fn(ecsact_create_entity, __VA_ARGS__); \
312326 fn(ecsact_ensure_entity, __VA_ARGS__); \
0 commit comments