@@ -53,13 +53,26 @@ ECSACT_CORE_API_FN(void, ecsact_destroy_registry)
53
53
/**
54
54
* Creates a new registry from an existing one with all its entities and
55
55
* components intact.
56
+ *
57
+ * If `ecsact_hash_registry` is defined then the cloned registry hash must
58
+ * match the original registry.
56
59
*/
57
60
ECSACT_CORE_API_FN (ecsact_registry_id , ecsact_clone_registry )
58
61
( //
59
62
ecsact_registry_id registry ,
60
63
const char * registry_name
61
64
);
62
65
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
+
63
76
/**
64
77
* Destroy all entities
65
78
*/
@@ -307,6 +320,7 @@ ECSACT_CORE_API_FN(ecsact_stream_error, ecsact_stream)
307
320
fn(ecsact_create_registry, __VA_ARGS__); \
308
321
fn(ecsact_destroy_registry, __VA_ARGS__); \
309
322
fn(ecsact_clone_registry, __VA_ARGS__); \
323
+ fn(ecsact_hash_registry, __VA_ARGS__); \
310
324
fn(ecsact_clear_registry, __VA_ARGS__); \
311
325
fn(ecsact_create_entity, __VA_ARGS__); \
312
326
fn(ecsact_ensure_entity, __VA_ARGS__); \
0 commit comments