// constructor // functions public void Transfer(byte[][] tilemaps, LevelMap levelMap, LevelSolidMap solidityMap, Point start, Point stop) { this.start = start; int offset = 0, o = 0, p = 0; size = new Size(stop.X - start.X, stop.Y - start.Y); this.tilemaps[0] = new byte[(size.Width * size.Height) / 128]; this.tilemaps[1] = new byte[(size.Width * size.Height) / 128]; this.tilemaps[2] = new byte[(size.Width * size.Height) / 256]; for (int y = start.Y / 16, b = 0; y < stop.Y / 16; y++, b++) { for (int x = start.X / 16, a = 0; x < stop.X / 16; x++, a++, o++) { offset = (x * 2) + (y * 128); this.tilemaps[0][o * 2] = tilemaps[0][offset]; this.tilemaps[0][o * 2 + 1] = tilemaps[0][offset + 1]; this.tilemaps[1][o * 2] = tilemaps[1][offset]; this.tilemaps[1][o * 2 + 1] = tilemaps[1][offset + 1]; this.tilemaps[2][o] = tilemaps[2][y * 64 + x]; } } for (int y = start.Y; y < stop.Y; y++) { for (int x = start.X; x < stop.X; x++) { p = solidity.PixelTiles[y * 1024 + x] * 2; soliditymap[p] = solidityMap.Tilemap_Bytes[p]; soliditymap[p + 1] = solidityMap.Tilemap_Bytes[p + 1]; } } }
private void SolidityUpdate() { if (closingEditor) { return; } fullUpdate = true; solidityMap = new LevelSolidMap(levelMap); solidityMap.Image = null; LoadTilemapEditor(); }
private void mapPhysicalMapNum_ValueChanged(object sender, EventArgs e) { if (this.Updating) { return; } mapPhysicalMapName.SelectedIndex = (int)mapPhysicalMapNum.Value; levelMap.SolidityMap = (byte)this.mapPhysicalMapNum.Value; if (!this.Refreshing) { fullUpdate = true; solidityMap = new LevelSolidMap(levelMap); solidityMap.Image = null; LoadTilemapEditor(); } }