Explorar o código

davey: swap entity and storage in registry view

skypjack hai 10 meses
pai
achega
7302b1544d
Modificáronse 1 ficheiros con 11 adicións e 11 borrados
  1. 11 11
      tools/entt/davey/davey.hpp

+ 11 - 11
tools/entt/davey/davey.hpp

@@ -196,17 +196,6 @@ template<typename Entity, typename Allocator>
 void davey(const meta_ctx &ctx, const entt::basic_registry<Entity, Allocator> &registry) {
 void davey(const meta_ctx &ctx, const entt::basic_registry<Entity, Allocator> &registry) {
     ImGui::BeginTabBar("#tabs");
     ImGui::BeginTabBar("#tabs");
 
 
-    if(ImGui::BeginTabItem("Storage")) {
-        for([[maybe_unused]] auto [id, storage]: registry.storage()) {
-            if(const davey_data *info = entt::resolve(ctx, storage.info()).custom(); ImGui::TreeNode(&storage.info(), "%s (%zu)", DAVEY_OR(storage), storage.size())) {
-                internal::present_storage(ctx, storage);
-                ImGui::TreePop();
-            }
-        }
-
-        ImGui::EndTabItem();
-    }
-
     if(ImGui::BeginTabItem("Entity")) {
     if(ImGui::BeginTabItem("Entity")) {
         const auto &storage = registry.template storage<Entity>();
         const auto &storage = registry.template storage<Entity>();
 
 
@@ -225,6 +214,17 @@ void davey(const meta_ctx &ctx, const entt::basic_registry<Entity, Allocator> &r
         ImGui::EndTabItem();
         ImGui::EndTabItem();
     }
     }
 
 
+    if(ImGui::BeginTabItem("Storage")) {
+        for([[maybe_unused]] auto [id, storage]: registry.storage()) {
+            if(const davey_data *info = entt::resolve(ctx, storage.info()).custom(); ImGui::TreeNode(&storage.info(), "%s (%zu)", DAVEY_OR(storage), storage.size())) {
+                internal::present_storage(ctx, storage);
+                ImGui::TreePop();
+            }
+        }
+
+        ImGui::EndTabItem();
+    }
+
     ImGui::EndTabBar();
     ImGui::EndTabBar();
 }
 }