fix: PVS-Studio V522 mark false
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
@@ -154,9 +154,9 @@ std::unique_ptr<Atlas> BlocksPreview::build(
|
||||
|
||||
fbo.bind();
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
auto def = indices->blocks.get(i);
|
||||
auto def = indices->blocks.get(i); //FIXME: Potentional null pointer
|
||||
atlas->getTexture()->bind();
|
||||
builder.add(def->name, draw(cache, shader, &fbo, &batch, def, iconSize));
|
||||
builder.add(def->name, draw(cache, shader, &fbo, &batch, def, iconSize)); //-V522
|
||||
}
|
||||
fbo.unbind();
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ void Skybox::refresh(const DrawContext& pctx, float t, float mie, uint quality)
|
||||
ctx.setFramebuffer(fbo.get());
|
||||
ctx.setViewport(Viewport(size, size));
|
||||
|
||||
auto cubemap = dynamic_cast<Cubemap*>(fbo->getTexture());
|
||||
auto cubemap = dynamic_cast<Cubemap*>(fbo->getTexture()); //FIXME: Potentional null pointer
|
||||
|
||||
ready = true;
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
cubemap->bind();
|
||||
cubemap->bind(); //-V522
|
||||
shader->use();
|
||||
|
||||
const glm::vec3 xaxs[] = {
|
||||
|
||||
@@ -172,10 +172,10 @@ void WorldRenderer::setupWorldShader(
|
||||
{
|
||||
auto inventory = player->getInventory();
|
||||
ItemStack& stack = inventory->getSlot(player->getChosenSlot());
|
||||
auto item = indices->items.get(stack.getItemId());
|
||||
auto item = indices->items.get(stack.getItemId()); //FIXME: Potentional null pointer
|
||||
float multiplier = 0.5f;
|
||||
shader->uniform3f("u_torchlightColor",
|
||||
item->emission[0] / 15.0f * multiplier,
|
||||
item->emission[0] / 15.0f * multiplier, //-V522
|
||||
item->emission[1] / 15.0f * multiplier,
|
||||
item->emission[2] / 15.0f * multiplier
|
||||
);
|
||||
@@ -222,12 +222,12 @@ void WorldRenderer::renderBlockSelection() {
|
||||
const auto& selection = player->selection;
|
||||
auto indices = level->content->getIndices();
|
||||
blockid_t id = selection.vox.id;
|
||||
auto block = indices->blocks.get(id);
|
||||
auto block = indices->blocks.get(id); //FIXME: Potentional null pointer
|
||||
const glm::ivec3 pos = player->selection.position;
|
||||
const glm::vec3 point = selection.hitPosition;
|
||||
const glm::vec3 norm = selection.normal;
|
||||
|
||||
const std::vector<AABB>& hitboxes = block->rotatable
|
||||
const std::vector<AABB>& hitboxes = block->rotatable //-V522
|
||||
? block->rt.hitboxes[selection.vox.state.rotation]
|
||||
: block->hitboxes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user