mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 00:10:52 +02:00
fixed pointers which were using 0 instead of NULL and syntax in resource.h
This commit is contained in:
parent
9ab6a680e9
commit
979d50f7d8
2 changed files with 7 additions and 13 deletions
|
@ -95,7 +95,7 @@ Resource::Sysmem::~Sysmem() {
|
||||||
|
|
||||||
Resource::Size Resource::Sysmem::allocate(Size size) {
|
Resource::Size Resource::Sysmem::allocate(Size size) {
|
||||||
if (size != _size) {
|
if (size != _size) {
|
||||||
Byte* newData = 0;
|
Byte* newData = NULL;
|
||||||
Size newSize = 0;
|
Size newSize = 0;
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
Size allocated = allocateMemory(&newData, size);
|
Size allocated = allocateMemory(&newData, size);
|
||||||
|
@ -116,7 +116,7 @@ Resource::Size Resource::Sysmem::allocate(Size size) {
|
||||||
|
|
||||||
Resource::Size Resource::Sysmem::resize(Size size) {
|
Resource::Size Resource::Sysmem::resize(Size size) {
|
||||||
if (size != _size) {
|
if (size != _size) {
|
||||||
Byte* newData = 0;
|
Byte* newData = NULL;
|
||||||
Size newSize = 0;
|
Size newSize = 0;
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
Size allocated = allocateMemory(&newData, size);
|
Size allocated = allocateMemory(&newData, size);
|
||||||
|
@ -196,11 +196,11 @@ Buffer& Buffer::operator=(const Buffer& buf) {
|
||||||
Buffer::~Buffer() {
|
Buffer::~Buffer() {
|
||||||
if (_sysmem) {
|
if (_sysmem) {
|
||||||
delete _sysmem;
|
delete _sysmem;
|
||||||
_sysmem = 0;
|
_sysmem = NULL;
|
||||||
}
|
}
|
||||||
if (_gpuObject) {
|
if (_gpuObject) {
|
||||||
delete _gpuObject;
|
delete _gpuObject;
|
||||||
_gpuObject = 0;
|
_gpuObject = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,8 @@ protected:
|
||||||
inline const Byte* readData() const { return _data; }
|
inline const Byte* readData() const { return _data; }
|
||||||
inline Byte* editData() { _stamp++; return _data; }
|
inline Byte* editData() { _stamp++; return _data; }
|
||||||
|
|
||||||
template< typename T >
|
template< typename T > const T* read() const { return reinterpret_cast< T* > ( _data ); }
|
||||||
const T* read() const { return reinterpret_cast< T* > ( _data ); }
|
template< typename T > T* edit() { _stamp++; return reinterpret_cast< T* > ( _data ); }
|
||||||
template< typename T >
|
|
||||||
T* edit() { _stamp++; return reinterpret_cast< T* > ( _data ); }
|
|
||||||
|
|
||||||
// Access the current version of the sysmem, used to compare if copies are in sync
|
// Access the current version of the sysmem, used to compare if copies are in sync
|
||||||
inline Stamp getStamp() const { return _stamp; }
|
inline Stamp getStamp() const { return _stamp; }
|
||||||
|
@ -210,11 +208,7 @@ public:
|
||||||
|
|
||||||
//Template iterator with random access on the buffer sysmem
|
//Template iterator with random access on the buffer sysmem
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Iterator : public std::iterator<std::random_access_iterator_tag,
|
class Iterator : public std::iterator<std::random_access_iterator_tag, T, Index, T*, T&>
|
||||||
T,
|
|
||||||
Index,
|
|
||||||
T*,
|
|
||||||
T&>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue