lib/proceduralDunGen.h
/// Look for a suitable tile to start a path from.
/// Uses randomization.
/// Returns row, column and direction with an inertPoint.
Look for a suitable tile to start a path from.
Uses randomization.
Returns row, column and direction with an inertPoint.
Look for a suitable tile to start a path from . Uses randomization . Returns row column and direction with an inertPoint .
struct inertPoint pickWall(int **map, const int rows, const int cols)
{
    struct inertPoint c;
    while(1)
    {
        c.row = rand() % rows;
        c.col = rand() % cols;
        c.dir = isGoodWall(map, rows, cols, c.row, c.col);
        if(c.dir) return c; 
    }
}
struct inertPoint pickWall ( int * * map , const int rows , const int cols ) { struct inertPoint c ; while ( 1 ) { c . row = rand ( ) % rows ; c . col = rand ( ) % cols ; c . dir = isGoodWall ( map , rows , cols , c . row , c . col ) ; if ( c . dir ) return c ; } }
Look for a suitable tile to start a path from.
Look for a suitable tile to start a path from .
// isGoodWall will return 0 if it doesn't find a good wall, so this will return only if this is a valid direction.