Added Image::LoadArrayFrom* (convert an atlas to an array)
Also added Texture::LoadArrayFrom* shortcuts Former-commit-id: f3cde12d5b634c75de8745fa800c30749e0fe662
This commit is contained in:
@@ -661,6 +661,54 @@ bool NzTexture::LoadFromStream(NzInputStream& stream, const NzImageParams& param
|
||||
return LoadFromImage(image, generateMipmaps);
|
||||
}
|
||||
|
||||
bool NzTexture::LoadArrayFromFile(const NzString& filePath, const NzImageParams& imageParams, bool generateMipmaps, const NzVector2ui& atlasSize)
|
||||
{
|
||||
NzImage cubemap;
|
||||
if (!cubemap.LoadArrayFromFile(filePath, imageParams, atlasSize))
|
||||
{
|
||||
NazaraError("Failed to load cubemap");
|
||||
return false;
|
||||
}
|
||||
|
||||
return LoadFromImage(cubemap, generateMipmaps);
|
||||
}
|
||||
|
||||
bool NzTexture::LoadArrayFromImage(const NzImage& image, bool generateMipmaps, const NzVector2ui& atlasSize)
|
||||
{
|
||||
NzImage cubemap;
|
||||
if (!cubemap.LoadArrayFromImage(image, atlasSize))
|
||||
{
|
||||
NazaraError("Failed to load cubemap");
|
||||
return false;
|
||||
}
|
||||
|
||||
return LoadFromImage(cubemap, generateMipmaps);
|
||||
}
|
||||
|
||||
bool NzTexture::LoadArrayFromMemory(const void* data, std::size_t size, const NzImageParams& imageParams, bool generateMipmaps, const NzVector2ui& atlasSize)
|
||||
{
|
||||
NzImage cubemap;
|
||||
if (!cubemap.LoadArrayFromMemory(data, size, imageParams, atlasSize))
|
||||
{
|
||||
NazaraError("Failed to load cubemap");
|
||||
return false;
|
||||
}
|
||||
|
||||
return LoadFromImage(cubemap, generateMipmaps);
|
||||
}
|
||||
|
||||
bool NzTexture::LoadArrayFromStream(NzInputStream& stream, const NzImageParams& imageParams, bool generateMipmaps, const NzVector2ui& atlasSize)
|
||||
{
|
||||
NzImage cubemap;
|
||||
if (!cubemap.LoadArrayFromStream(stream, imageParams, atlasSize))
|
||||
{
|
||||
NazaraError("Failed to load cubemap");
|
||||
return false;
|
||||
}
|
||||
|
||||
return LoadFromImage(cubemap, generateMipmaps);
|
||||
}
|
||||
|
||||
bool NzTexture::LoadCubemapFromFile(const NzString& filePath, const NzImageParams& imageParams, bool generateMipmaps, const NzCubemapParams& cubemapParams)
|
||||
{
|
||||
NzImage cubemap;
|
||||
|
||||
Reference in New Issue
Block a user