Skip to content

Commit 97debba

Browse files
committed
chore: remove component_updated marker
1 parent 21369f4 commit 97debba

File tree

5 files changed

+5
-23
lines changed

5 files changed

+5
-23
lines changed

ecsact/entt/event_markers.hh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ namespace ecsact::entt {
1010
template<typename C>
1111
struct component_added {};
1212

13-
/**
14-
* Marker to indicate that a component has been changed during execution
15-
*/
16-
template<typename C>
17-
struct component_updated {};
18-
1913
/**
2014
* Marker to indicate that a component has been removed
2115
*/

ecsact/entt/wrapper/core.hh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "ecsact/entt/error_check.hh"
1111
#include "ecsact/entt/detail/execution_events_collector.hh"
1212

13+
#include <iostream>
14+
1315
namespace ecsact::entt::wrapper::core {
1416

1517
template<typename C>
@@ -156,7 +158,6 @@ inline auto update_component_exec_options( //
156158

157159
if(err == ECSACT_UPDATE_OK) {
158160
reg.replace<C>(entity, *static_cast<const C*>(component_data));
159-
reg.template emplace_or_replace<component_updated<C>>(entity);
160161
}
161162

162163
return err;
@@ -177,7 +178,6 @@ auto remove_component(
177178
reg.remove<detail::exec_beforechange_storage<C>>(entity);
178179
}
179180
reg.template remove<component_added<C>>(entity);
180-
reg.template remove<component_updated<C>>(entity);
181181
reg.template emplace_or_replace<component_removed<C>>(entity);
182182
ecsact::entt::detail::remove_system_markers_if_needed<C>(reg, entity);
183183
}
@@ -203,7 +203,6 @@ auto remove_component_exec_options(
203203

204204
reg.template erase<C>(entity);
205205
reg.template remove<component_added<C>>(entity);
206-
reg.template remove<component_updated<C>>(entity);
207206
reg.template emplace_or_replace<component_removed<C>>(entity);
208207

209208
if constexpr(!std::is_empty_v<C>) {
@@ -295,7 +294,6 @@ auto _trigger_update_component_event(
295294
ecsact_registry_id registry_id,
296295
ecsact::entt::detail::execution_events_collector& events_collector
297296
) -> void {
298-
using ecsact::entt::component_updated;
299297
using ecsact::entt::detail::exec_beforechange_storage;
300298

301299
if(!events_collector.has_update_callback()) {
@@ -307,7 +305,6 @@ auto _trigger_update_component_event(
307305
::entt::basic_view changed_view{
308306
reg.template storage<C>(),
309307
reg.template storage<exec_beforechange_storage<C>>(),
310-
reg.template storage<component_updated<C>>(),
311308
};
312309

313310
for(ecsact::entt::entity_id entity : changed_view) {
@@ -384,7 +381,6 @@ inline auto clear_component(ecsact_registry_id registry_id) -> void {
384381
auto& reg = ecsact::entt::get_registry(registry_id);
385382

386383
reg.clear<ecsact::entt::component_added<C>>();
387-
reg.clear<ecsact::entt::component_updated<C>>();
388384
reg.clear<ecsact::entt::component_removed<C>>();
389385
}
390386

@@ -411,7 +407,6 @@ inline auto prepare_component(ecsact_registry_id registry_id) -> void {
411407
if constexpr(!std::is_empty_v<C>) {
412408
reg.template storage<detail::exec_beforechange_storage<C>>();
413409
reg.template storage<detail::exec_itr_beforechange_storage<C>>();
414-
reg.template storage<component_updated<C>>();
415410
}
416411
}
417412

ecsact/entt/wrapper/dynamic.hh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ auto context_remove(
7575
assert(ecsact_id_cast<ecsact_component_like_id>(C::id) == component_id);
7676

7777
using ecsact::entt::component_removed;
78-
using ecsact::entt::component_updated;
7978
using ecsact::entt::detail::beforeremove_storage;
8079
using ecsact::entt::detail::pending_remove;
8180

8281
auto entity = context->entity;
8382
auto& registry = *context->registry;
8483

8584
registry.template remove<component_added<C>>(entity);
86-
registry.template remove<component_updated<C>>(entity);
8785
registry.template emplace_or_replace<pending_remove<C>>(entity);
8886
registry.template emplace_or_replace<component_removed<C>>(entity);
8987

@@ -105,12 +103,10 @@ auto component_remove_trivial(
105103
auto& view
106104
) -> void {
107105
using ecsact::entt::component_removed;
108-
using ecsact::entt::component_updated;
109106
using ecsact::entt::detail::beforeremove_storage;
110107
using ecsact::entt::detail::pending_remove;
111108

112109
registry.template remove<component_added<C>>(entity_id);
113-
registry.template remove<component_updated<C>>(entity_id);
114110
registry.template emplace_or_replace<pending_remove<C>>(entity_id);
115111
registry.template emplace_or_replace<component_removed<C>>(entity_id);
116112

@@ -146,7 +142,6 @@ auto context_update(
146142
const void* in_component_data,
147143
auto& view
148144
) -> void {
149-
using ecsact::entt::component_updated;
150145
using ecsact::entt::detail::exec_beforechange_storage;
151146
// TODO(Kelwan): for remove, beforeremove_storage
152147

@@ -161,7 +156,6 @@ auto context_update(
161156
if(!beforechange.has_update_occurred) {
162157
beforechange.value = current_component;
163158
beforechange.has_update_occurred = true;
164-
registry.template emplace_or_replace<component_updated<C>>(entity);
165159
}
166160
current_component = in_component;
167161
}

rt_entt_codegen/core/system_provider/notify/notify.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,14 @@ auto provider::notify::print_system_notify_views(
129129
}
130130

131131
if(notify_setting == ECSACT_SYS_NOTIFY_ONUPDATE) {
132-
auto component_updated_str =
133-
std::format("ecsact::entt::component_updated<{}>", cpp_comp_name);
134-
135132
auto view_name = std::format("{}_update_view", comp_name);
136133

137134
ecsact::rt_entt_codegen::util::make_view(
138135
ctx,
139136
view_name,
140137
registry_name,
141138
system_details,
142-
std::vector{component_updated_str},
139+
{},
143140
std::vector{run_system_comp}
144141
);
145142

test/runtime_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "ecsact/runtime/core.hh"
1111
#include "ecsact/runtime/dynamic.h"
1212

13+
#include <iostream>
14+
1315
#include "runtime_test.ecsact.hh"
1416
#include "runtime_test.ecsact.systems.hh"
1517

0 commit comments

Comments
 (0)