adventuregamestudio / ags

AGS editor and engine source code
Other
672 stars 159 forks source link

Cannot import 16-color BMP file #2416

Closed Crystal-Shard closed 3 weeks ago

Crystal-Shard commented 3 weeks ago

Describe the bug When importing a room Walkbehind mask, selecting a 16-color BMP image doesn't work. The editor expects a 256-color BMP image using only the first 16 colors, which is a somewhat odd choice of file formats considering common bitmap editors (e.g. MS Paint) by default support 16-color bitmaps. Opening a 16-color bitmap in MS Paint, saving it as 256-color BMP, and importing that doesn't help (it imports succesfully but doesn't get the full mask, presumably because MS Paint does not save the 16 colors as the first 16 in a 256-color BMP).

AGS Version 3.6.0

Game n/a

To Reproduce Steps to reproduce the behavior:

  1. Import this bitmap as a walkbehind mask: parkmine-wb.zip

Expected behavior Importing the 16-color bitmap works.

Desktop (please complete the following information):

ivan-mogilko commented 3 weeks ago

Sorry, I misread this as 16-bit bitmap.

I think in AGS 4.0 we support indexed PNGs of any palette size, but cannot remember if we added or tried adding support for BMPs anything lower than 8-bit there. I have vague memories of trying to make 4-bit bitmaps work.

In regards to MS Paint, I don't think that's a good choice for making masks; in the past I found out that it shuffles the color indexes randomly, at least with 8-bit format.

Crystal-Shard commented 3 weeks ago

I've checked, and it appears that older versions of AGS do support 16-color BMPs. Maybe it was dropped when the engine switched to Allegro because that library doesn't support it? But of course it has since switched to SDL.

ivan-mogilko commented 3 weeks ago

@Crystal-Shard there's a build with this support, if you'd like to test: https://cirrus-ci.com/task/6457604614914048

Crystal-Shard commented 3 weeks ago

Thank you, I'll check it out over the weekend.

In regards to MS Paint, I don't think that's a good choice for making masks; in the past I found out that it shuffles the color indexes randomly, at least with 8-bit format.

In my experience, MS Paint is a very convenient tool for converting whatever masks you have to 16-color mode.

Crystal-Shard commented 3 weeks ago

@Crystal-Shard there's a build with this support, if you'd like to test: https://cirrus-ci.com/task/6457604614914048

I confirm that this works.