mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Fix unnecessary warning saving TGA (fix #1830)
This commit is contained in:
parent
ddd7140841
commit
b3eba1c952
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -432,17 +432,21 @@ FileOp* FileOp::createSaveDocumentOperation(const Context* context,
|
||||
|
||||
// Palette with alpha
|
||||
if (!fop->m_format->support(FILE_SUPPORT_PALETTE_WITH_ALPHA)) {
|
||||
bool done = false;
|
||||
for (const Palette* pal : fop->m_document->sprite()->getPalettes()) {
|
||||
for (int c=0; c<pal->size(); ++c) {
|
||||
if (rgba_geta(pal->getEntry(c)) < 255) {
|
||||
warnings += "<<- Palette with alpha channel";
|
||||
done = true;
|
||||
break;
|
||||
if (!fop->m_format->support(FILE_SUPPORT_RGBA) ||
|
||||
!fop->m_format->support(FILE_SUPPORT_INDEXED) ||
|
||||
fop->document()->colorMode() == ColorMode::INDEXED) {
|
||||
bool done = false;
|
||||
for (const Palette* pal : fop->m_document->sprite()->getPalettes()) {
|
||||
for (int c=0; c<pal->size(); ++c) {
|
||||
if (rgba_geta(pal->getEntry(c)) < 255) {
|
||||
warnings += "<<- Palette with alpha channel";
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (done)
|
||||
break;
|
||||
}
|
||||
if (done)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (c) 2018 Igara Studio S.A.
|
||||
// Copyright (c) 2018-2019 Igara Studio S.A.
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -56,7 +56,8 @@ class SvgFormat : public FileFormat {
|
||||
FILE_SUPPORT_GRAYA |
|
||||
FILE_SUPPORT_INDEXED |
|
||||
FILE_SUPPORT_SEQUENCES |
|
||||
FILE_SUPPORT_GET_FORMAT_OPTIONS;
|
||||
FILE_SUPPORT_GET_FORMAT_OPTIONS |
|
||||
FILE_SUPPORT_PALETTE_WITH_ALPHA;
|
||||
}
|
||||
|
||||
bool onLoad(FileOp* fop) override;
|
||||
|
Loading…
Reference in New Issue
Block a user