OpenTTD / nml

NewGRF Meta Language
GNU General Public License v2.0
43 stars 36 forks source link

Change: Allow creating 32bpp-only NewGRFs #314

Closed PeterN closed 10 months ago

PeterN commented 10 months ago

The NFO requirement that the first sprite is 8bpp and 'normal zoom', was never actually enforced by OpenTTD itself which has no problem loading 32bpp-only NewGRFs.

NML allows 32bpp and zoom levels but only on alternative_sprites.

This change supports the use of zoom level and bit depth parameters on the spriteset() instruction. The format is similar to alternative_sprites();

spriteset(name[, image_file]) spriteset(name, zoom_level, bit_depth[, image_file[, mask_file]])

A short regression test is included.

Rationale: some NewGRF authors are already creating 32bpp-only sets with other tools that already allow it, whilst authors using NML are creating 32bpp-only with fake transparent 8bpp sprites. Given that we can't (and shouldn't) force authors to create content they don't want to, it is better to just remove the requirement for 8bpp sprites. This is beneficial as it means that OpenTTD may be able to detect when 8bpp sprites are missing which it cannot do if dummy 8bpp sprites are present.

andythenorth commented 10 months ago

FIRS and Iron Horse appear to build fine with this PR (both 8bpp DOS-palette, 1x zoom, no 32bpp support)