mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix: optimization: PVS-Studio warning V821
Creating variables in a more localized scope can enhance performance and make the code easier to understand. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
3fa7fac4df
commit
26ff0f133a
4 changed files with 5 additions and 5 deletions
|
|
@ -246,13 +246,13 @@ void WorldRenderer::renderBlockSelection() {
|
|||
void WorldRenderer::renderLines(
|
||||
Camera* camera, Shader* linesShader, const DrawContext& pctx
|
||||
) {
|
||||
auto ctx = pctx.sub(lineBatch.get());
|
||||
linesShader->use();
|
||||
linesShader->uniformMatrix("u_projview", camera->getProjView());
|
||||
if (player->selection.vox.id != BLOCK_VOID) {
|
||||
renderBlockSelection();
|
||||
}
|
||||
if (player->debug && showEntitiesDebug) {
|
||||
auto ctx = pctx.sub(lineBatch.get());
|
||||
bool culling = engine->getSettings().graphics.frustumCulling.get();
|
||||
level->entities->renderDebug(
|
||||
*lineBatch, culling ? frustumCulling.get() : nullptr, ctx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue