Renderer/Texture: Preserve filepath when loading image
This commit is contained in:
parent
1f4bc24685
commit
4e631da7dc
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue