Browse Source

renamed MemoryTexture to Image
added custom image loader

dmuratshin 9 years ago
parent
commit
c3e5a80b87

+ 2 - 2
oxygine/SDL/win32/oxygine.vcxproj

@@ -166,7 +166,7 @@
     <ClCompile Include="..\..\src\MaskedRenderer.cpp" />
     <ClCompile Include="..\..\src\MaskedSprite.cpp" />
     <ClCompile Include="..\..\src\Material.cpp" />
-    <ClCompile Include="..\..\src\MemoryTexture.cpp" />
+    <ClCompile Include="..\..\src\Image.cpp" />
     <ClCompile Include="..\..\src\minizip\ioapi.c" />
     <ClCompile Include="..\..\src\minizip\ioapi_mem.c" />
     <ClCompile Include="..\..\src\minizip\unzip.c" />
@@ -281,7 +281,7 @@
     <ClInclude Include="..\..\src\MaskedSprite.h" />
     <ClInclude Include="..\..\src\Material.h" />
     <ClInclude Include="..\..\src\math\OBBox.h" />
-    <ClInclude Include="..\..\src\MemoryTexture.h" />
+    <ClInclude Include="..\..\src\Image.h" />
     <ClInclude Include="..\..\src\minizip\ioapi.h" />
     <ClInclude Include="..\..\src\minizip\ioapi_mem.h" />
     <ClInclude Include="..\..\src\minizip\unzip.h" />

+ 6 - 6
oxygine/SDL/win32/oxygine.vcxproj.filters

@@ -237,9 +237,6 @@
     <ClCompile Include="..\..\src\MaskedSprite.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\MemoryTexture.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\PointerState.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -351,6 +348,9 @@
     <ClCompile Include="..\..\src\key.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\Image.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\closure\closure.h">
@@ -608,9 +608,6 @@
     <ClInclude Include="..\..\src\MaskedSprite.h">
       <Filter>src</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\MemoryTexture.h">
-      <Filter>src</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\src\oxygine-framework.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -749,6 +746,9 @@
     <ClInclude Include="..\..\src\key.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\Image.h">
+      <Filter>src</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="ReadMe.txt" />

+ 42 - 28
oxygine/src/MemoryTexture.cpp → oxygine/src/Image.cpp

@@ -1,4 +1,4 @@
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "math/Rect.h"
 #include "core/ImageDataOperations.h"
 #include "core/file.h"
@@ -29,7 +29,7 @@ namespace oxygine
 {
 
 
-    bool loadImageNotSupported(MemoryTexture& mt, void* data, int nSize, bool premultiplied, TextureFormat format)
+    bool loadImageNotSupported(Image& mt, void* data, int nSize, bool premultiplied, TextureFormat format)
     {
         return false;
     }
@@ -215,7 +215,7 @@ namespace oxygine
         }
     };
 
-    bool _initWithJpgData(MemoryTexture& mt, void* data, int nSize, bool premultiplied, TextureFormat format)
+    bool _initWithJpgData(Image& mt, void* data, int nSize, bool premultiplied, TextureFormat format)
     {
         bool bRet = false;
 
@@ -347,7 +347,7 @@ namespace oxygine
 
 
 
-    bool _initWithPngData(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
+    bool _initWithPngData(Image& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
     {
         LOGD("reading png...");
         bool bRet = false;
@@ -491,48 +491,55 @@ namespace oxygine
 #endif
 
 
+    cbLoadImageFromBuffer _loadCustomImage = loadImageNotSupported;
 
 
-    void setJpegLoader(cbLoadImageFromBuffer cb)
+
+    void setJpegImageLoader(cbLoadImageFromBuffer cb)
     {
         _loadJpegImage = cb;
     }
 
-    void setPngLoader(cbLoadImageFromBuffer cb)
+    void setPngImageLoader(cbLoadImageFromBuffer cb)
     {
         _loadPngImage = cb;
     }
 
-    bool loadPngImage(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
+    void setCustomImageLoader(cbLoadImageFromBuffer cb)
+    {
+        _loadCustomImage = cb;
+    }
+
+    bool loadPngImage(Image& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
     {
         bool s = _loadPngImage(mt, pData, nDatalen, premultiplied, format);
         return s;
     }
 
-    bool loadJpegImage(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
+    bool loadJpegImage(Image& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format)
     {
         bool s = _loadJpegImage(mt, pData, nDatalen, premultiplied, format);
         return s;
     }
 
 
-    MemoryTexture::MemoryTexture(): _offset(0)
+    Image::Image(): _offset(0)
     {
 
     }
 
-    MemoryTexture::~MemoryTexture()
+    Image::~Image()
     {
 
     }
 
-    void MemoryTexture::cleanup()
+    void Image::cleanup()
     {
         _buffer.clear();
         _image = ImageData();
     }
 
-    void MemoryTexture::convert(MemoryTexture& dest, TextureFormat format)
+    void Image::convert(Image& dest, TextureFormat format)
     {
         dest.init(getWidth(), getHeight(), format);
         ImageData src = lock();
@@ -541,14 +548,14 @@ namespace oxygine
         operations::blit(src, dst);
     }
 
-    void MemoryTexture::fill_zero()
+    void Image::fill_zero()
     {
         if (_buffer.empty())
             return;
         memset(&_buffer.front(), 0, _buffer.size());
     }
 
-    bool MemoryTexture::init(file::buffer& buffer, bool premultiplied, TextureFormat format)
+    bool Image::init(file::buffer& buffer, bool premultiplied, TextureFormat format)
     {
         cleanup();
 
@@ -706,12 +713,19 @@ namespace oxygine
                     break;
                 }
                 break;
+
+                case IT_UNKNOWN:
+                {
+                    if (_loadCustomImage(*this, (void*)buffer.getData(), buffer.getSize(), premultiplied, format))
+                        return true;
+                }
+                break;
                 default:
                     break;
             }
         }
 
-        log::warning("MemoryTexture. can't unpack data unknown file format");
+        log::warning("Image. can't unpack data unknown file format");
 
         init(16, 16, TF_R8G8B8A8);
         fill_zero();
@@ -719,13 +733,13 @@ namespace oxygine
         return false;
     }
 
-    void MemoryTexture::init(const ImageData& src)
+    void Image::init(const ImageData& src)
     {
         init(src.w, src.h, src.format);
         updateRegion(0, 0, src);
     }
 
-    void MemoryTexture::init(int w, int h, TextureFormat Format)
+    void Image::init(int w, int h, TextureFormat Format)
     {
         int bytesPerPixel = getBytesPerPixel(Format);
 
@@ -735,27 +749,27 @@ namespace oxygine
 
 
 
-    int MemoryTexture::getWidth() const
+    int Image::getWidth() const
     {
         return _image.w;
     }
 
-    int MemoryTexture::getHeight() const
+    int Image::getHeight() const
     {
         return _image.h;
     }
 
-    const Point& MemoryTexture::getSize() const
+    const Point& Image::getSize() const
     {
         return *((Point*)&_image.w);
     }
 
-    TextureFormat MemoryTexture::getFormat() const
+    TextureFormat Image::getFormat() const
     {
         return _image.format;
     }
 
-    ImageData MemoryTexture::lock(lock_flags, const Rect* pRect)
+    ImageData Image::lock(lock_flags, const Rect* pRect)
     {
         Rect rect(0, 0, _image.w, _image.h);
         if (pRect)
@@ -774,22 +788,22 @@ namespace oxygine
         return ImageData(rect.getWidth(), rect.getHeight(), _image.pitch, _image.format, ptr);
     }
 
-    ImageData MemoryTexture::lock(const Rect* pRect)
+    ImageData Image::lock(const Rect* pRect)
     {
         return lock(lock_read | lock_write, pRect);
     }
 
-    ImageData MemoryTexture::lock(const Rect& rect)
+    ImageData Image::lock(const Rect& rect)
     {
         return lock(lock_read | lock_write, &rect);
     }
 
-    void MemoryTexture::unlock()
+    void Image::unlock()
     {
 
     }
 
-    void MemoryTexture::updateRegion(int x, int y, const ImageData& src)
+    void Image::updateRegion(int x, int y, const ImageData& src)
     {
         Rect r(x, y, src.w, src.h);
         ImageData dest = lock(&r);
@@ -797,13 +811,13 @@ namespace oxygine
         unlock();
     }
 
-    void MemoryTexture::apply(const Rect*)
+    void Image::apply(const Rect*)
     {
 
     }
 
 
-    void MemoryTexture::swap(MemoryTexture& r)
+    void Image::swap(Image& r)
     {
         ImageData copy = _image;
         _image = r._image;

+ 65 - 0
oxygine/src/Image.h

@@ -0,0 +1,65 @@
+#pragma once
+#include "oxygine_include.h"
+#include "core/Texture.h"
+#include "core/file.h"
+
+namespace oxygine
+{
+    enum ImageType
+    {
+        IT_UNKNOWN,
+        IT_PNG,
+        IT_PKM,
+        IT_PVR2,
+        IT_PVR,
+        IT_TGA,
+        IT_JPEG
+    };
+
+    bool getImageInfo(const void* data, size_t size, const char* name, ImageType& type, int& width, int& height);
+
+    DECLARE_SMART(Image, spImage);
+
+    class Image : public Texture
+    {
+    public:
+        Image();
+        ~Image();
+
+        bool init(file::buffer& bf, bool premultiplied = false, TextureFormat format = TF_UNDEFINED);
+        void init(const ImageData& src);
+        void init(int w, int h, TextureFormat Format);
+
+        void cleanup();
+        void convert(Image& dest, TextureFormat format);
+        //void convert2pot(MemoryTexture &dest);
+
+        void fill_zero();
+
+        unsigned int    getSizeVRAM() const {return (unsigned int)_buffer.size();}
+        int             getWidth() const;
+        int             getHeight() const;
+        const Point&    getSize() const;
+        TextureFormat   getFormat() const;
+
+        ImageData   lock(lock_flags f = 0, const Rect* pRect = 0);
+        ImageData   lock(const Rect* pRect);
+        ImageData   lock(const Rect& pRect);
+        void        unlock();
+
+        void        updateRegion(int x, int y, const ImageData& data);
+        void        apply(const Rect*);
+
+        void        swap(Image& r);
+
+    private:
+        ImageData _image;
+        size_t _offset;//buffer offset
+        std::vector<unsigned char> _buffer;
+    };
+
+    typedef bool (*cbLoadImageFromBuffer)(Image& mt, void* data, int nSize, bool premultiplied, TextureFormat format);
+    void setJpegImageLoader(cbLoadImageFromBuffer);
+    void setPngImageLoader(cbLoadImageFromBuffer);
+    void setCustomImageLoader(cbLoadImageFromBuffer);
+}

+ 2 - 57
oxygine/src/MemoryTexture.h

@@ -1,64 +1,9 @@
 #pragma once
 #include "oxygine_include.h"
-#include "core/Texture.h"
-#include "core/file.h"
+#include "Image.h"
 
 namespace oxygine
 {
-    enum ImageType
-    {
-        IT_UNKNOWN,
-        IT_PNG,
-        IT_PKM,
-        IT_PVR2,
-        IT_PVR,
-        IT_TGA,
-        IT_JPEG
-    };
 
-    bool getImageInfo(const void* data, size_t size, const char* name, ImageType& type, int& width, int& height);
-
-    DECLARE_SMART(MemoryTexture, spMemoryTexture);
-
-    class MemoryTexture : public Texture
-    {
-    public:
-        MemoryTexture();
-        ~MemoryTexture();
-
-        bool init(file::buffer& bf, bool premultiplied = false, TextureFormat format = TF_UNDEFINED);
-        void init(const ImageData& src);
-        void init(int w, int h, TextureFormat Format);
-
-        void cleanup();
-        void convert(MemoryTexture& dest, TextureFormat format);
-        //void convert2pot(MemoryTexture &dest);
-
-        void fill_zero();
-
-        unsigned int    getSizeVRAM() const {return (unsigned int)_buffer.size();}
-        int             getWidth() const;
-        int             getHeight() const;
-        const Point&    getSize() const;
-        TextureFormat   getFormat() const;
-
-        ImageData   lock(lock_flags f = 0, const Rect* pRect = 0);
-        ImageData   lock(const Rect* pRect);
-        ImageData   lock(const Rect& pRect);
-        void        unlock();
-
-        void        updateRegion(int x, int y, const ImageData& data);
-        void        apply(const Rect*);
-
-        void        swap(MemoryTexture& r);
-
-    private:
-        ImageData _image;
-        size_t _offset;//buffer offset
-        std::vector<unsigned char> _buffer;
-    };
-
-    typedef bool (*cbLoadImageFromBuffer)(MemoryTexture& mt, void* data, int nSize, bool premultiplied, TextureFormat format);
-    void setJpegLoader(cbLoadImageFromBuffer);
-    void setPngLoader(cbLoadImageFromBuffer);
+    typedef Image MemoryTexture;
 }

+ 3 - 3
oxygine/src/STDRenderer.cpp

@@ -2,13 +2,13 @@
 #include "core/UberShaderProgram.h"
 #include "core/VertexDeclaration.h"
 #include "STDMaterial.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/file.h"
 #include "core/ZipFileSystem.h"
 #include "core/system_data.h"
 #include "math/Rect.h"
 #include "Actor.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/ImageDataOperations.h"
 #include "AnimationFrame.h"
 #include "core/VertexDeclaration.h"
@@ -165,7 +165,7 @@ namespace oxygine
 
     void STDRenderer::restore()
     {
-        MemoryTexture memwhite;
+        Image memwhite;
         memwhite.init(4, 4, TF_R8G8B8A8);
 
         oxygine::operations::op_fill fill;

+ 2 - 2
oxygine/src/WebImage.cpp

@@ -1,6 +1,6 @@
 #include "WebImage.h"
 #include "res/ResAnim.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "HttpRequestTask.h"
 #include "Sprite.h"
 #include <vector>
@@ -56,7 +56,7 @@ namespace oxygine
         file::buffer bf;
         _http->getResponseSwap(bf.data);
 
-        MemoryTexture mt;
+        Image mt;
         if (mt.init(bf, true))
         {
             ResAnim rs;

+ 1 - 1
oxygine/src/core/Mem2Native.cpp

@@ -38,7 +38,7 @@ namespace oxygine
         if (!SIZE)
             SIZE = RECT_SIZE;
 
-        MemoryTexture* src = _opt->src.get();
+        Image* src = _opt->src.get();
         NativeTexture* dest = _opt->dest.get();
         Point& prev = _prev;
 

+ 2 - 2
oxygine/src/core/Mem2Native.h

@@ -4,14 +4,14 @@
 #include <vector>
 #include <list>
 #include "NativeTexture.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "Mutex.h"
 #include "ThreadDispatcher.h"
 #include "res/CreateResourceContext.h"
 
 namespace oxygine
 {
-    DECLARE_SMART(MemoryTexture, spMemoryTexture);
+    DECLARE_SMART(Image, spImage);
     DECLARE_SMART(NativeTexture, spNativeTexture);
 
     class Mem2Native

+ 1 - 1
oxygine/src/core/NativeTexture.cpp

@@ -1,5 +1,5 @@
 #include "NativeTexture.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "ImageDataOperations.h"
 #include "file.h"
 #include "log.h"

+ 1 - 1
oxygine/src/core/Renderer.cpp

@@ -1,7 +1,7 @@
 #include "Renderer.h"
 #include "math/Rect.h"
 #include "Actor.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "ImageDataOperations.h"
 #include "AnimationFrame.h"
 #include "VertexDeclaration.h"

+ 3 - 3
oxygine/src/core/gl/NativeTextureGLES.cpp

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include "NativeTextureGLES.h"
 #include "oxgl.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "../NativeTexture.h"
 #include "../ImageDataOperations.h"
 #include "../file.h"
@@ -317,7 +317,7 @@ namespace oxygine
 
             //todo add EXT_unpack_subimage support
 
-            MemoryTexture mt;
+            Image mt;
             mt.init(_lockRect.getWidth(), _lockRect.getHeight(), _format);
             ImageData q = mt.lock();
             operations::copy(locked, q);
@@ -351,7 +351,7 @@ namespace oxygine
         //saveImage(data, "test1.png");
 
 
-        MemoryTexture mt;
+        Image mt;
         if (_format != data.format)
         {
             mt.init(data.w, data.h, _format);

+ 1 - 1
oxygine/src/core/oxygine.cpp

@@ -9,7 +9,7 @@
 #include "res/ResBuffer.h"
 #include "res/ResFontBM.h"
 #include "res/ResAtlas.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "PointerState.h"
 #include "Input.h"
 

+ 2 - 2
oxygine/src/dev_tools/TreeInspector.cpp

@@ -11,7 +11,7 @@
 #include "res/ResFontBM.h"
 #include "res/Resources.h"
 
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "Font.h"
 #include "Stage.h"
 
@@ -54,7 +54,7 @@ namespace oxygine
     {
         ResAnim* rs = new ResAnim(0);
 
-        MemoryTexture mt;
+        Image mt;
         file::buffer bf;
         file::read(file, bf);
         mt.init(bf);

+ 1 - 0
oxygine/src/oxygine-framework.h

@@ -22,6 +22,7 @@
 #include "initActor.h"
 #include "Input.h"
 #include "InputText.h"
+#include "Image.h"
 #include "MemoryTexture.h"
 #include "ThreadLoader.h"
 #include "PointerState.h"

+ 2 - 2
oxygine/src/res/CreateResourceContext.cpp

@@ -1,6 +1,6 @@
 #include "CreateResourceContext.h"
 #include "core/NativeTexture.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/ThreadDispatcher.h"
 #include "core/oxygine.h"
 #include "pthread.h"
@@ -210,7 +210,7 @@ namespace oxygine
         const CreateTextureTask* task = (const CreateTextureTask*)msg.cbData;
 
 
-        MemoryTexture* src = task->src.get();
+        Image* src = task->src.get();
         NativeTexture* dest = task->dest.get();
 
         bool done = false;

+ 2 - 2
oxygine/src/res/CreateResourceContext.h

@@ -78,7 +78,7 @@ namespace oxygine
         const ResourcesLoadOptions* options;
     };
 
-    DECLARE_SMART(MemoryTexture, spMemoryTexture);
+    DECLARE_SMART(Image, spImage);
     DECLARE_SMART(NativeTexture, spNativeTexture);
 
 
@@ -87,7 +87,7 @@ namespace oxygine
     public:
         CreateTextureTask();
 
-        spMemoryTexture src;
+        spImage src;
         spNativeTexture dest;
         bool linearFilter;
         bool clamp2edge;

+ 3 - 3
oxygine/src/res/ResAnim.cpp

@@ -1,5 +1,5 @@
 #include "ResAnim.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/NativeTexture.h"
 #include "core/VideoDriver.h"
 
@@ -56,12 +56,12 @@ namespace oxygine
     {
         file::buffer bf;
         file::read(file, bf);
-        MemoryTexture mt;
+        Image mt;
         mt.init(bf, true);
         init(&mt, columns, rows, scaleFactor);
     }
 
-    void ResAnim::init(MemoryTexture* original, int columns, int rows, float scaleFactor)
+    void ResAnim::init(Image* original, int columns, int rows, float scaleFactor)
     {
         _scaleFactor = scaleFactor;
         if (!original)

+ 2 - 2
oxygine/src/res/ResAnim.h

@@ -11,7 +11,7 @@ namespace oxygine
 
 
     typedef std::vector<AnimationFrame> animationFrames;
-    class MemoryTexture;
+    class Image;
 
     DECLARE_SMART(ResAnim, spResAnim);
     class ResAnim: public _Resource
@@ -21,7 +21,7 @@ namespace oxygine
         ~ResAnim();
 
         void init(const std::string& file, int columns = 1, int rows = 1, float scaleFactor = 1.0f);
-        void init(MemoryTexture* original, int columns = 1, int rows = 1, float scaleFactor = 1.0f);
+        void init(Image* original, int columns = 1, int rows = 1, float scaleFactor = 1.0f);
         void init(animationFrames& frames, int columns, float scaleFactor = 1.0f, float appliedScale = 1.0f);
         /**creates animation frames from NativeTexture*/
         void init(spNativeTexture texture, const Point& originalSize, int columns, int rows, float scaleFactor);

+ 2 - 2
oxygine/src/res/ResAtlas.cpp

@@ -1,5 +1,5 @@
 #include "ResAtlas.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "Resources.h"
 #include "core/VideoDriver.h"
 #include "ResAtlasGeneric.h"
@@ -24,7 +24,7 @@ namespace oxygine
     void load_texture_internal(const std::string& file, spNativeTexture nt, bool linearFilter, bool clamp2edge, LoadResourcesContext* load_context)
     {
         ImageData im;
-        spMemoryTexture mt = new MemoryTexture;
+        spImage mt = new Image;
 
         LOGD("loading atlas: %s", file.c_str());
         file::buffer bf;

+ 5 - 5
oxygine/src/res/ResAtlasGeneric.cpp

@@ -1,6 +1,6 @@
 #include "ResAtlasGeneric.h"
 #include "core/ImageDataOperations.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "utils/AtlasTool.h"
 #include "core/VideoDriver.h"
 #include "Resources.h"
@@ -16,7 +16,7 @@ namespace oxygine
     struct atlas_data
     {
         spNativeTexture texture;
-        MemoryTexture mt;
+        Image mt;
         Atlas2 atlas;
     };
 
@@ -157,7 +157,7 @@ namespace oxygine
         if (!ad.texture)
             return;
 
-        spMemoryTexture mt = new MemoryTexture;
+        spImage mt = new Image;
         Rect bounds = ad.atlas.getBounds();
 
         //int w = nextPOT(bounds.getRight());
@@ -277,7 +277,7 @@ namespace oxygine
 
             Point offset = extend ? Point(2, 2) : Point(0, 0);
 
-            MemoryTexture mt;
+            Image mt;
             ImageData im;
 
             int columns = 0;
@@ -370,7 +370,7 @@ namespace oxygine
                         if (extend)
                         {
                             //duplicate image edges
-                            MemoryTexture& mt = ad.mt;
+                            Image& mt = ad.mt;
                             ImageData tmp;
 
                             if (bounds.getY() == 0 && dest.pos.y != 0)

+ 2 - 2
oxygine/src/res/ResFontBM.cpp

@@ -2,7 +2,7 @@
 #include "Font.h"
 #include <vector>
 #include "pugixml/pugixml.hpp"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/NativeTexture.h"
 #include "core/VideoDriver.h"
 #include "core/file.h"
@@ -118,7 +118,7 @@ namespace oxygine
         if (!load_context->isNeedProceed(p.texture))
             return;
 
-        spMemoryTexture mt = new MemoryTexture;
+        spImage mt = new Image;
 
         file::buffer bf;
         file::read(p.file, bf);

+ 2 - 2
oxygine/src/res/ResStarlingAtlas.cpp

@@ -5,7 +5,7 @@
 #include "Resources.h"
 #include "core/VideoDriver.h"
 #include "core/NativeTexture.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "CreateResourceContext.h"
 #include "utils/stringUtils.h"
 
@@ -70,7 +70,7 @@ namespace oxygine
             }
             else
             {
-                spMemoryTexture mt = new MemoryTexture;
+                spImage mt = new Image;
 
                 ImageData im;
                 file::buffer bf;

+ 1 - 1
oxygine/src/utils/AtlasTool.cpp

@@ -1,6 +1,6 @@
 #include "AtlasTool.h"
 #include "core/Texture.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 #include "core/ImageDataOperations.h"
 
 namespace oxygine

+ 3 - 3
oxygine/src/utils/ImageUtils.cpp

@@ -1,6 +1,6 @@
 #include "ImageUtils.h"
 #include "core/ImageData.h"
-#include "MemoryTexture.h"
+#include "Image.h"
 //#include "png.h"
 extern "C"
 {
@@ -18,9 +18,9 @@ namespace oxygine
 {
     void saveImage(const ImageData& im_, const char* path, const char* format)
     {
-        MemoryTexture src;
+        Image src;
         src.init(im_);
-        MemoryTexture dest;
+        Image dest;
         src.convert(dest, TF_B8G8R8A8);
         const ImageData& im = dest.lock();