mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-27 06:35:16 +00:00
parent
9f0cac32b3
commit
3486dcca7e
@ -1185,13 +1185,18 @@ Doc* DocExporter::createEmptyTexture(const Samples& samples,
|
||||
int maxColors = 256;
|
||||
gfx::ColorSpaceRef colorSpace;
|
||||
color_t transparentColor = 0;
|
||||
bool ui = false;
|
||||
#ifdef ENABLE_UI
|
||||
if (App::instance()->isGui())
|
||||
ui = true;
|
||||
#endif
|
||||
|
||||
// We generate a palette for file formats that support a color
|
||||
// palette inside, or if the UI/preview is available/required.
|
||||
//
|
||||
// As a side note, here we cannot use a possible
|
||||
// ctx->isUIAvailable() (instead of App::instance()->isGui())
|
||||
// because when the sprite sheet is generated from the UI, a
|
||||
// temporal non-UI context is created in a background thread.
|
||||
const bool paletteRequiredByUIPreview = App::instance()->isGui();
|
||||
const bool textureSupportsPalette =
|
||||
format_supports_palette(m_textureFilename) || ui;
|
||||
format_supports_palette(m_textureFilename) ||
|
||||
paletteRequiredByUIPreview;
|
||||
|
||||
for (const auto& sample : samples) {
|
||||
if (token.canceled())
|
||||
|
Loading…
x
Reference in New Issue
Block a user