From 47c321e434d85eba6bd1705f2c74c5037d7aea99 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 4 Jul 2023 17:41:41 +0200 Subject: [PATCH] Enabled linear interpolation support for ImageComponent::setRawImage() --- es-core/src/components/ImageComponent.cpp | 2 +- es-core/src/resources/TextureResource.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index 87539a5c8..97750074e 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -131,7 +131,7 @@ void ImageComponent::setImage(const std::shared_ptr& texture, b void ImageComponent::setRawImage(const unsigned char* data, size_t width, size_t height) { mTexture.reset(); - mTexture = TextureResource::get(""); + mTexture = TextureResource::get("", false, false, true, mLinearInterpolation); mTexture->initFromPixels(data, width, height); resize(); diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index c20db779e..ccc008223 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -63,6 +63,7 @@ TextureResource::TextureResource(const std::string& path, // loaded and unloaded. This would normally be a video texture, where the player // reserves a texture to later be used for the video rendering. mTextureData = std::shared_ptr(new TextureData(tile)); + mTextureData->setLinearMagnify(linearMagnify); mSize = glm::ivec2 {0.0f, 0.0f}; } sAllTextures.insert(this);