2d libgdx - drawing only what camera sees

Hi,
I’ve created some code that draws a random procedurally generated dungeon - all good, can scroll around etc. Problem is my drawMap method:


public void drawMap(SpriteBatch batch, Texture img, float width,
			float height) {
		for (Tile[] t : tiles) {
			for (Tile tt : t) {
				if (tt.visible)
					batch.draw(img, tt.x, tt.y, width, height);
			}
		}
	}

Tiles is defined as:


public List<Tile[]> tiles;

It just draws the whole map, now I have a camera and it’s position, thus must be a way of just drawing what it sees. The screen width is 1024/16 tiles and 768/16 tiles high so
really should just be drawing that amount. ??? ???

Any help is appreciated.

Thanks,
Steve