Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for textures loosing smoothing #506

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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