mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Completely remove irrAllocator
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user