]> git.lizzy.rs Git - irrlicht.git/blobdiff - include/IImage.h
Readd TGA format support (#64)
[irrlicht.git] / include / IImage.h
index 09c40f4225554dff7257b52834568f8959399ffa..3d4d5fa0c3b8b4d4fb20fe56015e1252a1fe4bad 100644 (file)
@@ -29,6 +29,9 @@ public:
        //! constructor\r
        IImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, bool deleteMemory) :\r
                Format(format), Size(size), Data(0), MipMapsData(0), BytesPerPixel(0), Pitch(0), DeleteMemory(deleteMemory), DeleteMipMapsMemory(false)\r
+#if defined(IRRLICHT_sRGB)\r
+               ,Format_sRGB(1)\r
+#endif\r
        {\r
                BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8;\r
                Pitch = BytesPerPixel * Size.Width;\r
@@ -50,6 +53,18 @@ public:
                return Format;\r
        }\r
 \r
+#if defined(IRRLICHT_sRGB)\r
+       //! Texture is linear/sRGB (should be part of ColorFormat: default yes)\r
+       int get_sRGB() const\r
+       {\r
+               return Format_sRGB;\r
+       }\r
+       void set_sRGB(int val)\r
+       {\r
+               Format_sRGB = val;\r
+       }\r
+#endif\r
+\r
        //! Returns width and height of image data.\r
        const core::dimension2d<u32>& getDimension() const\r
        {\r
@@ -534,6 +549,22 @@ public:
                return false;\r
        }\r
 \r
+#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)\r
+       static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)\r
+       {\r
+               switch (format)\r
+               {\r
+               case ECF_A1R5G5B5:\r
+               case ECF_R5G6B5:\r
+               case ECF_R8G8B8:\r
+               case ECF_A8R8G8B8:\r
+                       return false;\r
+               default:\r
+                       return true;\r
+               }\r
+       }\r
+#endif\r
+\r
 protected:\r
        ECOLOR_FORMAT Format;\r
        core::dimension2d<u32> Size;\r
@@ -548,8 +579,12 @@ protected:
        bool DeleteMipMapsMemory;\r
 \r
        core::irrAllocator<u8> Allocator;\r
+#if defined(IRRLICHT_sRGB)\r
+       int Format_sRGB;\r
+#endif\r
 };\r
 \r
+\r
 } // end namespace video\r
 } // end namespace irr\r
 \r