Intagrated Tracy, debugged animations
This commit is contained in:
@@ -3,6 +3,7 @@ find_package(OGRE REQUIRED COMPONENTS Bites Bullet Paging Terrain Overlay CONFIG
|
||||
find_package(Bullet REQUIRED)
|
||||
find_package(nlohmann_json REQUIRED)
|
||||
find_package(OgreProcedural REQUIRED CONFIG)
|
||||
find_package(flecs REQUIRED CONFIG)
|
||||
add_library(items STATIC items.cpp harbour.cpp temple.cpp town.cpp)
|
||||
target_include_directories(items PUBLIC . ${CMAKE_SOURCE_DIR}/src/FastNoiseLite)
|
||||
target_link_libraries(items PRIVATE
|
||||
@@ -13,4 +14,5 @@ target_link_libraries(items PRIVATE
|
||||
OgreBites
|
||||
editor
|
||||
physics
|
||||
Tracy::TracyClient
|
||||
)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "CharacterAIModule.h"
|
||||
#include "items.h"
|
||||
#include "town.h"
|
||||
#include <tracy/Tracy.hpp>
|
||||
|
||||
/*
|
||||
* TODO: Create doors and handle them via script.
|
||||
@@ -3363,6 +3364,7 @@ struct TownPlazza : TownTask {
|
||||
int index, Ogre::SceneNode *sceneNode,
|
||||
Ogre::StaticGeometry *geo)
|
||||
{
|
||||
ZoneScopedN("createTownPlazza");
|
||||
struct QueueData {
|
||||
Procedural::TriangleBuffer tb;
|
||||
Ogre::Vector3 position;
|
||||
@@ -3460,6 +3462,8 @@ struct TownPlazza : TownTask {
|
||||
.getWorkQueue()
|
||||
->addMainThreadTask([queueData, localPosition,
|
||||
localRotation]() {
|
||||
ZoneScopedN(
|
||||
"createTownPlazza::MainThread");
|
||||
Ogre::Vector3 worldPlazzaCenter =
|
||||
queueData->position +
|
||||
localPosition;
|
||||
@@ -3504,6 +3508,7 @@ struct TownLots : TownTask {
|
||||
int index, Ogre::SceneNode *sceneNode,
|
||||
Ogre::StaticGeometry *geo)
|
||||
{
|
||||
ZoneScopedN("createTownLots");
|
||||
struct QueueData {
|
||||
Procedural::TriangleBuffer tb;
|
||||
Ogre::Vector3 position;
|
||||
@@ -3647,6 +3652,8 @@ struct TownLots : TownTask {
|
||||
Ogre::Root::getSingleton()
|
||||
.getWorkQueue()
|
||||
->addMainThreadTask([promise, radius]() {
|
||||
ZoneScopedN(
|
||||
"createTownLots::MainThread");
|
||||
float distance = radius;
|
||||
for (auto &lot : lots) {
|
||||
std::cout
|
||||
@@ -3877,6 +3884,7 @@ struct TownCells : TownTask {
|
||||
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask([radius,
|
||||
baseHeight,
|
||||
promise]() {
|
||||
ZoneScopedN("createCells::MainThread");
|
||||
int count = 0;
|
||||
for (auto &lot : lots) {
|
||||
float distance = radius;
|
||||
@@ -4803,6 +4811,7 @@ struct TownRoofs : TownTask {
|
||||
}
|
||||
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask([radius,
|
||||
promise]() {
|
||||
ZoneScopedN("createTownRoofs::MainThread");
|
||||
{
|
||||
int count = 0;
|
||||
for (auto lot : lots) {
|
||||
@@ -5862,6 +5871,7 @@ void registerTownNPCs(flecs::entity e)
|
||||
void createTown(flecs::entity e, Ogre::SceneNode *sceneNode,
|
||||
Ogre::StaticGeometry *geo)
|
||||
{
|
||||
ZoneScopedN("createTown");
|
||||
std::cout << "createTown " << e.id() << std::endl;
|
||||
Ogre::MaterialPtr townMaterial = createTownMaterial(e);
|
||||
static std::vector<TownTask *> townTasks;
|
||||
@@ -5924,6 +5934,7 @@ void createTown(flecs::entity e, Ogre::SceneNode *sceneNode,
|
||||
m->wait();
|
||||
Ogre::Root::getSingleton().getWorkQueue()->addMainThreadTask(
|
||||
[geo]() {
|
||||
ZoneScopedN("createTown::MainThread");
|
||||
for (auto m : townTasks) {
|
||||
delete m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user