Hi,
We (a friend and I) are currently developing a NewGRF with some French locos and we are going to pack them in a NewGRF.
We use the NML language to generate the NewGRF and it works fine.
However, we would like to have it on 32bpp graphics (as we design the locos with blender) but we don't manage to see them in game.
Here is the code:
Code:
grf {
// Some stuff
}
railtypetable {
RAIL, ELRL, HSTR
}
template tmpl_z2_train() {
// Dimensions of the graphics
}
template tmpl_z1_train() {
// Dimensions of the graphics
}
template tmpl_z0_train() {
// Dimensions of the graphics
}
template tmpl_8bpp_train() {
// Dimensions of the graphics
}
template tmpl_single_train() {
[1, 161, 53, 14, -25, -10] //xpos ypos xsize ysize xrel yrel
}
spriteset(nez_casse_sprite, "img/nez_casse_mask.png") { tmpl_8bpp_train() }
spriteset(nez_casse_purch, "img/nez_casse_mask.png") { tmpl_single_train() }
// 32-bpp support
alternative_sprites(nez_casse_sprite, ZOOM_LEVEL_Z0, "img/nez_casse.png") { tmpl_z0_train() }
alternative_sprites(nez_casse_sprite, ZOOM_LEVEL_Z1, "img/nez_casse.png") { tmpl_z1_train() }
alternative_sprites(nez_casse_sprite, ZOOM_LEVEL_Z2, "img/nez_casse.png") { tmpl_z2_train() }
item(FEAT_TRAINS, nez_casse1) {
property {
// Parameters of the loco
}
graphics {
default: nez_casse_sprite;
purchase: nez_casse_purch;
}
}
The img/nez_casse.png is a full-red RGBA image (we don't have generated the images from blender yet) and the img/nez_casse_mask.png is a palette-bases image that contains a 8bpp loco in the Windows palette (this is actually the example loco from NML doc).
In game, with OpenTTD 1.1.0 32bpp-patched, the loco just appears as 8bpp, the alternative_sprites section seems ignored.
Does anybody have a clue to solve this?
Regards,
felixzero