Merge branch 'main' into headless-mode

This commit is contained in:
MihailRis
2024-12-21 09:03:30 +03:00
22 changed files with 191 additions and 63 deletions
+8 -1
View File
@@ -17,6 +17,8 @@
#include "graphics/render/WorldRenderer.hpp"
#include "graphics/ui/GUI.hpp"
#include "graphics/ui/elements/Menu.hpp"
#include "graphics/ui/GUI.hpp"
#include "frontend/ContentGfxCache.hpp"
#include "logic/LevelController.hpp"
#include "logic/PlayerController.hpp"
#include "logic/scripting/scripting.hpp"
@@ -55,7 +57,7 @@ LevelScreen::LevelScreen(Engine& engine, std::unique_ptr<Level> levelPtr)
);
frontend = std::make_unique<LevelFrontend>(
player, controller.get(), assets
player, controller.get(), assets, settings
);
worldRenderer = std::make_unique<WorldRenderer>(
engine, *frontend, *player
@@ -70,6 +72,11 @@ LevelScreen::LevelScreen(Engine& engine, std::unique_ptr<Level> levelPtr)
player->chunks->saveAndClear();
worldRenderer->clear();
}));
keepAlive(settings.graphics.denseRender.observe([=](bool) {
player->chunks->saveAndClear();
worldRenderer->clear();
frontend->getContentGfxCache().refresh();
}));
keepAlive(settings.camera.fov.observe([=](double value) {
player->fpCamera->setFov(glm::radians(value));
}));