diff --git a/es-core/src/resources/TextureData.h b/es-core/src/resources/TextureData.h index ed04e5d85..6a58d0aa9 100644 --- a/es-core/src/resources/TextureData.h +++ b/es-core/src/resources/TextureData.h @@ -65,8 +65,9 @@ public: void setForceRasterization(bool setting) { mForceRasterization = setting; } // Has the image been loaded but not yet been rasterized as the size was not known? - bool getPendingRasterization() { return mPendingRasterization; } + const bool getPendingRasterization() { return mPendingRasterization; } + const bool getScalable() { return mScalable; } std::vector& getRawRGBAData() { return mDataRGBA; } std::string getTextureFilePath() { return mPath; } bool tiled() { return mTile; } diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index ccff36c39..3ac592166 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -200,7 +200,9 @@ void TextureResource::rasterizeAt(float width, float height) data = mTextureData; else data = sTextureDataManager.get(this); - mSourceSize = glm::vec2 {static_cast(width), static_cast(height)}; + + if (mTextureData && mTextureData.get()->getScalable()) + mSourceSize = glm::vec2 {static_cast(width), static_cast(height)}; data->setSourceSize(static_cast(width), static_cast(height)); if (mForceLoad || mTextureData != nullptr) data->load(); diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index aed214aed..d5760af00 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -41,11 +41,16 @@ public: std::vector getRawRGBAData(); // Has the image been loaded but not yet been rasterized as the size was not known? - bool getPendingRasterization() const + const bool getPendingRasterization() const { return (mTextureData != nullptr ? mTextureData->getPendingRasterization() : false); } + const bool getScalable() const + { + return (mTextureData != nullptr ? mTextureData->getScalable() : false); + } + void setLinearMagnify(bool setting) { mTextureData->setLinearMagnify(setting); } std::string getTextureFilePath();