refactor
This commit is contained in:
@@ -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");
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user