void SetTileset(int index) { tilesetHeaderGroup = Project.GetIndexedDataType <TilesetHeaderGroup>(index); // Generate usedTileList for quick lookup of which metatiles use // which 4 gameboy tiles for (int j = 0; j < 256; j++) { usedTileList[j] = new List <byte>(); } for (int j = 0; j < 256; j++) { // j = index of metatile bool[] used = new bool[256]; for (int k = 0; k < 4; k++) { int tile = tilesetHeaderGroup.GetMappingsData(j * 8 + k); if (!used[tile]) { usedTileList[tile].Add((byte)j); used[tile] = true; } } } InvalidateAllTiles(); }
void SetTileset(int index) { tilesetHeaderGroup = Project.GetIndexedDataType<TilesetHeaderGroup>(index); // Generate usedTileList for quick lookup of which metatiles use // which 4 gameboy tiles for (int j=0; j<256; j++) usedTileList[j] = new List<byte>(); for (int j=0; j<256; j++) { // j = index of metatile bool[] used = new bool[256]; for (int k=0; k<4; k++) { int tile = tilesetHeaderGroup.GetMappingsData(j*8+k); if (!used[tile]) { usedTileList[tile].Add((byte)j); used[tile] = true; } } } InvalidateAllTiles(); }