private void drawTerrain() {
		int width = UIGlobals.getScreenWidth();
		int height = UIGlobals.getScreenHeight();
		int cameraX = UIGlobals.camera_x;
		int cameraY = UIGlobals.camera_y;
		int tileSize = UIGlobals.tileSize;
		
		int xOff = -(tileSize + ((cameraX % tileSize) - tileSize));
		int yOff = -(tileSize + ((cameraY % tileSize) - tileSize));
		
		// graphical x and y
		int x = xOff;
		int y = yOff;
		
		int cameraLocationX = Map.pixelToLocation(cameraX);
		int cameraLocationY = Map.pixelToLocation(cameraY);
		int cameraWidthOff = (int)(Map.pixelToLocation(width)/2);
		int cameraHeightOff = (int)(Map.pixelToLocation(height)/2);
		
		for (int map_x = cameraLocationX-cameraWidthOff, map_x_end = cameraLocationX+cameraWidthOff+3; map_x < map_x_end; map_x++){
			for (int map_y = cameraLocationY-cameraHeightOff, map_y_end = cameraLocationY+cameraHeightOff+3; map_y < map_y_end; map_y++){
				
				int terrain = map.getTileAt(map_x, map_y);
				if (terrain != -1) {
					Resource.MAP_TERRAIN[terrain].draw(x, y, tileSize, tileSize);
					if (map.isFogOfWar(map_x, map_y)) {
						//Resource.MAP_FOG.draw(x, y, tileSize, tileSize);
					}
				}
				y += tileSize;
			}
			x += tileSize;
			y = yOff;
		}
		
	}