mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-09-29 17:57:15 +00:00
Do not export BG0 tile descriptors ith the mask bit set if there is only one layer defined
This commit is contained in:
parent
3b8bf652e1
commit
3f2a9bd8d4
@ -197,6 +197,9 @@ function findAnimatedTiles(tileset) {
|
|||||||
return animations;
|
return animations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Global reference object
|
||||||
|
let GLOBALS = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command line arguments
|
* Command line arguments
|
||||||
*
|
*
|
||||||
@ -246,6 +249,13 @@ async function main(argv) {
|
|||||||
// Load up any/all tilesets
|
// Load up any/all tilesets
|
||||||
const tileSets = await Promise.all(doc.tilesets.map(tileset => loadTileset(workdir, tileset)));
|
const tileSets = await Promise.all(doc.tilesets.map(tileset => loadTileset(workdir, tileset)));
|
||||||
|
|
||||||
|
// Create a global reference object
|
||||||
|
GLOBALS = {
|
||||||
|
outdir,
|
||||||
|
tileSets,
|
||||||
|
tileLayers
|
||||||
|
};
|
||||||
|
|
||||||
// Save all of the tilesets
|
// Save all of the tilesets
|
||||||
let bg0TileSet = null;
|
let bg0TileSet = null;
|
||||||
|
|
||||||
@ -398,7 +408,7 @@ function convertTileID(tileId, tileset) {
|
|||||||
|
|
||||||
// The tileId starts at one, but the tile set starts at zero. It's ok when we export,
|
// The tileId starts at one, but the tile set starts at zero. It's ok when we export,
|
||||||
// because a special zero tile is inserted, but we have to manually adjust here
|
// because a special zero tile is inserted, but we have to manually adjust here
|
||||||
const mask_bit = !tileset[tileIndex - 1].isSolid;
|
const mask_bit = (!tileset[tileIndex - 1].isSolid) && (GLOBALS.tileLayers.length !== 1);
|
||||||
|
|
||||||
// Build up a partial set of control bits
|
// Build up a partial set of control bits
|
||||||
let control_bits = (mask_bit ? GTE_MASK_BIT : 0) + (hflip ? GTE_HFLIP_BIT : 0) + (vflip ? GTE_VFLIP_BIT : 0);
|
let control_bits = (mask_bit ? GTE_MASK_BIT : 0) + (hflip ? GTE_HFLIP_BIT : 0) + (vflip ? GTE_VFLIP_BIT : 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user