Skip to content

Commit 2fc2771

Browse files
committed
fix: adjusted after ecsact-dev/ecsact_runtime#255
1 parent 05daaf6 commit 2fc2771

File tree

10 files changed

+57
-22
lines changed

10 files changed

+57
-22
lines changed

MODULE.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ local_path_override(
2020
path = "../ecsact_lang_cpp",
2121
)
2222

23+
local_path_override(
24+
module_name = "ecsact_runtime",
25+
path = "../ecsact_runtime",
26+
)
27+
2328
bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
2429
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
2530
git_override(

ecsact/entt/wrapper/core.hh

+12-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ template<typename C>
1616
inline auto has_component( //
1717
ecsact_registry_id registry_id,
1818
ecsact_entity_id entity_id,
19-
[[maybe_unused]] ecsact_component_id component_id
19+
[[maybe_unused]] ecsact_component_id component_id,
20+
...
2021
) -> bool {
2122
auto& reg = ecsact::entt::get_registry(registry_id);
2223
auto entity = ecsact::entt::entity_id{entity_id};
@@ -28,7 +29,8 @@ template<typename C>
2829
inline auto get_component(
2930
ecsact_registry_id registry_id,
3031
ecsact_entity_id entity_id,
31-
[[maybe_unused]] ecsact_component_id component_id
32+
[[maybe_unused]] ecsact_component_id component_id,
33+
...
3234
) -> const void* {
3335
auto& reg = ecsact::entt::get_registry(registry_id);
3436
auto entity = ecsact::entt::entity_id{entity_id};
@@ -116,7 +118,8 @@ inline auto update_component( //
116118
ecsact_registry_id registry_id,
117119
ecsact_entity_id entity_id,
118120
[[maybe_unused]] ecsact_component_id component_id,
119-
const void* component_data
121+
const void* component_data,
122+
...
120123
) -> ecsact_update_error {
121124
using ecsact::entt::detail::exec_beforechange_storage;
122125

@@ -148,7 +151,8 @@ inline auto update_component_exec_options( //
148151
ecsact_registry_id registry_id,
149152
ecsact_entity_id entity_id,
150153
[[maybe_unused]] ecsact_component_id component_id,
151-
const void* component_data
154+
const void* component_data,
155+
...
152156
) -> ecsact_update_error {
153157
using ecsact::entt::detail::exec_beforechange_storage;
154158

@@ -184,7 +188,8 @@ template<typename C>
184188
auto remove_component(
185189
ecsact_registry_id registry_id,
186190
ecsact_entity_id entity_id,
187-
[[maybe_unused]] ecsact_component_id component_id
191+
[[maybe_unused]] ecsact_component_id component_id,
192+
...
188193
) -> void {
189194
auto& reg = ecsact::entt::get_registry(registry_id);
190195
auto entity = ecsact::entt::entity_id{entity_id};
@@ -203,7 +208,8 @@ template<typename C>
203208
auto remove_component_exec_options(
204209
ecsact_registry_id registry_id,
205210
ecsact_entity_id entity_id,
206-
[[maybe_unused]] ecsact_component_id component_id
211+
[[maybe_unused]] ecsact_component_id component_id,
212+
...
207213
) -> void {
208214
using ecsact::entt::detail::pending_remove;
209215

ecsact/entt/wrapper/dynamic.hh

+8-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ template<typename C>
7070
auto context_remove(
7171
ecsact_system_execution_context* context,
7272
[[maybe_unused]] ecsact_component_like_id component_id,
73-
auto& view
73+
auto& view,
74+
...
7475
) -> void {
7576
assert(ecsact_id_cast<ecsact_component_like_id>(C::id) == component_id);
7677

@@ -125,7 +126,8 @@ auto context_get(
125126
ecsact_system_execution_context* context,
126127
[[maybe_unused]] ecsact_component_like_id component_id,
127128
void* out_component_data,
128-
auto& view
129+
auto& view,
130+
...
129131
) -> void {
130132
auto entity = context->entity;
131133

@@ -137,7 +139,8 @@ auto context_update(
137139
ecsact_system_execution_context* context,
138140
[[maybe_unused]] ecsact_component_like_id component_id,
139141
const void* in_component_data,
140-
auto& view
142+
auto& view,
143+
...
141144
) -> void {
142145
using ecsact::entt::detail::exec_beforechange_storage;
143146
// TODO(Kelwan): for remove, beforeremove_storage
@@ -158,7 +161,8 @@ auto context_update(
158161
template<typename C>
159162
auto context_has(
160163
ecsact_system_execution_context* context,
161-
[[maybe_unused]] ecsact_component_like_id component_id
164+
[[maybe_unused]] ecsact_component_like_id component_id,
165+
...
162166
) -> bool {
163167
auto entity = context->entity;
164168
auto& registry = *context->registry;

rt_entt_codegen/core/assoc_globals.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "rt_entt_codegen/core/core.hh"
22

3+
#include <format>
34
#include "ecsact/runtime/meta.hh"
45
#include "ecsact/lang-support/lang-cc.hh"
56

rt_entt_codegen/core/print_sys_exec.cc

+2
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ static auto print_execute_system_template_specialization(
544544
);
545545

546546
block(ctx, "if(system_impl == nullptr)", [&] { ctx.write("return;"); });
547+
ctx.write("\n");
547548

548549
print_execute_systems(
549550
ctx,
@@ -594,6 +595,7 @@ static auto print_execute_actions_template_specialization(
594595
);
595596

596597
block(ctx, "if(system_impl == nullptr)", [&] { ctx.write("return;"); });
598+
ctx.write("\n");
597599

598600
ctx.write(
599601
"auto actions = actions_map.as_action_span<",

rt_entt_codegen/core/system_provider/association/association.cc

+8
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ auto provider::association::entity_iteration(
180180
));
181181
}
182182

183+
for(auto assoc_id : ecsact::meta::system_assoc_ids(sys_like_id)) {
184+
ctx.write(std::format(
185+
"{}.entity = *{}_itr;\n",
186+
get_assoc_context_var_name(sys_like_id, assoc_id),
187+
assoc_view_names.at(assoc_id)
188+
));
189+
}
190+
183191
iter_func();
184192

185193
for(auto assoc_id : ecsact::meta::system_assoc_ids(sys_like_id)) {

rt_entt_codegen/core/system_provider/system_ctx_functions.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ auto ecsact::rt_entt_codegen::core::provider::context_get_impl(
196196

197197
ctx.write(std::format(
198198
"using get_fn_t = void (*)(ecsact_system_execution_context*, "
199-
"ecsact_component_like_id, void *, {}_t&);\n",
199+
"ecsact_component_like_id, void *, {}_t&, ...);\n",
200200
view_type_name
201201
));
202202

@@ -253,7 +253,7 @@ auto ecsact::rt_entt_codegen::core::provider::context_update_impl(
253253

254254
ctx.write(std::format(
255255
"using update_fn_t = void (*)(ecsact_system_execution_context*, "
256-
"ecsact_component_like_id, const void *, {}_t&);\n",
256+
"ecsact_component_like_id, const void *, {}_t&, ...);\n",
257257
view_type_name
258258
));
259259

@@ -408,7 +408,7 @@ auto ecsact::rt_entt_codegen::core::provider::context_other_impl(
408408
"passed in here\n"
409409
);
410410
ctx.write("assert(static_cast<int>(assoc_id) == 0);\n");
411-
ctx.write("return other_contexts[0];\n");
411+
ctx.write("return other_contexts[0];");
412412
return;
413413
}
414414

@@ -420,5 +420,5 @@ auto ecsact::rt_entt_codegen::core::provider::context_other_impl(
420420
"assert(static_cast<int>(assoc_id) < {});\n",
421421
details.association_details.size()
422422
));
423-
ctx.write("return other_contexts[static_cast<int>(assoc_id)];\n");
423+
ctx.write("return other_contexts[static_cast<int>(assoc_id)];");
424424
}

rt_entt_codegen/shared/system_util.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "system_util.hh"
22

33
#include <array>
4+
#include <format>
45
#include <unordered_map>
56

67
#include "ecsact/runtime/common.h"

runtime/ecsact_rt_entt_core.cc

+8-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ ecsact_add_error ecsact_add_component(
109109
bool ecsact_has_component(
110110
ecsact_registry_id reg_id,
111111
ecsact_entity_id entity_id,
112-
ecsact_component_id component_id
112+
ecsact_component_id component_id,
113+
...
113114
) {
114115
using ecsact::entt::detail::globals::has_component_fns;
115116
auto fn_itr = has_component_fns.find(component_id);
@@ -120,7 +121,8 @@ bool ecsact_has_component(
120121
const void* ecsact_get_component(
121122
ecsact_registry_id reg_id,
122123
ecsact_entity_id entity_id,
123-
ecsact_component_id component_id
124+
ecsact_component_id component_id,
125+
...
124126
) {
125127
using ecsact::entt::detail::globals::get_component_fns;
126128
auto fn_itr = get_component_fns.find(component_id);
@@ -195,7 +197,8 @@ ecsact_update_error ecsact_update_component(
195197
ecsact_registry_id reg_id,
196198
ecsact_entity_id entity_id,
197199
ecsact_component_id component_id,
198-
const void* component_data
200+
const void* component_data,
201+
...
199202
) {
200203
using ecsact::entt::detail::globals::update_component_fns;
201204
auto fn_itr = update_component_fns.find(component_id);
@@ -206,7 +209,8 @@ ecsact_update_error ecsact_update_component(
206209
void ecsact_remove_component(
207210
ecsact_registry_id reg_id,
208211
ecsact_entity_id entity_id,
209-
ecsact_component_id component_id
212+
ecsact_component_id component_id,
213+
...
210214
) {
211215
using ecsact::entt::detail::globals::remove_component_fns;
212216
auto fn_itr = remove_component_fns.find(component_id);

runtime/ecsact_rt_entt_dynamic.cc

+8-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ void ecsact_system_execution_context_add(
7676

7777
void ecsact_system_execution_context_remove(
7878
ecsact_system_execution_context* context,
79-
ecsact_component_like_id comp_id
79+
ecsact_component_like_id comp_id,
80+
...
8081
) {
8182
assert(context != nullptr);
8283
return context->remove(comp_id);
@@ -85,7 +86,8 @@ void ecsact_system_execution_context_remove(
8586
void ecsact_system_execution_context_get(
8687
ecsact_system_execution_context* context,
8788
ecsact_component_like_id comp_id,
88-
void* out_component_data
89+
void* out_component_data,
90+
...
8991
) {
9092
assert(context != nullptr);
9193
return context->get(comp_id, out_component_data);
@@ -94,15 +96,17 @@ void ecsact_system_execution_context_get(
9496
void ecsact_system_execution_context_update(
9597
ecsact_system_execution_context* context,
9698
ecsact_component_like_id comp_id,
97-
const void* component_data
99+
const void* component_data,
100+
...
98101
) {
99102
assert(context != nullptr);
100103
return context->update(comp_id, component_data);
101104
}
102105

103106
bool ecsact_system_execution_context_has(
104107
ecsact_system_execution_context* context,
105-
ecsact_component_like_id comp_id
108+
ecsact_component_like_id comp_id,
109+
...
106110
) {
107111
assert(context != nullptr);
108112
return context->has(comp_id);

0 commit comments

Comments
 (0)