main menu glitch fix + refactor

This commit is contained in:
MihailRis
2024-05-19 10:38:30 +03:00
parent 997cff04d1
commit ffdeac5c1f
4 changed files with 72 additions and 76 deletions
+4 -1
View File
@@ -83,8 +83,11 @@ void LevelScreen::saveWorldPreview() {
// camera special copy for world preview
Camera camera = *player->camera;
camera.setFov(glm::radians(70.0f));
DrawContext pctx(nullptr, {Window::width, Window::height}, batch.get());
Viewport viewport(previewSize * 1.5, previewSize);
DrawContext ctx(nullptr, viewport, batch.get());
DrawContext ctx(&pctx, viewport, batch.get());
worldRenderer->draw(ctx, &camera, false, postProcessing.get());
auto image = postProcessing->toImage();