Skip to content

Commit

Permalink
possibly finished
Browse files Browse the repository at this point in the history
  • Loading branch information
fl4shk committed Nov 15, 2022
1 parent 2f52ac1 commit 0883a05
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 122 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Also, make sure you recurse submodules when cloning.

Example:
```
$ ./wfc -i mountain_range.txt -w 32 -h 32 -d 3
$ ./wfc -i mountain_range.txt -w 32 -h 32 -d 3 -o
^^ &...& ^^^ &&&&&..
^^^ &...& ^^ ^^^ &&&&
^^ &..&& ^^ ^^^^
Expand Down
13 changes: 13 additions & 0 deletions dungeon_small.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


####### ########
#.....# #......#
###.....+,,,,,,,+......#
#......## , #####+##
#......# , ,
#......# , ,
######## , ###+#####
, #.......#
,,,,,+.......#
#########

6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(int argc, char** argv) {
.add_singleton("--height", "-h", HasArg::Req, true)
.add_singleton("--metatile-dim", "-d", HasArg::Req, false)
.add_singleton("--backtrack", "-b", HasArg::None, false)
//.add_singleton("--overlap", "-o", HasArg::None, false)
.add_singleton("--overlap", "-o", HasArg::None, false)
.add_singleton("--rotate", "-r", HasArg::None, false)
.add_singleton("--reflect", "-R", HasArg::None, false)
.add_singleton("--seed", "-s", HasArg::Req, false);
Expand Down Expand Up @@ -128,7 +128,7 @@ int main(int argc, char** argv) {

const bool
backtrack = ap.has_opts("--backtrack"),
//overlap = ap.has_opts("--overlap"),
overlap = ap.has_opts("--overlap"),
rotate = ap.has_opts("--rotate"),
reflect = ap.has_opts("--reflect");

Expand All @@ -143,7 +143,7 @@ int main(int argc, char** argv) {
wfc::Wfc the_wfc
(size_2d, mt_dim,
input_tiles,
backtrack, rotate, reflect, //overlap,
backtrack, overlap, rotate, reflect,
rng_seed);
for (size_t j=0; j<the_wfc.result().size(); ++j) {
const auto& row = the_wfc.result().at(j);
Expand Down
3 changes: 3 additions & 0 deletions src/metatile_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Metatile final {
//return {.x=data().front().size(), .y=data().size()};
return {.x=dim(), .y=dim()};
}
inline size_t& front() {
return _data.front().front();
}
inline size_t& at(const Vec2<size_t>& pos) {
return _data.at(pos.y).at(pos.x);
}
Expand Down
Loading

0 comments on commit 0883a05

Please sign in to comment.