Renamed Buffer::IsSupported to IsStorageSupported
Former-commit-id: 12309ca590820fd68ab2b15a4c41ffb554832603
This commit is contained in:
parent
d560975e09
commit
911e10fa84
|
|
@ -54,7 +54,7 @@ class NAZARA_API NzBuffer : public NzResource, NzNonCopyable
|
||||||
|
|
||||||
void Unmap() const;
|
void Unmap() const;
|
||||||
|
|
||||||
static bool IsSupported(nzDataStorage storage);
|
static bool IsStorageSupported(nzDataStorage storage);
|
||||||
static void SetBufferFactory(nzDataStorage storage, BufferFactory func);
|
static void SetBufferFactory(nzDataStorage storage, BufferFactory func);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ bool NzBuffer::Create(unsigned int size, nzDataStorage storage, nzBufferUsage us
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
// Notre buffer est-il supporté ?
|
// Notre buffer est-il supporté ?
|
||||||
if (!IsSupported(storage))
|
if (!IsStorageSupported(storage))
|
||||||
{
|
{
|
||||||
NazaraError("Buffer storage not supported");
|
NazaraError("Buffer storage not supported");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -212,13 +212,11 @@ bool NzBuffer::SetStorage(nzDataStorage storage)
|
||||||
if (m_storage == storage)
|
if (m_storage == storage)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if NAZARA_UTILITY_SAFE
|
if (!IsStorageSupported(storage))
|
||||||
if (!IsSupported(storage))
|
|
||||||
{
|
{
|
||||||
NazaraError("Storage not supported");
|
NazaraError("Storage not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void* ptr = m_impl->Map(nzBufferAccess_ReadOnly, 0, m_size);
|
void* ptr = m_impl->Map(nzBufferAccess_ReadOnly, 0, m_size);
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
|
|
@ -271,7 +269,7 @@ void NzBuffer::Unmap() const
|
||||||
NazaraWarning("Failed to unmap buffer (it's content may be undefined)"); ///TODO: Unexpected ?
|
NazaraWarning("Failed to unmap buffer (it's content may be undefined)"); ///TODO: Unexpected ?
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NzBuffer::IsSupported(nzDataStorage storage)
|
bool NzBuffer::IsStorageSupported(nzDataStorage storage)
|
||||||
{
|
{
|
||||||
return s_bufferFactories[storage] != nullptr;
|
return s_bufferFactories[storage] != nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@
|
||||||
|
|
||||||
NzMeshParams::NzMeshParams()
|
NzMeshParams::NzMeshParams()
|
||||||
{
|
{
|
||||||
if (!NzBuffer::IsSupported(storage))
|
if (!NzBuffer::IsStorageSupported(storage))
|
||||||
storage = nzDataStorage_Software;
|
storage = nzDataStorage_Software;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NzMeshParams::IsValid() const
|
bool NzMeshParams::IsValid() const
|
||||||
{
|
{
|
||||||
if (!NzBuffer::IsSupported(storage))
|
if (!NzBuffer::IsStorageSupported(storage))
|
||||||
{
|
{
|
||||||
NazaraError("Storage not supported");
|
NazaraError("Storage not supported");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue