Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Texture: Don't try to apply color key if image failed to load
Fixes: issue #1557
(cherry picked from commit e5ba607)
  • Loading branch information
dscharrer committed Aug 12, 2021
1 parent ce53cb5 commit f89d44b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphics/texture/Texture.cpp
Expand Up @@ -58,11 +58,11 @@ bool Texture::restore() {

m_image.load(getFileName());

if((m_flags & ApplyColorKey) && !m_image.hasAlpha()) {
if(m_image.isValid() && (m_flags & ApplyColorKey) && !m_image.hasAlpha()) {
m_image.applyColorKeyToAlpha(Color::black, config.video.colorkeyAntialiasing);
}

if(isIntensity()) {
if(m_image.isValid() && isIntensity()) {
m_image.toGrayscale();
}

Expand Down

0 comments on commit f89d44b

Please sign in to comment.