From fa8078dc8b49d0705ff0f95be7bafd5d76d67ce6 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Tue, 17 Oct 2017 00:05:55 -0700 Subject: [PATCH 1/2] Silence a couple of warnings on Clang. NFC. --- graph.cpp | 2 +- langen.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/graph.cpp b/graph.cpp index 790626ce..e0c96cd9 100644 --- a/graph.cpp +++ b/graph.cpp @@ -3557,7 +3557,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { else if((c->land == laCaribbean || c->land == laOcean || c->land == laOceanWall || c->land == laWhirlpool)) qfloor(c, Vf, shCloudFloor[ct6], darkena(fcol, fd, 0xFF)); - else if((c->land == laKraken)) + else if(c->land == laKraken) qfloor(c, Vf, shFullFloor[ct6], darkena(fcol, fd, 0xFF)); else if(c->land == laLivefjord) diff --git a/langen.cpp b/langen.cpp index 94eaf0f7..0c7d775a 100644 --- a/langen.cpp +++ b/langen.cpp @@ -362,7 +362,7 @@ int main() { printf("hashcode hashval = 0x%x;\n\n", hashval); - printf("sentence all_sentences[] = {\n", size(allsent)); + printf("sentence all_sentences[] = {\n"); for(map::iterator it = ms.begin(); it != ms.end(); it++) { string s = it->second; @@ -374,7 +374,7 @@ int main() { } printf(" };\n\n"); - printf("fullnoun all_nouns[] = {\n", size(allnouns)); + printf("fullnoun all_nouns[] = {\n"); for(map::iterator it = mn.begin(); it != mn.end(); it++) { string s = it->second; From 01d6b38b4ad6f8ce0307c0b21c11d597eaeb9ec7 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Tue, 17 Oct 2017 00:05:12 -0700 Subject: [PATCH 2/2] Update "Makefile.mac" to work for OS X with Homebrew. --- Makefile.mac | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/Makefile.mac b/Makefile.mac index 980a37f3..502e79c5 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -1,7 +1,32 @@ -# note: this Makefile for Mac is based on this post. I have no resources to test it myself. -# http://groups.google.com/group/rec.games.roguelike.development/browse_thread/thread/9c02e09c0195dc16/3cbde3dc4a0b7e4e +# This Makefile works for Mac OS X (Yosemite). # -# You will also probably need to configure it yourself a bit to make it work. +# Run "brew install sdl" to install SDL in /usr/local. +# Run "brew install sdl_gfx". +# Run "brew install sdl_mixer". +# Run "brew install sdl_ttf". +# Run "make -f Makefile.mac" to build HyperRogue as ./hyper. -hyper: hyper.cpp graph.cpp hyperpoint.cpp geometry.cpp cell.cpp heptagon.cpp game.cpp polygons.cpp classes.cpp - g++ -m32 -I/sw/include hyper.cpp -L/sw/lib -lSDL -lSDLMain -lSDL_ttf -lSDL_gfx -framework AppKit -DMAC -O3 +CXXFLAGS += -std=c++11 -DMAC +CXXFLAGS += -W -Wall -Wextra -pedantic +CXXFLAGS += -Wno-format-pedantic -Wno-unused-parameter -Wno-char-subscripts -Wno-missing-field-initializers -Wno-vla-extension +CXXFLAGS += ${EXTRA_CXXFLAGS} +CXXFLAGS += -I/usr/local/include +LDFLAGS += -L/usr/local/lib + +hyper: hyper.o + $(CXX) $(CXXFLAGS) hyper.o $(LDFLAGS) -lSDL -lSDLMain -lSDL_gfx -lSDL_mixer -lSDL_ttf -framework AppKit -framework OpenGL -o hyper + +hyper.o: *.cpp language-data.cpp + $(CXX) $(CXXFLAGS) -O2 -c hyper.cpp + +langen: langen.cpp + $(CXX) $(CXXFLAGS) -O0 -Wno-embedded-directive langen.cpp -o langen + +# Generation of language-data.cpp +language-data.cpp: langen + ./langen > language-data.cpp + +.PHONY: clean + +clean: + rm -f langen language-data.cpp hyper.o hyper