Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ebcd827
Change project to use Makefile
whackashoe Oct 22, 2016
2ede6dd
depend make run on all being built
whackashoe Oct 22, 2016
cf83840
Make readme reflect make build
whackashoe Oct 22, 2016
4e62205
split rgba to own file
whackashoe Oct 22, 2016
3a03e0e
split options to own file
whackashoe Oct 22, 2016
afef75d
split result to own file
whackashoe Oct 22, 2016
e8f70eb
split paletted_image to its own file, create constants file
whackashoe Oct 22, 2016
91d11c2
split array 2d and 3d into their own files
whackashoe Oct 22, 2016
c252ab3
split output class to own file
whackashoe Oct 22, 2016
6568de0
move image to constants
whackashoe Oct 22, 2016
ac694d8
move model to new file
whackashoe Oct 22, 2016
1b7a749
move overlapping model to own file
whackashoe Oct 22, 2016
fd715b8
extract overlapping_model fully, find missing headers in some files t…
whackashoe Oct 22, 2016
6481d4b
remove whitespace
whackashoe Oct 22, 2016
8dea298
extract tile_model
whackashoe Oct 22, 2016
4e4f363
move image methods out
whackashoe Oct 22, 2016
34dce63
overlapping_model method extract
whackashoe Oct 22, 2016
5b61ad6
fix
whackashoe Oct 22, 2016
1351be3
extract pattern_prevalence
whackashoe Oct 22, 2016
975df47
paletted image cpp extract
whackashoe Oct 22, 2016
389133b
extract tile
whackashoe Oct 22, 2016
3f1484b
put tile models constructor in its file
whackashoe Oct 22, 2016
a8c4965
result extract
whackashoe Oct 22, 2016
1b737aa
move create_output to own file
whackashoe Oct 22, 2016
ac0b737
remove unused includes
whackashoe Oct 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
wfc
*.bin
*.sublime-*
build/
Expand Down
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
CXXFLAGS := --std=c++14 -Wall -Wno-sign-compare -O2 -g -DNDEBUG
CPPFLAGS := -I libs -I libs/emilib
LDLIBS := -lstdc++ -lpthread -ldl

BIN = wfc
DISTDIR = build
OUTPUTDIR = output
SRCDIR = src
SRCFILES = $(wildcard $(SRCDIR)/*.cpp)
OBJFILES = $(patsubst $(SRCDIR)/%.cpp, $(DISTDIR)/%.o, $(SRCFILES))
RM = rm -rf
MKDIR = mkdir -p


all: setup $(BIN)

$(BIN): $(OBJFILES)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $^ $(LDLIBS) -o $(BIN)

$(DISTDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@

.PHONY: run clean distclean

setup: $(DISTDIR) $(OUTPUTDIR)
git submodule update --init --recursive

$(DISTDIR):
$(MKDIR) $(DISTDIR)

$(OUTPUTDIR):
$(MKDIR) $(OUTPUTDIR)

run: all
./$(BIN)

clean:
$(RM) $(OBJFILES) $(DISTDIR)

distclean: clean
$(RM) $(BIN) $(OUTPUTDIR)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ The sample images are from https://github.com/mxgmn/WaveFunctionCollapse, so the

git clone git@github.com:emilk/wfc.git
cd wfc
./main.cpp
make run

`./main.cpp` starts with a shell script that downloads dependencies, build, links, and finally runs the program.
`make run` starts downloads dependencies, build, links, and finally runs the program.

This works on Mac and Linux.

# Requirements
C++14. Nothing more, really.

All required third-party libraries are included or downloaded by running `./main.cpp`. These are:
All required third-party libraries are included or downloaded by running `make`. These are:

* https://github.com/emilk/configuru (`.cfg` loading)
* https://github.com/emilk/emilib (small helpers for looping and string formating)
Expand Down
Loading