test: get around an issue of toolset v141

This commit is contained in:
Michele Caini
2020-09-14 18:59:19 +02:00
parent 118c14bf1e
commit 94bfa5ea25

View File

@@ -21,12 +21,14 @@ CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
context = static_cast<type_context *>(ctx->userdata);
} else {
// forces things to break
static_cast<entt::registry *>(ctx->userdata)->prepare<velocity>();
auto &registry = *static_cast<entt::registry *>(ctx->userdata);
registry.prepare<velocity>();
const auto view = static_cast<entt::registry *>(ctx->userdata)->view<position>();
static_cast<entt::registry *>(ctx->userdata)->insert(view.begin(), view.end(), velocity{1., 1.});
static_cast<entt::registry *>(ctx->userdata)->view<position, velocity>().each([](auto &pos, auto &vel) {
const auto view = registry.view<position>();
registry.insert(view.begin(), view.end(), velocity{1., 1.});
registry.view<position, velocity>().each([](position &pos, velocity &vel) {
pos.x += static_cast<int>(16 * vel.dx);
pos.y += static_cast<int>(16 * vel.dy);
});