Adapted more debugging with Tracy, characters update
This commit is contained in:
@@ -47,6 +47,7 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
GUIListener()
|
||||
: Ogre::RenderTargetListener()
|
||||
{
|
||||
ZoneScoped;
|
||||
_midFont = createFont("midFont", "General",
|
||||
"Jupiteroid-Regular.ttf", 24.0f);
|
||||
_smallFont = createFont("smallFont", "General",
|
||||
@@ -67,7 +68,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
const Ogre::String &group,
|
||||
const Ogre::String &ttfname, float fontSize)
|
||||
{
|
||||
Ogre::FontPtr ret =
|
||||
ZoneScoped;
|
||||
Ogre::FontPtr ret =
|
||||
Ogre::FontManager::getSingleton().create(name, group);
|
||||
ret->setType(Ogre::FontType::FT_TRUETYPE);
|
||||
ret->setSource(ttfname);
|
||||
@@ -85,6 +87,7 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void buttons_panel()
|
||||
{
|
||||
ZoneScoped;
|
||||
bool enableDebugRender = ECS::get<EngineData>().enableDbgDraw;
|
||||
ImVec2 size = ImGui::GetMainViewport()->Size;
|
||||
float window_width = size.x * 0.2f;
|
||||
@@ -122,7 +125,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void create_entity_node(const Ogre::String &name, int key)
|
||||
{
|
||||
Ogre::Entity *ent =
|
||||
ZoneScoped;
|
||||
Ogre::Entity *ent =
|
||||
ECS::get().get<EngineData>().mScnMgr->createEntity(
|
||||
name);
|
||||
Ogre::SceneNode *pnode =
|
||||
@@ -149,7 +153,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void buildings_editor()
|
||||
{
|
||||
int i;
|
||||
ZoneScoped;
|
||||
int i;
|
||||
ImVec2 size = ImGui::GetMainViewport()->Size;
|
||||
float window_width = size.x * 0.2f;
|
||||
if (window_width > panel_width)
|
||||
@@ -176,7 +181,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void position_editor(Ogre::SceneNode *node)
|
||||
{
|
||||
Ogre::Vector3 position = node->getPosition();
|
||||
ZoneScoped;
|
||||
Ogre::Vector3 position = node->getPosition();
|
||||
float v[3] = { position.x, position.y, position.z };
|
||||
ImGui::InputFloat3("position", v);
|
||||
position.x = v[0];
|
||||
@@ -186,7 +192,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void orientation_editor(Ogre::SceneNode *node)
|
||||
{
|
||||
Ogre::Quaternion q = node->getOrientation();
|
||||
ZoneScoped;
|
||||
Ogre::Quaternion q = node->getOrientation();
|
||||
float yaw = Ogre::Radian(q.getYaw()).valueDegrees();
|
||||
float pitch = Ogre::Radian(q.getPitch()).valueDegrees();
|
||||
float roll = Ogre::Radian(q.getRoll()).valueDegrees();
|
||||
@@ -205,7 +212,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void attachments_editor(Ogre::SceneNode *node)
|
||||
{
|
||||
const Ogre::SceneNode::ObjectMap &pmap =
|
||||
ZoneScoped;
|
||||
const Ogre::SceneNode::ObjectMap &pmap =
|
||||
node->getAttachedObjects();
|
||||
int i;
|
||||
for (i = 0; i < pmap.size(); i++) {
|
||||
@@ -219,6 +227,7 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
Ogre::Vector2 projectToScreen(const Ogre::Vector3 &worldPoint)
|
||||
{
|
||||
ZoneScoped;
|
||||
ImVec2 size = ImGui::GetMainViewport()->Size;
|
||||
float width = size.x;
|
||||
float height = size.y;
|
||||
@@ -243,7 +252,8 @@ struct GUIListener : public Ogre::RenderTargetListener {
|
||||
}
|
||||
void preview(const Ogre::RenderTargetViewportEvent &evt)
|
||||
{
|
||||
int i;
|
||||
ZoneScoped;
|
||||
int i;
|
||||
Ogre::ImGuiOverlay::NewFrame();
|
||||
|
||||
if (ECS::get().get<EngineData>().startupDelay > 0.0f &&
|
||||
@@ -744,6 +754,7 @@ GUIModule::GUIModule(flecs::world &ecs)
|
||||
|
||||
void GUIModule::configure()
|
||||
{
|
||||
ZoneScoped;
|
||||
ECS::get().set<GUIData>({ nullptr, {}, nullptr });
|
||||
const RenderWindow &window = ECS::get<RenderWindow>();
|
||||
GUIData &gui = ECS::get_mut<GUIData>();
|
||||
|
||||
Reference in New Issue
Block a user