Skip to content

Commit

Permalink
Fix for textures loosing smoothing (#506)
Browse files Browse the repository at this point in the history
Calling m_texture = sf::Texture(); requires smoothing to be reapplied. This commit also fixes missing smoothing on SWF objects.
  • Loading branch information
oomek authored and mickelson committed Nov 14, 2018
1 parent 23bb5a9 commit 0f50c8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/fe_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ bool FeTextureContainer::load_with_ffmpeg(
else
m_movie_status = 1; // 1=on track to be played

m_texture.setSmooth( m_smooth );
m_file_name = loaded_name;
return true;
}
Expand Down Expand Up @@ -437,6 +438,7 @@ bool FeTextureContainer::try_to_load(
}
}

m_swf->set_smooth( m_smooth );
m_file_name = loaded_name;
return true;
}
Expand Down Expand Up @@ -480,6 +482,7 @@ bool FeTextureContainer::try_to_load(
#if ( SFML_VERSION_INT >= FE_VERSION_INT( 2, 4, 0 ))
if ( m_mipmap ) m_texture.generateMipmap();
#endif
m_texture.setSmooth( m_smooth );
m_file_name = loaded_name;
return true;
}
Expand All @@ -504,6 +507,7 @@ bool FeTextureContainer::try_to_load(
#if ( SFML_VERSION_INT >= FE_VERSION_INT( 2, 4, 0 ))
if ( m_mipmap ) m_texture.generateMipmap();
#endif
m_texture.setSmooth( m_smooth );
m_file_name = loaded_name;
return true;
}
Expand Down Expand Up @@ -1028,6 +1032,7 @@ void FeTextureContainer::clear()

void FeTextureContainer::set_smooth( bool s )
{
m_smooth = s;
#ifndef NO_SWF
if ( m_swf )
m_swf->set_smooth( s );
Expand All @@ -1037,14 +1042,14 @@ void FeTextureContainer::set_smooth( bool s )

bool FeTextureContainer::get_smooth() const
{
return m_texture.isSmooth();
return m_smooth;
}

void FeTextureContainer::set_mipmap( bool m )
{
m_mipmap = m;
#if ( SFML_VERSION_INT >= FE_VERSION_INT( 2, 4, 0 ))
if ( m_mipmap && !m_movie) m_texture.generateMipmap();;
if ( m_mipmap && !m_movie) m_texture.generateMipmap();
#endif
}

Expand Down
1 change: 1 addition & 0 deletions src/fe_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class FeTextureContainer : public FeBaseTextureContainer
int m_movie_status; // 0=no play, 1=ready to play, >=PLAY_COUNT=playing
FeVideoFlags m_video_flags;
bool m_mipmap;
bool m_smooth;
};

class FeSurfaceTextureContainer : public FeBaseTextureContainer, public FePresentableParent
Expand Down

0 comments on commit 0f50c8e

Please sign in to comment.