Enabled linear interpolation support for ImageComponent::setRawImage()

This commit is contained in:
Leon Styhre 2023-07-04 17:41:41 +02:00
parent 66bd934a61
commit 47c321e434
2 changed files with 2 additions and 1 deletions

View file

@ -131,7 +131,7 @@ void ImageComponent::setImage(const std::shared_ptr<TextureResource>& 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();

View file

@ -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<TextureData>(new TextureData(tile));
mTextureData->setLinearMagnify(linearMagnify);
mSize = glm::ivec2 {0.0f, 0.0f};
}
sAllTextures.insert(this);