move Lighting instance to ChunksController

This commit is contained in:
MihailRis
2024-12-17 05:13:49 +03:00
parent c5049d0e24
commit b7664b4188
14 changed files with 60 additions and 61 deletions
+4 -6
View File
@@ -23,14 +23,14 @@ Level::Level(
const Content* content,
EngineSettings& settings
)
: world(std::move(worldPtr)),
: settings(settings),
world(std::move(worldPtr)),
content(content),
chunksStorage(std::make_unique<GlobalChunks>(this)),
physics(std::make_unique<PhysicsSolver>(glm::vec3(0, -22.6f, 0))),
events(std::make_unique<LevelEvents>()),
entities(std::make_unique<Entities>(this)),
players(std::make_unique<Players>(this)),
settings(settings) {
players(std::make_unique<Players>(this)) {
const auto& worldInfo = world->getInfo();
auto& cameraIndices = content->getIndices(ResourceType::CAMERA);
for (size_t i = 0; i < cameraIndices.size(); i++) {
@@ -65,11 +65,9 @@ Level::Level(
(settings.chunks.loadDistance.get() + settings.chunks.padding.get()) *
2;
chunks = std::make_unique<Chunks>(
matrixSize, matrixSize, 0, 0, world->wfile.get(), this
matrixSize, matrixSize, 0, 0, events.get(), content->getIndices()
);
lighting = std::make_unique<Lighting>(content, chunks.get());
inventories = std::make_unique<Inventories>(*this);
}