int CWorld::DrawMap( int PosX, int PosY ){ int tilex; int tiley; for(int y = 0; y < 40; y++) { for( int x = 0; x < 40; x++) { tilex = PosX+x*32-y*32; //x0,y0 is a reference point for the upperleft corner of tile (0,0) tiley = PosY+y*16+x*16; //use tilex and tiley to blit your tile paint.DrawSurface( tilex , tiley, _RGB16BIT565( 255,0,255 ), lpDDSMapTiles[level->map[x][y].tile] ); } } return true;}
but with this method i can scroll but i draw all my tiles from the level. So when i have a big World like 255x255 my fps is under 2... I need a draw function that only draws the tiles where i am.