Basic graphics structure

This commit is contained in:
HOEGLER Stefan
2020-03-02 19:07:49 +01:00
parent a14237d6ce
commit 4c2535931e
16 changed files with 137 additions and 48 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ namespace Seele
: allocated(DEFAULT_ALLOC_SIZE)
, arraySize(0)
{
_data = new T[DEFAULT_ALLOC_SIZE];
_data = (T*)malloc(DEFAULT_ALLOC_SIZE * sizeof(T));
refreshIterators();
}
Array(size_t size, T value = T())
@@ -110,10 +110,10 @@ namespace Seele
if (arraySize == allocated)
{
allocated += DEFAULT_ALLOC_SIZE;
T* tempArray = new T[allocated];
void* tempArray = malloc(sizeof(T) * allocated);
std::memcpy(tempArray, _data, arraySize * sizeof(T));
delete _data;
_data = tempArray;
_data = (T*)tempArray;
}
_data[arraySize++] = item;
refreshIterators();