mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-10-29 22:45:34 +01:00
fix scene tools
This commit is contained in:
parent
3dc66de3bc
commit
15ab73909f
@ -1,5 +1,4 @@
|
|||||||
#include "./scene_tools.hpp"
|
#include "./scene_tools.hpp"
|
||||||
#include "mm/components/velocity2d_rotation.hpp"
|
|
||||||
|
|
||||||
#include <mm/engine.hpp>
|
#include <mm/engine.hpp>
|
||||||
|
|
||||||
@ -32,10 +31,11 @@
|
|||||||
namespace MM::Services {
|
namespace MM::Services {
|
||||||
|
|
||||||
bool ImGuiSceneToolsService::enable(Engine& engine, std::vector<UpdateStrategies::TaskInfo>& task_array) {
|
bool ImGuiSceneToolsService::enable(Engine& engine, std::vector<UpdateStrategies::TaskInfo>& task_array) {
|
||||||
if (!engine.tryService<MM::Services::SceneServiceInterface>()) {
|
// enable anyway
|
||||||
LOGIGS("error: no SceneServiceInterface");
|
//if (!engine.tryService<MM::Services::SceneServiceInterface>()) {
|
||||||
return false;
|
//LOGIGS("error: no SceneServiceInterface");
|
||||||
}
|
//return false;
|
||||||
|
//}
|
||||||
|
|
||||||
// setup entity editor defaults
|
// setup entity editor defaults
|
||||||
{
|
{
|
||||||
@ -102,6 +102,10 @@ namespace MM::Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImGuiSceneToolsService::renderImGui(Engine& engine) {
|
void ImGuiSceneToolsService::renderImGui(Engine& engine) {
|
||||||
|
if (engine.tryService<MM::Services::SceneServiceInterface>() == nullptr) {
|
||||||
|
return; // no scene, nothing to see
|
||||||
|
}
|
||||||
|
|
||||||
auto& scene = engine.tryService<MM::Services::SceneServiceInterface>()->getScene();
|
auto& scene = engine.tryService<MM::Services::SceneServiceInterface>()->getScene();
|
||||||
|
|
||||||
if (_show_scene_metrics) {
|
if (_show_scene_metrics) {
|
||||||
|
Loading…
Reference in New Issue
Block a user