If you just pick the wider of the dimensions then you get a more even spread vs random direction.
This commit is contained in:
parent
e1ebea7451
commit
5f09747109
1 changed files with 1 additions and 1 deletions
2
map.cpp
2
map.cpp
|
@ -130,7 +130,7 @@ inline int make_split(std::mt19937 &gen, Partition &cur, bool horiz) {
|
||||||
void partition_map(std::mt19937 &gen, Partition &cur, int depth) {
|
void partition_map(std::mt19937 &gen, Partition &cur, int depth) {
|
||||||
println(">>>> DEPTH: {}", depth);
|
println(">>>> DEPTH: {}", depth);
|
||||||
std::uniform_int_distribution<int> rsplit(0, 1);
|
std::uniform_int_distribution<int> rsplit(0, 1);
|
||||||
bool horiz = rsplit(gen);
|
bool horiz = cur.width > cur.height ? false : true;
|
||||||
int split = make_split(gen, cur, horiz);
|
int split = make_split(gen, cur, horiz);
|
||||||
Partition left;
|
Partition left;
|
||||||
Partition right;
|
Partition right;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue