public static void drawFilledPixels(int x, int y, int w, int h, int color) {
		if (x < startX) {
			w -= startX - x;
			x = startX;
		}
		if (y < startY) {
			h -= startY - y;
			y = startY;
		}
		if (x + w > endX) {
			w = endX - x;
		}
		if (y + h > endY) {
			h = endY - y;
		}
		int start = width - w;
		int total = x + y * width;
		for (int index1 = -h; index1 < 0; index1++) {
			for (int index2 = -w; index2 < 0; index2++) {
				pixels[total++] = color;
			}
			total += start;
		}
	}