cleanup World references

This commit is contained in:
MihailRis 2026-06-20 22:17:27 +03:00
parent ac00c561ee
commit c73b036099
18 changed files with 45 additions and 45 deletions

View file

@ -201,7 +201,7 @@ void WorldRenderer::setupWorldShader(
shader.uniform1f("u_fogCurve", settings.graphics.fogCurve.get());
shader.uniform1i("u_debugLights", lightsDebug);
shader.uniform1i("u_debugNormals", false);
shader.uniform1f("u_dayTime", level.getWorld()->getInfo().daytime);
shader.uniform1f("u_dayTime", level.getWorld().getInfo().daytime);
shader.uniform2f("u_lightDir", skybox->getLightDir());
shader.uniform1i("u_skybox", advanced_pipeline::TARGET_SKYBOX);
@ -341,7 +341,7 @@ void WorldRenderer::renderFrameClassic(
bool hudVisible,
PostProcessing& postProcessing
) {
const auto& worldInfo = level.getWorld()->getInfo();
const auto& worldInfo = level.getWorld().getInfo();
DrawContext ctx = pctx.sub();
ctx.setDepthTest(true);
@ -381,7 +381,7 @@ void WorldRenderer::renderFrameAdvanced(
PostProcessing& postProcessing
) {
const auto& settings = engine.getSettings();
const auto& worldInfo = level.getWorld()->getInfo();
const auto& worldInfo = level.getWorld().getInfo();
float fogFactor = calcFogFactor();
shadowMapping->refresh(camera, pctx, [this, &camera](Camera& shadowCamera) {
@ -401,8 +401,6 @@ void WorldRenderer::renderFrameAdvanced(
ctx.useTexture(advanced_pipeline::TARGET_COLOR, nullptr);
postProcessing.bindDepthBuffer();
// Background sky plane
skybox->draw(
level.environment, ctx, camera, worldInfo.daytime, weather.clouds()
);
@ -441,7 +439,7 @@ void WorldRenderer::renderFrame(
dirtySettings = false;
}
const auto& worldInfo = level.getWorld()->getInfo();
const auto& worldInfo = level.getWorld().getInfo();
float clouds = weather.clouds();
float random = rand() / static_cast<float>(RAND_MAX);