lib/proceduralDunGen.h
/// See if an area in the map is available for a room to be placed.
/// A little helper function looping testSurrounding().
See if an area in the map is available for a room to be placed.
A little helper function looping testSurrounding().
See if an area in the map is available for a room to be placed . A little helper function looping testSurrounding () .
int testArea(int **map, int rows, int cols, int row, int col, int height, int width)
{
    for(int i = 0; i < height; i++)
        for(int j = 0; j < width; j++)
        {
            int available = testSurrounding(map, rows, cols, row+i, col+j);
            if(!available) return 0;
        }
    return 1;
}
int testArea ( int * * map , int rows , int cols , int row , int col , int height , int width ) { for ( int i = 0 ; i < height ; i ++ ) for ( int j = 0 ; j < width ; j ++ ) { int available = testSurrounding ( map , rows , cols , row + i , col + j ) ; if ( ! available ) return 0 ; } return 1 ; }
See if an area in the map is available for a room to be placed.
See if an area in the map is available for a room to be placed .