-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 082a8d9
Showing
29 changed files
with
5,271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "ext/SFML"] | ||
path = ext/SFML | ||
url = https://github.com/SFML/SFML.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(PacMan VERSION 0.99 LANGUAGES C CXX) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif() | ||
|
||
# BUILD EXTERNAL LIBRARIES | ||
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) | ||
ExternalProject_Add(SFML | ||
#GIT_REPOSITORY https://github.com/SFML/SFML.git GIT_TAG 2.5.1 | ||
SOURCE_DIR ${CMAKE_SOURCE_DIR}/ext/SFML | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) | ||
ExternalProject_Get_Property(SFML INSTALL_DIR) | ||
set(SFML_LIB ${INSTALL_DIR}) | ||
|
||
# ADD SOURCE FILES AND HEADERS OF EXECUTABLE | ||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${SFML_LIB}/include ${TINY_XML_LIB}/include) | ||
|
||
set(SOURCE | ||
${CMAKE_SOURCE_DIR}/source/GameEngine.h | ||
${CMAKE_SOURCE_DIR}/source/GameEngine.cpp | ||
${CMAKE_SOURCE_DIR}/source/Geometry.h | ||
${CMAKE_SOURCE_DIR}/source/Geometry.cpp | ||
${CMAKE_SOURCE_DIR}/source/TileMap.h | ||
${CMAKE_SOURCE_DIR}/source/GhostStates.h | ||
${CMAKE_SOURCE_DIR}/source/GhostStates.cpp | ||
${CMAKE_SOURCE_DIR}/source/PacManGame.h | ||
${CMAKE_SOURCE_DIR}/source/PacManGame.cpp | ||
${CMAKE_SOURCE_DIR}/source/Main.cpp | ||
) | ||
|
||
# LINK EXTERNAL LIBRARIES TO EXECUTABLE | ||
LINK_DIRECTORIES(${SFML_LIB}/lib) | ||
|
||
# ADD EXECUTABLE | ||
add_executable(PacMan ${SOURCE}) | ||
if (MSVC) | ||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PacMan) | ||
set_target_properties( PacMan PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/Build") | ||
set_target_properties( PacMan PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/Build") | ||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") | ||
endif(MSVC) | ||
|
||
# ADD DEPENDISIES FOR EXECUTABLE | ||
add_dependencies(PacMan SFML) | ||
|
||
TARGET_LINK_LIBRARIES(PacMan | ||
optimized sfml-system debug sfml-system-d | ||
optimized sfml-window debug sfml-window-d | ||
optimized sfml-graphics debug sfml-graphics-d | ||
optimized sfml-audio debug sfml-audio-d) | ||
|
||
# POST BUILD SCRIPTS | ||
set(POST_LIB_DIR "lib") | ||
if (WIN32) | ||
set(POST_LIB_DIR "bin") | ||
endif() | ||
|
||
ADD_CUSTOM_COMMAND(TARGET PacMan POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${SFML_LIB}/${POST_LIB_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/res" "${CMAKE_CURRENT_BINARY_DIR}/res") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mkdir build | ||
cd build | ||
cmake .. | ||
cmake --build . --config Release |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
**************************** | ||
*............**............* | ||
*.****.*****.**.*****.****.* | ||
*p****.*****.**.*****.****p* | ||
*.****.*****.**.*****.****.* | ||
*..........................* | ||
*.****.**.********.**.****.* | ||
*.****.**.********.**.****.* | ||
*......**....**....**......* | ||
******.***** ** *****.****** | ||
******.***** ** *****.****** | ||
******.** **.****** | ||
******.** ***12*** **.****** | ||
******.** ***34*** **.****** | ||
. **GGGG** . | ||
******.** ******** **.****** | ||
******.** ******** **.****** | ||
******.** F **.****** | ||
******.** ******** **.****** | ||
******.** ******** **.****** | ||
*............**............* | ||
*.****.*****.**.*****.****.* | ||
*.****.*****.**.*****.****.* | ||
*p..**.......P .......**..p* | ||
***.**.**.********.**.**.*** | ||
***.**.**.********.**.**.*** | ||
*......**....**....**......* | ||
*.**********.**.**********.* | ||
*.**********.**.**********.* | ||
*..........................* | ||
**************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
**************************** | ||
............................ | ||
******.**************.****** | ||
******.**************.****** | ||
*............**............* | ||
*.*******.**.**.**.*******.* | ||
*.*******.**.**.**.*******.* | ||
*.**p.....**.**.**.....p**.* | ||
*.**.****.**....**.****.**.* | ||
*.**.****.********.****.**.* | ||
*......**.********.**......* | ||
******.**..........**.****** | ||
******.**.***12***.**.****** | ||
*......**.***34***.**......* | ||
*.****....**....**....****.* | ||
*.****.**.********.**.****.* | ||
*...**.**.********.**.**...* | ||
***.**.**..........**.**.*** | ||
***.**.****.****.****.**.*** | ||
***.**.****.****.****.**.*** | ||
*...........****...........* | ||
*.*********.****.*********.* | ||
*.*********.****.*********.* | ||
.......**....P.....**....... | ||
***.**.**.********.**.**.*** | ||
***.**.**.********.**.**.*** | ||
*..p**.......**.......**p..* | ||
*.****.*****.**.*****.****.* | ||
*.****.*****.**.*****.****.* | ||
*..........................* | ||
**************************** |
Oops, something went wrong.