Separate byte reads for metatile tiles

This commit is contained in:
GriffinR 2022-02-04 18:59:57 -05:00 committed by huderlem
parent f92950c46d
commit d531c9407c

View file

@ -1558,9 +1558,9 @@ void Project::loadTilesetMetatiles(Tileset* tileset) {
Metatile *metatile = new Metatile; Metatile *metatile = new Metatile;
int index = i * (2 * 4 * num_layers); int index = i * (2 * 4 * num_layers);
for (int j = 0; j < 4 * num_layers; j++) { for (int j = 0; j < 4 * num_layers; j++) {
Tile tile(static_cast<unsigned char>(data[index++]) uint16_t tileRaw = static_cast<unsigned char>(data[index++]);
| (static_cast<unsigned char>(data[index++]) << 8)); tileRaw |= static_cast<unsigned char>(data[index++]) << 8;
metatile->tiles.append(tile); metatile->tiles.append(Tile(tileRaw));
} }
metatiles.append(metatile); metatiles.append(metatile);
} }