public MapPanel(ArrayList<Rectangle> solidRects, ArrayList<Rectangle> flatRects, ArrayList<MapGridArray> map, Dimension size) {
		setBackground(Color.BLACK);
		bi = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
		setPreferredSize(new Dimension(800, 600));
		
		if(size != null) {
			setPreferredSize(size);
			bi = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
		}
		
		if(solidRects != null && !solidRects.isEmpty()) {
			this.solidRects = solidRects;
		}
		
		if(flatRects != null && !flatRects.isEmpty()) {
			this.flatRects = flatRects;
		}
		
		buildImage();
		
		Graphics g = bi.createGraphics();
		this.paint(g);
		g.dispose();
		if(map != null)
			mapGrid = map;
	}