From 27fcc4e266c52550dfd6eecdaafdf0c7b8565ee5 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 12 Mar 2017 09:09:40 +0800 Subject: [PATCH] Allow custom memory management in IImage --- lib/irrlicht/include/IImage.h | 2 ++ lib/irrlicht/source/Irrlicht/CImage.cpp | 4 ++++ lib/irrlicht/source/Irrlicht/CImage.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/lib/irrlicht/include/IImage.h b/lib/irrlicht/include/IImage.h index a2a93b252..7918759b5 100644 --- a/lib/irrlicht/include/IImage.h +++ b/lib/irrlicht/include/IImage.h @@ -98,6 +98,8 @@ public: //! fills the surface with given color virtual void fill(const SColor &color) =0; + virtual void setDeleteMemory(bool val) = 0; + //! get the amount of Bits per Pixel of the given color format static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format) { diff --git a/lib/irrlicht/source/Irrlicht/CImage.cpp b/lib/irrlicht/source/Irrlicht/CImage.cpp index d5677320e..60ff3702a 100644 --- a/lib/irrlicht/source/Irrlicht/CImage.cpp +++ b/lib/irrlicht/source/Irrlicht/CImage.cpp @@ -457,6 +457,10 @@ inline SColor CImage::getPixelBox( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) cons return c; } +void CImage::setDeleteMemory(bool val) +{ + DeleteMemory = val; +} } // end namespace video } // end namespace irr diff --git a/lib/irrlicht/source/Irrlicht/CImage.h b/lib/irrlicht/source/Irrlicht/CImage.h index 82b34c776..8eb8459bc 100644 --- a/lib/irrlicht/source/Irrlicht/CImage.h +++ b/lib/irrlicht/source/Irrlicht/CImage.h @@ -103,6 +103,8 @@ public: //! fills the surface with given color virtual void fill(const SColor &color); + virtual void setDeleteMemory(bool val); + private: //! assumes format and size has been set and creates the rest