Renderer/Texture: Preserve filepath when loading image

This commit is contained in:
SirLynix 2022-11-05 00:12:01 +01:00
parent 1f4bc24685
commit 4e631da7dc
1 changed files with 3 additions and 1 deletions

View File

@ -44,13 +44,15 @@ namespace Nz
texParams.width = image.GetWidth(); texParams.width = image.GetWidth();
texParams.usageFlags = params.usageFlags; texParams.usageFlags = params.usageFlags;
std::shared_ptr<Nz::Texture> texture = params.renderDevice->InstantiateTexture(texParams); std::shared_ptr<Texture> texture = params.renderDevice->InstantiateTexture(texParams);
if (!texture->Update(image.GetConstPixels())) if (!texture->Update(image.GetConstPixels()))
{ {
NazaraError("failed to update texture"); NazaraError("failed to update texture");
return {}; return {};
} }
texture->SetFilePath(image.GetFilePath());
return texture; return texture;
} }