void loadTextures(String textureFilename, int width, int height, int nb) {
		Image img = controller.loadImage(textureFilename);

		// block until image is loaded
		MediaTracker tracker = new MediaTracker(this);
		tracker.addImage(img, 0);
		try {
			tracker.waitForAll();
		} catch (Exception ignored) {
		}

		int[] data = new int[width * height];

		for (int i = 0; i < nb; i++) {
			PixelGrabber grabber = new PixelGrabber(img, 0, i * height, width, height, data, 0, width);
			try {
				grabber.grabPixels();
			} catch (InterruptedException e) {
			}

			CPGreyBmp texture = new CPGreyBmp(width, height);
			for (int j = 0; j < width * height; j++) {
				texture.data[j] = (byte) (data[j] & 0xff);
			}

			textures.add(texture);
		}
	}