Intagrated Tracy, debugged animations

This commit is contained in:
2026-02-12 14:00:05 +03:00
parent 7947690e80
commit 74a1adfb27
25 changed files with 1553 additions and 2109 deletions

View File

@@ -15,6 +15,7 @@
#include "PhysicsModule.h"
#include "items.h"
#include "StaticGeometryModule.h"
#include <tracy/Tracy.hpp>
namespace ECS
{
@@ -461,16 +462,14 @@ nlohmann::json &StaticGeometryModule::getTemplates()
void StaticGeometryModule::updateItemGeometry(flecs::entity e)
{
if (e.has<GeometryUpdateItem>())
return;
e.add<GeometryUpdateItem>();
Ogre::Root::getSingleton().getWorkQueue()->addTask([e]() {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask(
[e]() {
Geometry::updateItemGeometry(e);
e.remove<GeometryUpdateItem>();
});
// We add this as task to reduce UI load
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask([e]() {
ZoneScopedN("updateItemGeometry");
if (e.has<GeometryUpdateItem>())
return;
e.add<GeometryUpdateItem>();
Geometry::updateItemGeometry(e);
e.remove<GeometryUpdateItem>();
});
}
@@ -487,22 +486,14 @@ void StaticGeometryModule::addTriangleBufferWork(
Procedural::TriangleBuffer tb;
};
WorkData data = { meshName, geo, position, rotation, tb };
Ogre::Root::getSingleton().getWorkQueue()->addTask([captData = std::move(
data)]() {
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask(
[captData]() {
Ogre::MeshPtr mesh =
captData.tb.transformToMesh(
captData.meshName);
Ogre::Entity *ent =
ECS::get<EngineData>()
.mScnMgr->createEntity(mesh);
captData.geo->addEntity(ent, captData.position,
captData.rotation);
ECS::get<EngineData>().mScnMgr->destroyEntity(
ent);
});
// We add this as task to reduce UI load
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask([data]() {
ZoneScopedN("addTriangleBufferWork");
Ogre::MeshPtr mesh = data.tb.transformToMesh(data.meshName);
Ogre::Entity *ent =
ECS::get<EngineData>().mScnMgr->createEntity(mesh);
data.geo->addEntity(ent, data.position, data.rotation);
ECS::get<EngineData>().mScnMgr->destroyEntity(ent);
});
}
struct TiledMeshes {