- made the vertexes array VM friendly.
This commit is contained in:
parent
f78927500e
commit
12037fdc95
17 changed files with 190 additions and 169 deletions
18
src/tarray.h
18
src/tarray.h
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue