mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
fix: on_render called while paused
This commit is contained in:
parent
19c6a82ab2
commit
690b8f4807
5 changed files with 17 additions and 11 deletions
|
|
@ -154,7 +154,8 @@ void WorldRenderer::drawChunks(Chunks* chunks, Camera* camera, Shader* shader) {
|
|||
void WorldRenderer::renderLevel(
|
||||
const DrawContext&,
|
||||
Camera* camera,
|
||||
const EngineSettings& settings
|
||||
const EngineSettings& settings,
|
||||
bool pause
|
||||
) {
|
||||
auto assets = engine->getAssets();
|
||||
auto atlas = assets->get<Atlas>("blocks");
|
||||
|
|
@ -197,7 +198,7 @@ void WorldRenderer::renderLevel(
|
|||
drawChunks(level->chunks.get(), camera, shader);
|
||||
|
||||
shader->uniformMatrix("u_model", glm::mat4(1.0f));
|
||||
level->entities->render(assets, *modelBatch, *frustumCulling);
|
||||
level->entities->render(assets, *modelBatch, *frustumCulling, pause);
|
||||
modelBatch->render();
|
||||
|
||||
skybox->unbind();
|
||||
|
|
@ -294,7 +295,8 @@ void WorldRenderer::renderDebugLines(
|
|||
void WorldRenderer::draw(
|
||||
const DrawContext& pctx,
|
||||
Camera* camera,
|
||||
bool hudVisible,
|
||||
bool hudVisible,
|
||||
bool pause,
|
||||
PostProcessing* postProcessing
|
||||
){
|
||||
auto world = level->getWorld();
|
||||
|
|
@ -322,7 +324,7 @@ void WorldRenderer::draw(
|
|||
DrawContext ctx = wctx.sub();
|
||||
ctx.setDepthTest(true);
|
||||
ctx.setCullFace(true);
|
||||
renderLevel(ctx, camera, settings);
|
||||
renderLevel(ctx, camera, settings, pause);
|
||||
// Debug lines
|
||||
if (hudVisible){
|
||||
renderLines(camera, linesShader);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue