Skip to content

Commit

Permalink
Fix inconsistencies in sf::Texture move and swap
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo authored and ChrisThrasher committed Jun 8, 2024
1 parent 52ce862 commit 8acb9d9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/SFML/Graphics/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ m_texture(std::exchange(right.m_texture, 0)),
m_isSmooth(std::exchange(right.m_isSmooth, false)),
m_sRgb(std::exchange(right.m_sRgb, false)),
m_isRepeated(std::exchange(right.m_isRepeated, false)),
m_pixelsFlipped(std::exchange(right.m_pixelsFlipped, false)),
m_fboAttachment(std::exchange(right.m_fboAttachment, false)),
m_hasMipmap(std::exchange(right.m_hasMipmap, false)),
m_cacheId(std::exchange(right.m_cacheId, 0))
{
}
Expand Down Expand Up @@ -147,7 +149,9 @@ Texture& Texture::operator=(Texture&& right) noexcept
m_isSmooth = std::exchange(right.m_isSmooth, false);
m_sRgb = std::exchange(right.m_sRgb, false);
m_isRepeated = std::exchange(right.m_isRepeated, false);
m_pixelsFlipped = std::exchange(right.m_pixelsFlipped, false);
m_fboAttachment = std::exchange(right.m_fboAttachment, false);
m_hasMipmap = std::exchange(right.m_hasMipmap, false);
m_cacheId = std::exchange(right.m_cacheId, 0);
return *this;
}
Expand Down Expand Up @@ -947,9 +951,7 @@ void Texture::swap(Texture& right) noexcept
std::swap(m_pixelsFlipped, right.m_pixelsFlipped);
std::swap(m_fboAttachment, right.m_fboAttachment);
std::swap(m_hasMipmap, right.m_hasMipmap);

m_cacheId = TextureImpl::getUniqueId();
right.m_cacheId = TextureImpl::getUniqueId();
std::swap(m_cacheId, right.m_cacheId);
}


Expand Down

0 comments on commit 8acb9d9

Please sign in to comment.