bool splitvert(int p) { if (p < 4 || (y2 - (y + p)) < 3 || (depth == dungeon.depth - 1 && x2 - x == (dungeon.width - 1))) { // cout << "splitvert: p " << p << endl; return(false); } else { splitdir = splitDirType.VERT; left = new BSPDungeonNode(dungeon, this, x, y, x2, y + p - 1); right = new BSPDungeonNode(dungeon, this, x, y + p, x2, y2); return(true); } }
bool splithoriz(int p) { if (p < 4 || (x2 - (x + p)) < 3 || (depth == dungeon.depth - 1 && y2 - y == (dungeon.height - 1))) { // cout << "splithoriz: p " << p << endl; return(false); } else { splitdir = splitDirType.HORIZ; left = new BSPDungeonNode(dungeon, this, x, y, x + p - 1, y2); right = new BSPDungeonNode(dungeon, this, x + p, y, x2, y2); return(true); } }