Skip to content

Commit 5fc1d31

Browse files
committed
chore: rename some variables, use view on update
1 parent a4faffd commit 5fc1d31

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ecsact/entt/wrapper/dynamic.hh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ auto context_update(
155155

156156
const auto& in_component = *static_cast<const C*>(in_component_data);
157157

158-
auto& current_component = registry.template get<C>(entity);
159-
auto& beforechange =
160-
registry.template get<exec_beforechange_storage<C>>(entity);
158+
auto& current_component = view.template get<C>(entity);
159+
auto& beforechange = view.template get<exec_beforechange_storage<C>>(entity);
161160

162161
if(!beforechange.has_update_occurred) {
163162
beforechange.value = current_component;

rt_entt_codegen/core/print_sys_exec.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static auto print_sys_exec_ctx_remove(
133133
ecsact::codegen_plugin_context& ctx,
134134
const ecsact::rt_entt_codegen::ecsact_entt_system_details& details,
135135
capability_t sys_caps,
136-
const std::string& view_name
136+
const std::string& view_type_name
137137
) -> void {
138138
using ecsact::cc_lang_support::cpp_identifier;
139139
using ecsact::cpp_codegen_plugin_util::block;
@@ -179,15 +179,15 @@ static auto print_sys_exec_ctx_remove(
179179
ctx.write(std::format(
180180
"using remove_fn_t = void (*)(ecsact_system_execution_context*, "
181181
"ecsact_component_like_id, {}_t&);\n",
182-
view_name
182+
view_type_name
183183
));
184184

185185
ctx.write("static const auto remove_fns = []()\n");
186186

187187
block(ctx, "", [&] {
188188
ctx.write(
189189
"auto result = std::unordered_map<ecsact_component_like_id, "
190-
"get_fn_t>{};\n"
190+
"remove_fn_t>{};\n"
191191
);
192192
for(const auto comp_id : details.removable_comps) {
193193
auto type_name = cpp_identifier(decl_full_name(comp_id));
@@ -208,7 +208,7 @@ static auto print_sys_exec_ctx_remove(
208208
static auto print_sys_exec_ctx_get(
209209
ecsact::codegen_plugin_context& ctx,
210210
const ecsact::rt_entt_codegen::ecsact_entt_system_details& details,
211-
const std::string& view_name
211+
const std::string& view_type_name
212212
) -> void {
213213
using ecsact::cc_lang_support::cpp_identifier;
214214
using ecsact::cpp_codegen_plugin_util::block;
@@ -262,7 +262,7 @@ static auto print_sys_exec_ctx_get(
262262
ctx.write(std::format(
263263
"using get_fn_t = void (*)(ecsact_system_execution_context*, "
264264
"ecsact_component_like_id, void *, {}_t&);\n",
265-
view_name
265+
view_type_name
266266
));
267267

268268
ctx.write("static const auto get_fns = []()\n");
@@ -295,7 +295,7 @@ static auto print_sys_exec_ctx_get(
295295
static auto print_sys_exec_ctx_update(
296296
ecsact::codegen_plugin_context& ctx,
297297
const ecsact::rt_entt_codegen::ecsact_entt_system_details& details,
298-
const std::string& view_name
298+
const std::string& view_type_name
299299
) -> void {
300300
using ecsact::cc_lang_support::cpp_identifier;
301301
using ecsact::cpp_codegen_plugin_util::block;
@@ -329,7 +329,7 @@ static auto print_sys_exec_ctx_update(
329329
ctx.write(std::format(
330330
"using update_fn_t = void (*)(ecsact_system_execution_context*, "
331331
"ecsact_component_like_id, const void *, {}_t&);\n",
332-
view_name
332+
view_type_name
333333
));
334334

335335
ctx.write("static const auto update_fns = []()\n");

rt_entt_codegen/shared/util.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <string>
66
#include <utility>
77
#include <ranges>
8+
#include <format>
89
#include "ecsact/codegen/plugin.hh"
910
#include "ecsact/lang-support/lang-cc.hh"
1011
#include "ecsact/runtime/meta.h"

0 commit comments

Comments
 (0)