diff --git a/include/eepp/graphics/image.hpp b/include/eepp/graphics/image.hpp index 8871212d7..7934c4e53 100644 --- a/include/eepp/graphics/image.hpp +++ b/include/eepp/graphics/image.hpp @@ -82,7 +82,7 @@ class EE_API Image { virtual ~Image(); /** Create an empty image data */ - void Create( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA &DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); + void create( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA &DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); /** Return the pixel color from the image. \n You must have a copy of the image on local memory. For that you need to Lock the image first. */ virtual ColorA getPixel(const unsigned int& x, const unsigned int& y); diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 736dfba94..0bb7a4032 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -271,7 +271,7 @@ Image::Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, mAvoidFree(false), mLoadedFromStbi(false) { - Create( Width, Height, Channels, DefaultColor, initWithDefaultColor ); + create( Width, Height, Channels, DefaultColor, initWithDefaultColor ); } Image::Image( Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : @@ -395,7 +395,7 @@ void Image::setPixel(const unsigned int& x, const unsigned int& y, const ColorA& memcpy( &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], &Color, mChannels ); } -void Image::Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) { +void Image::create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) { mWidth = Width; mHeight = Height; mChannels = Channels; @@ -577,9 +577,10 @@ void Image::resize( const Uint32 &newWidth, const Uint32 &newHeight , EE_RESAMPL if ( NULL != resampled ) { clearCache(); - mPixels = resampled; - mWidth = newWidth; - mHeight = newHeight; + mPixels = resampled; + mWidth = newWidth; + mHeight = newHeight; + mLoadedFromStbi = false; } } } @@ -643,6 +644,7 @@ void Image::flip() { mPixels = tImg.getPixels(); mWidth = tImg.getWidth(); mHeight = tImg.getHeight(); + mLoadedFromStbi = false; tImg.avoidFreeImage( true ); }