@@ -69,7 +69,8 @@ auto component_add_trivial(
69
69
template <typename C>
70
70
auto context_remove (
71
71
ecsact_system_execution_context* context,
72
- [[maybe_unused]] ecsact_component_like_id component_id
72
+ [[maybe_unused]] ecsact_component_like_id component_id,
73
+ auto & view
73
74
) -> void {
74
75
assert (ecsact_id_cast<ecsact_component_like_id>(C::id) == component_id);
75
76
@@ -88,7 +89,7 @@ auto context_remove(
88
89
89
90
// Stop here (tag)
90
91
if constexpr (!std::is_empty_v<C>) {
91
- auto component = registry .template get <C>(entity);
92
+ auto component = view .template get <C>(entity);
92
93
93
94
auto & remove_storage =
94
95
registry.template emplace_or_replace <beforeremove_storage<C>>(entity);
@@ -100,7 +101,8 @@ auto context_remove(
100
101
template <typename C>
101
102
auto component_remove_trivial (
102
103
::entt::registry& registry,
103
- ecsact::entt::entity_id entity_id
104
+ ecsact::entt::entity_id entity_id,
105
+ auto & view
104
106
) -> void {
105
107
using ecsact::entt::component_removed;
106
108
using ecsact::entt::component_updated;
@@ -113,7 +115,7 @@ auto component_remove_trivial(
113
115
registry.template emplace_or_replace <component_removed<C>>(entity_id);
114
116
115
117
if constexpr (!std::is_empty_v<C>) {
116
- auto component = registry .template get <C>(entity_id);
118
+ auto component = view .template get <C>(entity_id);
117
119
118
120
auto & remove_storage =
119
121
registry.template emplace_or_replace <beforeremove_storage<C>>(entity_id);
@@ -126,21 +128,23 @@ template<typename C>
126
128
auto context_get (
127
129
ecsact_system_execution_context* context,
128
130
[[maybe_unused]] ecsact_component_like_id component_id,
129
- void * out_component_data
131
+ void * out_component_data,
132
+ auto & view
130
133
) -> void {
131
134
auto entity = context->entity ;
132
135
const auto & registry = *context->registry ;
133
136
134
137
assert (registry.template any_of <C>(entity));
135
138
136
- *static_cast <C*>(out_component_data) = registry .template get <C>(entity);
139
+ *static_cast <C*>(out_component_data) = view .template get <C>(entity);
137
140
}
138
141
139
142
template <typename C>
140
143
auto context_update (
141
144
ecsact_system_execution_context* context,
142
145
[[maybe_unused]] ecsact_component_like_id component_id,
143
- const void * in_component_data
146
+ const void * in_component_data,
147
+ auto & view
144
148
) -> void {
145
149
using ecsact::entt::component_updated;
146
150
using ecsact::entt::detail::exec_beforechange_storage;
@@ -154,6 +158,7 @@ auto context_update(
154
158
auto & current_component = registry.template get <C>(entity);
155
159
auto & beforechange =
156
160
registry.template get <exec_beforechange_storage<C>>(entity);
161
+
157
162
if (!beforechange.has_update_occurred ) {
158
163
beforechange.value = current_component;
159
164
beforechange.has_update_occurred = true ;
0 commit comments