Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
15 changes: 10 additions & 5 deletions Makefile → Makefile.Lowest0ne
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions build_clang_win.bat
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/boost
Submodule boost added at fcfba3
5 changes: 4 additions & 1 deletion src/AppStateGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
11 changes: 6 additions & 5 deletions src/Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ 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, "\\", "/");
Expand Down