diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-02 21:38:20 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-02 21:52:26 +0100 |
commit | 3f3f5a5359973e95e94148676a9793d6f52468f3 (patch) | |
tree | 65adf17c3d3f8d3a83bec29f51142fe884e942d8 /drivers/png/resource_saver_png.cpp | |
parent | db46a344180d4eae1455e97e22bf84c9c304be7c (diff) | |
parent | 2820b2d82b2ed747011e37c543aefc6d4d4edee9 (diff) |
Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
Diffstat (limited to 'drivers/png/resource_saver_png.cpp')
-rw-r--r-- | drivers/png/resource_saver_png.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index cb508f703c..97c74aa7c9 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -98,10 +98,10 @@ Error ResourceSaverPNG::save(const String &p_path,const RES& p_resource,uint32_t Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { - if (p_img.get_format() > Image::FORMAT_INDEXED_ALPHA) + if (p_img.is_compressed()) p_img.decompress(); - ERR_FAIL_COND_V(p_img.get_format() > Image::FORMAT_INDEXED_ALPHA, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_img.is_compressed(), ERR_INVALID_PARAMETER); png_structp png_ptr; png_infop info_ptr; @@ -140,22 +140,22 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { switch(p_img.get_format()) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { pngf=PNG_COLOR_TYPE_GRAY; cs=1; } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { pngf=PNG_COLOR_TYPE_GRAY_ALPHA; cs=2; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { pngf=PNG_COLOR_TYPE_RGB; cs=3; } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; @@ -164,12 +164,12 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { if (p_img.detect_alpha()) { - p_img.convert(Image::FORMAT_RGBA); + p_img.convert(Image::FORMAT_RGBA8); pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; } else { - p_img.convert(Image::FORMAT_RGB); + p_img.convert(Image::FORMAT_RGB8); pngf=PNG_COLOR_TYPE_RGB; cs=3; } |