mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-03-22 04:44:09 +07:00
update blackmatov modules
This commit is contained in:
@@ -108,7 +108,7 @@ namespace e2d::ecsex
|
||||
Opts&&... opts)
|
||||
{
|
||||
static thread_local vector<ecs::entity> to_remove_components;
|
||||
DEFER([](){ to_remove_components.clear(); });
|
||||
DEFER_HPP([](){ to_remove_components.clear(); });
|
||||
|
||||
owner.for_each_component<T>([](const ecs::entity& e, const T&){
|
||||
to_remove_components.push_back(e);
|
||||
@@ -163,7 +163,7 @@ namespace e2d::ecsex
|
||||
std::tuple<ecs::entity, Ts...>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
@@ -187,7 +187,7 @@ namespace e2d::ecsex
|
||||
std::tuple<ecs::const_entity, Ts...>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
@@ -214,7 +214,7 @@ namespace e2d::ecsex
|
||||
std::tuple<ecs::entity, Ts...>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
@@ -243,7 +243,7 @@ namespace e2d::ecsex
|
||||
std::tuple<ecs::const_entity, Ts...>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace e2d::impl
|
||||
}
|
||||
|
||||
ImGui::PushID(co.find());
|
||||
DEFER([](){ ImGui::PopID(); });
|
||||
DEFER_HPP([](){ ImGui::PopID(); });
|
||||
|
||||
const bool inspector_opened = ImGui::CollapsingHeader(
|
||||
component_inspector<Component>::title,
|
||||
@@ -90,7 +90,7 @@ namespace e2d::impl
|
||||
|
||||
const char* component_popup_context_str_id = "e2d_component_popup_context";
|
||||
if ( ImGui::BeginPopupContextItem(component_popup_context_str_id) ) {
|
||||
DEFER([](){ ImGui::EndPopup(); });
|
||||
DEFER_HPP([](){ ImGui::EndPopup(); });
|
||||
|
||||
auto disabled_co = co.owner().template component<disabled<Component>>();
|
||||
if ( bool enabled = !disabled_co; ImGui::Checkbox("Enabled", &enabled) ) {
|
||||
@@ -137,7 +137,7 @@ namespace e2d::impl
|
||||
}
|
||||
|
||||
ImGui::PushID(co.find());
|
||||
DEFER([](){ ImGui::PopID(); });
|
||||
DEFER_HPP([](){ ImGui::PopID(); });
|
||||
|
||||
if ( !co.owner().template component<disabled<Component>>() ) {
|
||||
inspector_(co, ctx);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace e2d::nodes
|
||||
static thread_local vector<intrusive_ptr<Node>> parents;
|
||||
|
||||
const std::size_t begin_index = parents.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
parents.erase(
|
||||
parents.begin() + begin_index,
|
||||
parents.end());
|
||||
@@ -184,7 +184,7 @@ namespace e2d::nodes
|
||||
static thread_local vector<intrusive_ptr<Node>> children;
|
||||
|
||||
const std::size_t begin_index = children.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
children.erase(
|
||||
children.begin() + begin_index,
|
||||
children.end());
|
||||
@@ -253,7 +253,7 @@ namespace e2d::nodes
|
||||
static thread_local vector<gcomponent<Component>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
@@ -284,7 +284,7 @@ namespace e2d::nodes
|
||||
static thread_local vector<gcomponent<Component>> components;
|
||||
|
||||
const std::size_t begin_index = components.size();
|
||||
DEFER([begin_index](){
|
||||
DEFER_HPP([begin_index](){
|
||||
components.erase(
|
||||
components.begin() + begin_index,
|
||||
components.end());
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace e2d::imgui_utils
|
||||
template < typename... Args >
|
||||
void show_colored_text(const color& color, str_view fmt, Args&&... args) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, make_vec4(color));
|
||||
DEFER([](){ ImGui::PopStyleColor(); });
|
||||
DEFER_HPP([](){ ImGui::PopStyleColor(); });
|
||||
|
||||
show_formatted_text(fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace e2d::imgui_utils
|
||||
}
|
||||
|
||||
if ( ImGui::BeginCombo(label_cstr, preview_cstr) ) {
|
||||
DEFER([](){ ImGui::EndCombo(); });
|
||||
DEFER_HPP([](){ ImGui::EndCombo(); });
|
||||
|
||||
for ( std::size_t i = 0; i < enum_hpp::size<E>(); ++i ) {
|
||||
str_view item_name = enum_hpp::names<E>()[i];
|
||||
@@ -80,10 +80,10 @@ namespace e2d::imgui_utils
|
||||
template < typename F, typename... Args >
|
||||
void with_disabled_flag(F&& f, Args&&... args) {
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
DEFER([](){ ImGui::PopItemFlag(); });
|
||||
DEFER_HPP([](){ ImGui::PopItemFlag(); });
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
|
||||
DEFER([](){ ImGui::PopStyleVar(); });
|
||||
DEFER_HPP([](){ ImGui::PopStyleVar(); });
|
||||
|
||||
std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user