- made the vertexes array VM friendly.

This commit is contained in:
Christoph Oelckers 2017-01-09 00:46:16 +01:00
commit 12037fdc95
17 changed files with 190 additions and 169 deletions

View file

@ -553,6 +553,13 @@ public:
this->Count = 0;
this->Array = NULL;
}
TStaticArray(TStaticArray<T> &&other)
{
this->Array = other.Array;
this->Count = other.Count;
other.Array = nullptr;
other.Count = 0;
}
// This is not supposed to be copyable.
TStaticArray(const TStaticArray<T> &other) = delete;
@ -564,7 +571,7 @@ public:
{
if (this->Array) delete[] this->Array;
this->Count = 0;
this->Array = NULL;
this->Array = nullptr;
}
void Alloc(unsigned int amount)
{
@ -579,6 +586,15 @@ public:
memcpy(this->Array, other.Array, this->Count * sizeof(T));
return *this;
}
TStaticArray &operator=(TStaticArray &&other)
{
if (this->Array) delete[] this->Array;
this->Array = other.Array;
this->Count = other.Count;
other.Array = nullptr;
other.Count = 0;
return *this;
}
};