From 250baa6ccc416ad825c9cc416a6e40bcd082c791 Mon Sep 17 00:00:00 2001 From: Lowest0ne Date: Sat, 20 Apr 2013 14:45:53 -0400 Subject: [PATCH 1/5] Fixed SIZE for Apple --- src/Configuration.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Configuration.hpp b/src/Configuration.hpp index 6e65ce3..f4399f9 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -51,7 +51,7 @@ namespace chesspp ret = ret.substr(0, ret.find_last_of('/')+1); #elif defined(__APPLE__) - if (_NSGetExecutablePath(buf, &size) != 0) + if (_NSGetExecutablePath(buf, SIZE) != 0) throw chesspp::exception("Unable to determine executable path on OS x. (Buffer size too small?)"); ret = buf; ret = ret.substr(0, ret.find_last_of('/')+1) + "../Resources/"; From 71254df646a5186a1f26a10c77f7ad78b941c7db Mon Sep 17 00:00:00 2001 From: Lowest0ne Date: Sat, 20 Apr 2013 14:51:04 -0400 Subject: [PATCH 2/5] Fixed size --- src/Configuration.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Configuration.hpp b/src/Configuration.hpp index f4399f9..69051da 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -33,25 +33,26 @@ namespace chesspp // <.app>/Contents/Resources/res/img... should be where resources are stored. std::string getResourcePath() { - const uint32_t SIZE = 1024; - char buf[SIZE]; - memset(buf, 0, SIZE); + + char buf[1024]; + uint32_t size = sizeof(buf); + memset(buf, 0, size); std::string ret; #if defined(__linux__) - if(readlink("/proc/self/exe", buf, SIZE) == -1) + if(readlink("/proc/self/exe", buf, size) == -1) throw chesspp::exception("Unable to determine executable path on Linux."); ret = buf; ret = ret.substr(0, ret.find_last_of('/')+1); #elif defined(_WIN32) - if(GetModuleFileNameA(NULL, buf, SIZE) == 0) + if(GetModuleFileNameA(NULL, buf, size) == 0) throw chesspp::exception("Unable to determine executable path on Windows."); ret = buf; boost::replace_all(ret, "\\", "/"); ret = ret.substr(0, ret.find_last_of('/')+1); #elif defined(__APPLE__) - if (_NSGetExecutablePath(buf, SIZE) != 0) + if (_NSGetExecutablePath(buf, &size) != 0) throw chesspp::exception("Unable to determine executable path on OS x. (Buffer size too small?)"); ret = buf; ret = ret.substr(0, ret.find_last_of('/')+1) + "../Resources/"; From 21897a5696ea52157347daff3d83d353703db510 Mon Sep 17 00:00:00 2001 From: Lowest0ne Date: Sat, 20 Apr 2013 15:07:03 -0400 Subject: [PATCH 3/5] Changed Initializer list order --- src/AppStateGame.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AppStateGame.cpp b/src/AppStateGame.cpp index e968b00..18bf636 100644 --- a/src/AppStateGame.cpp +++ b/src/AppStateGame.cpp @@ -2,7 +2,10 @@ namespace chesspp { - AppStateGame::AppStateGame( Application* _app, sf::RenderWindow *_display ) : app(_app), AppState(_display), graphics(display) + AppStateGame::AppStateGame( Application* _app, sf::RenderWindow *_display ) + : AppState(_display) + , app(_app) + , graphics(display) { board = new Board(); board->newGame(boardConfig.getInitialLayout()); From 495de6dc14bd1f1f90bb2a3dc495931a70fda8e0 Mon Sep 17 00:00:00 2001 From: Lowest0ne Date: Sat, 20 Apr 2013 16:49:31 -0400 Subject: [PATCH 4/5] edited makefile (lowest0ne) --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d775015..6171f50 100644 --- a/Makefile +++ b/Makefile @@ -17,21 +17,26 @@ $(ODIR)Queen.o $(ODIR)King.o $(ODIR)Logger.o $(ODIR)Piece.o $(ODIR)Position.o\ $(ODIR)Board.o EXECUTABLE = ChessPlusPlus.exe -LIBS = -lsfml-system -lsfml-window -lsfml-graphics +LIBS = -DSFML_STATIC -lsfml-graphics-s -lsfml-window-s -lsfml-system-s $(EXECUTABLE): $(OBJECTS) $(CC) $(FLAGS) $(OBJECTS) -o $(EXECUTABLE) $(LIBDIR) $(LIBS) -$(ODIR)Application.o: $(SOURCEDIR)Application.cpp $(SOURCEDIR)Application.hpp +$(ODIR)Application.o: $(SOURCEDIR)Application.cpp $(SOURCEDIR)Application.hpp\ +$(SOURCEDIR)AppState.hpp $(CC) $(OFLAG) $(INCLUDE) $(SOURCEDIR)Application.cpp -o $(ODIR)Application.o -$(ODIR)AppStateGame.o: $(SOURCEDIR)AppStateGame.cpp $(SOURCEDIR)AppStateGame.hpp +$(ODIR)AppStateGame.o: $(SOURCEDIR)AppStateGame.cpp $(SOURCEDIR)Graphics.hpp\ +$(SOURCEDIR)SFML.hpp $(SOURCEDIR)TextureManager.hpp $(SOURCEDIR)board/Board.hpp\ +$(SOURCEDIR)Configuration.hpp $(SOURCEDIR)AppStateGame.hpp $(CC) $(OFLAG) $(INCLUDE) $(SOURCEDIR)AppStateGame.cpp -o $(ODIR)AppStateGame.o -$(ODIR)Graphics.o: $(SOURCEDIR)Graphics.cpp $(SOURCEDIR)Graphics.hpp +$(ODIR)Graphics.o: $(SOURCEDIR)Graphics.cpp $(SOURCEDIR)Graphics.hpp\ +$(SOURCEDIR)SFML.hpp $(SOURCEDIR)TextureManager.hpp $(SOURCEDIR)board/Piece.hpp\ +$(SOURCEDIR)board/logger.hpp $(SOURCEDIR)Configuration.hpp $(CC) $(OFLAG) $(INCLUDE) $(SOURCEDIR)Graphics.cpp -o $(ODIR)Graphics.o -$(ODIR)Main.o: $(SOURCEDIR)Main.cpp +$(ODIR)Main.o: $(SOURCEDIR)Main.cpp $(SOURCEDIR)Application.hpp $(CC) $(OFLAG) $(INCLUDE) $(SOURCEDIR)Main.cpp -o $(ODIR)Main.o $(ODIR)Pawn.o: $(SOURCEDIR)board/Pawn.cpp $(SOURCEDIR)board/Pawn.hpp From 586f17bfc6a471023f2f9ecc9c51ce5e8be27b48 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Sat, 20 Apr 2013 15:53:17 -0500 Subject: [PATCH 5/5] Add clang windows batch --- .gitmodules | 3 +++ Makefile => Makefile.Lowest0ne | 0 Makefile.Thumperr => Makefile.Thumperrr | 0 build_clang_win.bat | 2 ++ lib/boost | 1 + 5 files changed, 6 insertions(+) rename Makefile => Makefile.Lowest0ne (100%) rename Makefile.Thumperr => Makefile.Thumperrr (100%) create mode 100644 build_clang_win.bat create mode 160000 lib/boost diff --git a/.gitmodules b/.gitmodules index 340aaf5..112d7c0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/SFML"] path = lib/SFML url = git://github.com/LaurentGomila/SFML.git +[submodule "lib/boost"] + path = lib/boost + url = git://github.com/ryppl/boost-svn.git diff --git a/Makefile b/Makefile.Lowest0ne similarity index 100% rename from Makefile rename to Makefile.Lowest0ne diff --git a/Makefile.Thumperr b/Makefile.Thumperrr similarity index 100% rename from Makefile.Thumperr rename to Makefile.Thumperrr diff --git a/build_clang_win.bat b/build_clang_win.bat new file mode 100644 index 0000000..6d3fdc7 --- /dev/null +++ b/build_clang_win.bat @@ -0,0 +1,2 @@ +clang++ -std=c++11 -o chesspp.exe -isystem lib/boost/boost/ -isystem lib/SFML/include/ -Llib/SFML/lib/ -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-system -lsfml-window src/*.cpp src/board/*.cpp +pause diff --git a/lib/boost b/lib/boost new file mode 160000 index 0000000..fcfba33 --- /dev/null +++ b/lib/boost @@ -0,0 +1 @@ +Subproject commit fcfba33e940cdb150b18d1d03821dcb30af52a94