public void drawRaster(int[] p, int w, int h, int x, int y) {

		// Finds the bounds (in world space) of the pixels that are visible and are on the tile map
		final int startX = (x < 0) ? 0 : x;
		final int endX = (x + w > imageWidth) ? imageWidth : w + x;
		final int startY = (y < 0) ? 0 : y;
		final int endY = (y + h > imageHeight) ? imageHeight : h + y;
		
		int offset, i;
		
		// For each visible row in world space defined by the bounds above
		for (int row = startY; row < endY; row++) {
			
			// Calculate the position of the first pixel of the row on the view port
			offset = (row * imageWidth + startX);
			
			// For each pixel in the row
			for (i = 0; i < endX - startX; i++) {
				
				pixels[i + offset] = p[i];
				
			}
			
		}
		
	}