Code refactor: add generic Cycles node infrastructure.

Differential Revision: https://developer.blender.org/D2016
This commit is contained in:
2016-05-07 19:47:37 +02:00
parent 841d008b98
commit ec51175f1f
20 changed files with 1000 additions and 18 deletions

View File

@@ -153,7 +153,7 @@ public:
mem_free(data_, capacity_);
}
bool operator==(const vector<T>& other)
bool operator==(const array<T>& other) const
{
if(datasize_ != other.datasize_) {
return false;
@@ -162,6 +162,21 @@ public:
return memcmp(data_, other.data_, datasize_*sizeof(T)) == 0;
}
void steal_data(array& from)
{
if(this != &from) {
clear();
data_ = from.data_;
datasize_ = from.datasize_;
capacity_ = from.capacity_;
from.data_ = NULL;
from.datasize_ = 0;
from.capacity_ = 0;
}
}
T* resize(size_t newsize)
{
if(newsize == 0) {