Texture are no longer associated with a RenderTexture
Former-commit-id: 4430c36afd081f20b89322ca1e0c2b8c4ef73ce5
This commit is contained in:
@@ -17,7 +17,6 @@ struct NzTextureImpl
|
||||
nzImageType type;
|
||||
nzPixelFormat format;
|
||||
nzUInt8 levelCount;
|
||||
NzRenderTexture* renderTexture = nullptr;
|
||||
bool mipmapping = false;
|
||||
bool mipmapsUpdated = true;
|
||||
unsigned int depth;
|
||||
@@ -529,19 +528,6 @@ bool NzTexture::IsCubemap() const
|
||||
return m_impl->type == nzImageType_Cubemap;
|
||||
}
|
||||
|
||||
bool NzTexture::IsTarget() const
|
||||
{
|
||||
#if NAZARA_RENDERER_SAFE
|
||||
if (!m_impl)
|
||||
{
|
||||
NazaraError("Texture must be valid");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_impl->renderTexture != nullptr;
|
||||
}
|
||||
|
||||
bool NzTexture::IsValid() const
|
||||
{
|
||||
return m_impl != nullptr;
|
||||
@@ -1032,12 +1018,6 @@ bool NzTexture::Update(const nzUInt8* pixels, const NzBoxui& box, unsigned int s
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_impl->renderTexture)
|
||||
{
|
||||
NazaraError("Texture is a target, it cannot be updated");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_impl->type == nzImageType_Cubemap)
|
||||
{
|
||||
NazaraError("Update is not designed for cubemaps, use UpdateFace instead");
|
||||
@@ -1184,12 +1164,6 @@ bool NzTexture::UpdateFace(nzCubemapFace face, const nzUInt8* pixels, const NzRe
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_impl->renderTexture)
|
||||
{
|
||||
NazaraError("Texture is a target, it cannot be updated");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_impl->type != nzImageType_Cubemap)
|
||||
{
|
||||
NazaraError("UpdateFace is designed for cubemaps, use Update instead");
|
||||
@@ -1398,29 +1372,3 @@ bool NzTexture::IsTypeSupported(nzImageType type)
|
||||
NazaraError("Image type not handled (0x" + NzString::Number(type, 16) + ')');
|
||||
return false;
|
||||
}
|
||||
|
||||
NzRenderTexture* NzTexture::GetRenderTexture() const
|
||||
{
|
||||
#ifdef NAZARA_DEBUG
|
||||
if (!m_impl)
|
||||
{
|
||||
NazaraInternalError("Texture must be valid");
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_impl->renderTexture;
|
||||
}
|
||||
|
||||
void NzTexture::SetRenderTexture(NzRenderTexture* renderTexture)
|
||||
{
|
||||
#ifdef NAZARA_DEBUG
|
||||
if (!m_impl)
|
||||
{
|
||||
NazaraInternalError("Texture must be valid");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_impl->renderTexture = renderTexture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user