Gl cleanup clang-tidy fixes

This commit is contained in:
Dan Paulat 2025-05-09 18:11:49 -05:00
parent d5e5019811
commit 4955dcd2c9
5 changed files with 15 additions and 6 deletions

View file

@ -788,6 +788,7 @@ void MainWindowImpl::ConfigureMapLayout()
{ {
if (maps_.at(mapIndex) == nullptr) if (maps_.at(mapIndex) == nullptr)
{ {
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory): Owned by parent
maps_[mapIndex] = maps_[mapIndex] =
new map::MapWidget(mapIndex, settings_, glContext); new map::MapWidget(mapIndex, settings_, glContext);
} }

View file

@ -176,7 +176,13 @@ void ColorTableLayer::Render(
gl.glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); gl.glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
gl.glDrawArrays(GL_TRIANGLES, 0, 6); gl.glDrawArrays(GL_TRIANGLES, 0, 6);
mapContext->set_color_table_margins(QMargins {0, 0, 0, 10}); static constexpr int kLeftMargin_ = 0;
static constexpr int kTopMargin_ = 0;
static constexpr int kRightMargin_ = 0;
static constexpr int kBottomMargin_ = 10;
mapContext->set_color_table_margins(
QMargins {kLeftMargin_, kTopMargin_, kRightMargin_, kBottomMargin_});
} }
else else
{ {

View file

@ -131,8 +131,9 @@ void DrawLayer::RenderWithoutImGui(
p->textureAtlas_ = glContext->GetTextureAtlas(); p->textureAtlas_ = glContext->GetTextureAtlas();
// Determine if the texture atlas changed since last render // Determine if the texture atlas changed since last render
std::uint64_t newTextureAtlasBuildCount = glContext->texture_buffer_count(); const std::uint64_t newTextureAtlasBuildCount =
bool textureAtlasChanged = glContext->texture_buffer_count();
const bool textureAtlasChanged =
newTextureAtlasBuildCount != p->textureAtlasBuildCount_; newTextureAtlasBuildCount != p->textureAtlasBuildCount_;
// Set OpenGL blend mode for transparency // Set OpenGL blend mode for transparency

View file

@ -33,6 +33,7 @@
#include <algorithm> #include <algorithm>
#include <ranges> #include <ranges>
#include <set> #include <set>
#include <utility>
#include <backends/imgui_impl_opengl3.h> #include <backends/imgui_impl_opengl3.h>
#include <backends/imgui_impl_qt.hpp> #include <backends/imgui_impl_qt.hpp>
@ -70,13 +71,13 @@ class MapWidgetImpl : public QObject
public: public:
explicit MapWidgetImpl(MapWidget* widget, explicit MapWidgetImpl(MapWidget* widget,
std::size_t id, std::size_t id,
const QMapLibre::Settings& settings, QMapLibre::Settings settings,
std::shared_ptr<gl::GlContext> glContext) : std::shared_ptr<gl::GlContext> glContext) :
id_ {id}, id_ {id},
uuid_ {boost::uuids::random_generator()()}, uuid_ {boost::uuids::random_generator()()},
glContext_ {std::move(glContext)}, glContext_ {std::move(glContext)},
widget_ {widget}, widget_ {widget},
settings_(settings), settings_(std::move(settings)),
map_(), map_(),
layerList_ {}, layerList_ {},
imGuiRendererInitialized_ {false}, imGuiRendererInitialized_ {false},

View file

@ -513,7 +513,7 @@ void OverlayLayer::Render(const std::shared_ptr<MapContext>& mapContext,
p->icons_->SetIconVisible(p->mapCenterIcon_, p->icons_->SetIconVisible(p->mapCenterIcon_,
generalSettings.show_map_center().GetValue()); generalSettings.show_map_center().GetValue());
QMargins colorTableMargins = mapContext->color_table_margins(); const QMargins colorTableMargins = mapContext->color_table_margins();
if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_) if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_)
{ {
// Draw map logo with a 10x10 indent from the bottom left // Draw map logo with a 10x10 indent from the bottom left