public void setTile(int id, int x, int y) {
		if (x + y * width < 0 || x + y * width >= tiles.length)
			return;
		switch (id) {
		case 0:
		case 0xFFFFFF:
			tiles[x + y * width] = 0;
			break;
		case 1:
		case 0xFF:
			tiles[x + y * width] = 1;
			break;
		case 2:
		case 0xAA:
			tiles[x + y * width] = 2;
			break;
		}
	}