Made Resource copying/moving impossible
It is still possible to copy some Resource-based classes though Former-commit-id: bbb6066f736c210015ff9fdfded7d95eb9695359
This commit is contained in:
@@ -34,11 +34,6 @@ NzResource()
|
||||
Copy(material);
|
||||
}
|
||||
|
||||
NzMaterial::NzMaterial(NzMaterial&& material)
|
||||
{
|
||||
Move(material);
|
||||
}
|
||||
|
||||
NzMaterial::~NzMaterial()
|
||||
{
|
||||
NotifyDestroy();
|
||||
@@ -613,13 +608,6 @@ NzMaterial& NzMaterial::operator=(const NzMaterial& material)
|
||||
return *this;
|
||||
}
|
||||
|
||||
NzMaterial& NzMaterial::operator=(NzMaterial&& material)
|
||||
{
|
||||
Move(material);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
NzMaterial* NzMaterial::GetDefault()
|
||||
{
|
||||
return s_defaultMaterial;
|
||||
@@ -655,36 +643,6 @@ void NzMaterial::Copy(const NzMaterial& material)
|
||||
std::memcpy(&m_shaders[0], &material.m_shaders[0], (nzShaderFlags_Max+1)*sizeof(ShaderInstance));
|
||||
}
|
||||
|
||||
void NzMaterial::Move(NzMaterial&& material)
|
||||
{
|
||||
// Copie des états de base
|
||||
m_alphaTestEnabled = material.m_alphaTestEnabled;
|
||||
m_alphaThreshold = material.m_alphaThreshold;
|
||||
m_ambientColor = material.m_ambientColor;
|
||||
m_diffuseColor = material.m_diffuseColor;
|
||||
m_diffuseSampler = material.m_diffuseSampler;
|
||||
m_lightingEnabled = material.m_lightingEnabled;
|
||||
m_shininess = material.m_shininess;
|
||||
m_specularColor = material.m_specularColor;
|
||||
m_specularSampler = material.m_specularSampler;
|
||||
m_states = material.m_states;
|
||||
m_transformEnabled = material.m_transformEnabled;
|
||||
|
||||
// Vol des références de texture
|
||||
m_alphaMap = std::move(material.m_alphaMap);
|
||||
m_diffuseMap = std::move(material.m_diffuseMap);
|
||||
m_emissiveMap = std::move(material.m_emissiveMap);
|
||||
m_heightMap = std::move(material.m_heightMap);
|
||||
m_normalMap = std::move(material.m_normalMap);
|
||||
m_specularMap = std::move(material.m_specularMap);
|
||||
|
||||
// Vol de la référence vers l'Über-Shader
|
||||
m_uberShader = std::move(material.m_uberShader);
|
||||
|
||||
// On copie les instances de shader par la même occasion
|
||||
std::memcpy(&m_shaders[0], &material.m_shaders[0], (nzShaderFlags_Max+1)*sizeof(ShaderInstance));
|
||||
}
|
||||
|
||||
void NzMaterial::GenerateShader(nzUInt32 flags) const
|
||||
{
|
||||
NzParameterList list;
|
||||
|
||||
@@ -60,12 +60,6 @@ NzTexture::NzTexture(const NzImage& image)
|
||||
LoadFromImage(image);
|
||||
}
|
||||
|
||||
NzTexture::NzTexture(NzTexture&& texture) :
|
||||
m_impl(texture.m_impl)
|
||||
{
|
||||
texture.m_impl = nullptr;
|
||||
}
|
||||
|
||||
NzTexture::~NzTexture()
|
||||
{
|
||||
Destroy();
|
||||
@@ -477,6 +471,19 @@ bool NzTexture::HasMipmaps() const
|
||||
return m_impl->levelCount > 1;
|
||||
}
|
||||
|
||||
void NzTexture::InvalidateMipmaps()
|
||||
{
|
||||
#if NAZARA_RENDERER_SAFE
|
||||
if (!m_impl)
|
||||
{
|
||||
NazaraInternalError("Texture must be valid");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_impl->mipmapsUpdated = false;
|
||||
}
|
||||
|
||||
bool NzTexture::IsValid() const
|
||||
{
|
||||
return m_impl != nullptr;
|
||||
@@ -1031,16 +1038,6 @@ unsigned int NzTexture::GetOpenGLID() const
|
||||
return m_impl->id;
|
||||
}
|
||||
|
||||
NzTexture& NzTexture::operator=(NzTexture&& texture)
|
||||
{
|
||||
Destroy();
|
||||
|
||||
m_impl = texture.m_impl;
|
||||
texture.m_impl = nullptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
unsigned int NzTexture::GetValidSize(unsigned int size)
|
||||
{
|
||||
if (NzRenderer::HasCapability(nzRendererCap_TextureNPOT))
|
||||
@@ -1277,16 +1274,3 @@ bool NzTexture::CreateTexture(bool proxy)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NzTexture::InvalidateMipmaps()
|
||||
{
|
||||
#if NAZARA_RENDERER_SAFE
|
||||
if (!m_impl)
|
||||
{
|
||||
NazaraInternalError("Texture must be valid");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_impl->mipmapsUpdated = false;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,6 @@ m_sharedImage(image.m_sharedImage)
|
||||
m_sharedImage->refCount++;
|
||||
}
|
||||
|
||||
NzImage::NzImage(NzImage&& image) noexcept :
|
||||
m_sharedImage(image.m_sharedImage)
|
||||
{
|
||||
image.m_sharedImage = &emptyImage;
|
||||
}
|
||||
|
||||
NzImage::NzImage(SharedImage* sharedImage) :
|
||||
m_sharedImage(sharedImage)
|
||||
{
|
||||
@@ -1283,13 +1277,6 @@ NzImage& NzImage::operator=(const NzImage& image)
|
||||
return *this;
|
||||
}
|
||||
|
||||
NzImage& NzImage::operator=(NzImage&& image) noexcept
|
||||
{
|
||||
std::swap(m_sharedImage, image.m_sharedImage);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void NzImage::Copy(nzUInt8* destination, const nzUInt8* source, nzUInt8 bpp, unsigned int width, unsigned int height, unsigned int depth, unsigned int dstWidth, unsigned int dstHeight, unsigned int srcWidth, unsigned int srcHeight)
|
||||
{
|
||||
if (dstWidth == 0)
|
||||
|
||||
Reference in New Issue
Block a user