Superku has the right idea but there are a few improvements that could be made. First of all the way he's doing it will cause the terrain to draw itself sideways, and the tiles will be spaced out far too much!

Code:
BMAP* bmap_tile[MAX_TILES];
int x, y;

for(y=0; y<SIZE_Y; y++) {
	for(x=0; x<SIZE_X; x++) {
		if(tilemap[y][x]) draw_quad(bmap_tile[tilemap[y][x]],vector(x<<3,y<<3,0),NULL,NULL,NULL,NULL,100,0);
	}
}



I like to keep as a general rule of thumb that whenever possible, use bit shifts to perform multiplication instead of straight multiplication. This is possible whenever you are multiplying a variable by a number that is a power of 2.

Also you should put the "y" for loop before the "x" for loop to get better caching performance.


Eats commas for breakfast.

Play Barony: Cursed Edition!