diff --git a/src/app/file/ase_format.cpp b/src/app/file/ase_format.cpp index 3f130f2a5..de48b91fc 100644 --- a/src/app/file/ase_format.cpp +++ b/src/app/file/ase_format.cpp @@ -144,7 +144,8 @@ class AseFormat : public FileFormat { FILE_SUPPORT_FRAMES | FILE_SUPPORT_PALETTES | FILE_SUPPORT_FRAME_TAGS | - FILE_SUPPORT_BIG_PALETTES; + FILE_SUPPORT_BIG_PALETTES | + FILE_SUPPORT_PALETTE_WITH_ALPHA; } bool onLoad(FileOp* fop) override; diff --git a/src/app/file/file.cpp b/src/app/file/file.cpp index 3316b7df4..9612277ed 100644 --- a/src/app/file/file.cpp +++ b/src/app/file/file.cpp @@ -332,6 +332,22 @@ FileOp* fop_to_save_document(const Context* context, const Document* document, } } + // Palette with alpha + if (!fop->format->support(FILE_SUPPORT_PALETTE_WITH_ALPHA)) { + bool done = false; + for (Palette* pal : fop->document->sprite()->getPalettes()) { + for (int c=0; csize(); ++c) { + if (rgba_geta(pal->getEntry(c)) < 255) { + warnings += "<<- Palette with alpha channel"; + done = true; + break; + } + } + if (done) + break; + } + } + // Show the confirmation alert if (!warnings.empty()) { // Interative diff --git a/src/app/file/file_format.h b/src/app/file/file_format.h index 9485020c5..e6f179079 100644 --- a/src/app/file/file_format.h +++ b/src/app/file/file_format.h @@ -27,6 +27,7 @@ #define FILE_SUPPORT_GET_FORMAT_OPTIONS 0x00000800 #define FILE_SUPPORT_FRAME_TAGS 0x00001000 #define FILE_SUPPORT_BIG_PALETTES 0x00002000 // Palettes w/more than 256 colors +#define FILE_SUPPORT_PALETTE_WITH_ALPHA 0x00004000 namespace app {