lib/proceduralDunGen.h
/// See if [row][col] is a wall next to a room. Return the direction a path can be created.
See if [row][col] is a wall next to a room. Return the direction a path can be created.
See if [ row ] [ col ] is a wall next to a room . Return the direction a path can be created .
int isGoodWall(int **map, const int mapheight, const int mapwidth, const int row, const int col)
{
    if(row < 1 || row > (mapheight - 2) || col < 1 || col > (mapwidth -2) || map[row][col] != WALL) return 0;
    if(map[row-1][col] == FLOOR) return SOUTH;
    if(map[row][col-1] == FLOOR) return EAST;
    if(map[row+1][col] == FLOOR) return NORTH;
    if(map[row][col+1] == FLOOR) return WEST;
    return 0;
}
int isGoodWall ( int * * map , const int mapheight , const int mapwidth , const int row , const int col ) { if ( row < 1 || row > ( mapheight - 2 ) || col < 1 || col > ( mapwidth - 2 ) || map [ row ] [ col ] != WALL ) return 0 ; if ( map [ row - 1 ] [ col ] == FLOOR ) return SOUTH ; if ( map [ row ] [ col - 1 ] == FLOOR ) return EAST ; if ( map [ row + 1 ] [ col ] == FLOOR ) return NORTH ; if ( map [ row ] [ col + 1 ] == FLOOR ) return WEST ; return 0 ; }
See if [row][col] is a wall next to a room.
See if [ row ] [ col ] is a wall next to a room .
// Check surrounding tiles for open tile (which means a room is there, so go the other way).