mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Add compatibility check for future tilemaps w/unsupported tile formats
This commit is contained in:
parent
5c41d96db3
commit
fc24613b81
@ -946,7 +946,7 @@ doc::Cel* AsepriteDecoder::readCelChunk(doc::Sprite* sprite,
|
||||
// Read width and height
|
||||
int w = read16();
|
||||
int h = read16();
|
||||
int bitsPerTile = read16(); // TODO add support for more bpp
|
||||
int bitsPerTile = read16();
|
||||
uint32_t tileIDMask = read32();
|
||||
uint32_t flipxMask = read32();
|
||||
uint32_t flipyMask = read32();
|
||||
@ -954,6 +954,14 @@ doc::Cel* AsepriteDecoder::readCelChunk(doc::Sprite* sprite,
|
||||
uint32_t flagsMask = (flipxMask | flipyMask | rot90Mask);
|
||||
readPadding(10);
|
||||
|
||||
// We only support 32bpp at the moment
|
||||
// TODO add support for other bpp (8-bit, 16-bpp)
|
||||
if (bitsPerTile != 32) {
|
||||
delegate()->incompatibilityError(
|
||||
fmt::format("Unsupported tile format: {0} bits per tile", bitsPerTile));
|
||||
break;
|
||||
}
|
||||
|
||||
if (w > 0 && h > 0) {
|
||||
doc::ImageRef image(doc::Image::create(doc::IMAGE_TILEMAP, w, h));
|
||||
image->setMaskColor(doc::notile);
|
||||
|
Loading…
Reference in New Issue
Block a user