Completely remove irrAllocator

This commit is contained in:
sfan5
2022-12-23 19:56:21 +01:00
parent 07fd32da50
commit 05a00a8d91
6 changed files with 189 additions and 372 deletions

View File

@ -9,7 +9,6 @@
#include "position2d.h"
#include "rect.h"
#include "SColor.h"
#include "irrAllocator.h"
#include <string.h>
namespace irr
@ -44,7 +43,7 @@ public:
delete[] Data;
if (DeleteMipMapsMemory)
Allocator.deallocate(MipMapsData);
delete[] MipMapsData;
}
//! Returns the color format
@ -275,13 +274,13 @@ public:
will by copied internally.
\param deleteMemory Whether the memory is deallocated upon
destruction. */
void setMipMapsData(void* data, bool ownForeignMemory, bool deleteMemory)
void setMipMapsData(void* data, bool ownForeignMemory)
{
if (data != MipMapsData)
{
if (DeleteMipMapsMemory)
{
Allocator.deallocate(MipMapsData);
delete[] MipMapsData;
DeleteMipMapsMemory = false;
}
@ -292,7 +291,7 @@ public:
{
MipMapsData = static_cast<u8*>(data);
DeleteMipMapsMemory = deleteMemory;
DeleteMipMapsMemory = false;
}
else
{
@ -311,7 +310,7 @@ public:
dataSize += getDataSizeFromFormat(Format, width, height);
} while (width != 1 || height != 1);
MipMapsData = Allocator.allocate(dataSize);
MipMapsData = new u8[dataSize];
memcpy(MipMapsData, data, dataSize);
DeleteMipMapsMemory = true;
@ -578,7 +577,6 @@ protected:
bool DeleteMemory;
bool DeleteMipMapsMemory;
core::irrAllocator<u8> Allocator;
#if defined(IRRLICHT_sRGB)
int Format_sRGB;
#endif