Utility/Image: Clean memory managing

Former-commit-id: 15312493a66ea26266029a45cc3aa22cc83386eb
This commit is contained in:
Lynix
2015-06-13 00:42:43 +02:00
parent 4f04795ef6
commit 310dcf40b1
2 changed files with 81 additions and 122 deletions

View File

@@ -121,11 +121,12 @@ class NAZARA_API NzImage : public NzAbstractImage, public NzRefCounted, public N
struct SharedImage
{
SharedImage(unsigned short RefCount, nzImageType Type, nzPixelFormat Format, nzUInt8 LevelCount = 1, nzUInt8** Pixels = nullptr, unsigned int Width = 1, unsigned int Height = 1, unsigned int Depth = 1) :
using PixelContainer = std::vector<std::unique_ptr<nzUInt8[]>>;
SharedImage(unsigned short RefCount, nzImageType Type, nzPixelFormat Format, PixelContainer&& Levels, unsigned int Width, unsigned int Height, unsigned int Depth) :
type(Type),
format(Format),
levelCount(LevelCount),
pixels(Pixels),
levels(std::move(Levels)),
depth(Depth),
height(Height),
width(Width),
@@ -135,8 +136,7 @@ class NAZARA_API NzImage : public NzAbstractImage, public NzRefCounted, public N
nzImageType type;
nzPixelFormat format;
nzUInt8 levelCount;
nzUInt8** pixels;
PixelContainer levels;
unsigned int depth;
unsigned int height;
unsigned int width;