Skip to content

Commit

Permalink
removed some code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacey committed Sep 29, 2023
1 parent 387dba3 commit 396a2c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ bool Image::load(std::string_view _fname,bool _flipY) noexcept
int ch;
stbi_set_flip_vertically_on_load(_flipY);

unsigned char *img = stbi_load(fname, &w, &h, &ch, 0);
if(img != nullptr)

if(unsigned char *img = stbi_load(fname, &w, &h, &ch, 0); img != nullptr)
{
NGLMessage::addMessage(fmt::format("loaded {} Width {} Height {} Channels {}", fname, w, h, ch));
m_width = w;
Expand Down
5 changes: 4 additions & 1 deletion src/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ m_name{_name},m_errorExit(_exitOnError)
}
#endif
break;
case ShaderType::NONE:{}
case ShaderType::NONE:
{
// nothing to do
}
}
m_compiled = false;
m_refCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Text::Text(std::string_view _name, int _size)
Text::~Text()
{
// our dtor should clear out the textures and remove the VAO's
for(auto [c,font] : m_characters)
for(auto &[c,font] : m_characters)
{
glDeleteTextures(1, &font.textureID);
}
Expand Down

0 comments on commit 396a2c7

Please sign in to comment.