This commit is contained in:
MihailRis
2024-12-18 04:13:33 +03:00
parent 5e55e20ec4
commit d745a34657
33 changed files with 209 additions and 205 deletions
+5 -5
View File
@@ -42,7 +42,7 @@ static std::shared_ptr<Label> create_label(wstringsupplier supplier) {
// TODO: move to xml
// TODO: move to xml finally
std::shared_ptr<UINode> create_debug_panel(
Engine* engine,
Engine& engine,
Level& level,
Player& player,
bool allowDebugCheats
@@ -56,8 +56,8 @@ std::shared_ptr<UINode> create_debug_panel(
static int fpsMax = fps;
static std::wstring fpsString = L"";
panel->listenInterval(0.016f, [engine]() {
fps = 1.0f / engine->getTime().getDelta();
panel->listenInterval(0.016f, [&engine]() {
fps = 1.0f / engine.getTime().getDelta();
fpsMin = std::min(fps, fpsMin);
fpsMax = std::max(fps, fpsMax);
});
@@ -84,8 +84,8 @@ std::shared_ptr<UINode> create_debug_panel(
panel->add(create_label([]() {
return L"lua-stack: " + std::to_wstring(scripting::get_values_on_stack());
}));
panel->add(create_label([=]() {
auto& settings = engine->getSettings();
panel->add(create_label([&engine]() {
auto& settings = engine.getSettings();
bool culling = settings.graphics.frustumCulling.get();
return L"frustum-culling: "+std::wstring(culling ? L"on" : L"off");
}));