From 09615be926efb7302bc348aa66feccb694b23ba8 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Wed, 15 Jun 2022 23:36:43 -0400 Subject: v0.1.0 - Initial Commit Create dng - a maze/puzzle game enging using Lua and SFML --- Initial setup commit This setups up the project for messing around with C++ and Lua bindings. So far this project just prints the defined dng map and lets you move the character around. What this fails to do is actually provide any reason to use Lua at the moment. So I need to figure out some way of enabling logic on the processing side of things. Fixup warning from IntelliJ Added onUpdate logic to move the enemies etc Created some algorithm logic for enemy movement Allowed for default overrides Made shortest path alg more efficent In the previous commit this algo waited until the "success" step came up in the queue. Now we have the check during the push - and if an hits we return true from the push_moves fn. Since we're only interested in the initial move (since we check moves every frame) we can only return true and then use the current step as the origin position to diff against the start to get the dx,dy Add scene controls and win/loss scenarios Setup ability to check collisions and transition game scene Remove SFML for now Create level 2 Fixup - Can now have levels without a proc.lua Checked existence of wrong file for loading defaults Add readme and ignore build files Setup so it can build on debian Reformat bill merge Make installable You can now do: `sudo make install` and have it publish and distribute the dng lua files to the share dir Bump version to 0.3.1 Opps forgot to unignore dng folder Force local version if in current dir This should allow development to ALWAYS prefer the local version of the lib - so if you have an installed version it won't override local changes Set version to 0.3.2 Bump version to 0.3.3 Update to use SFML (for gameplay) Intro/Win/Loss not supported yet Remove install logic for now + make mov overrides Allow for restart on win/loss Add scroll viewport and max window sizes Display win/loss (need restart view fix) Fix recenter view on restart v0.4.0 - SFML Dynamic text rescale This isn't the best since we rescale it every frame we render it on, we should render all the text once and remember it. If we want to support "resizing" we can do that in its own logic loop MessageBox + Filesystem lookups for files Created MessageBox which is a helper class to allow for printing any dialog in a scalable way. Added path overrides for lua files as well as the ability to seek the filesystem for specific paths for the fonts and such. Set version to 0.4.2 Creating submodules? Added SFML as third party lib Use git submodules for dependencies Set license to zlib/png Add thirdparty licenses and include in package Set version to 0.1.0 --- CMakeLists.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 CMakeLists.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..69cd9b2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.16) +project(dng + VERSION 0.1.0) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}) + +# Setup Lua Libraries +# To determine which files look at the lua/makefile to see how the targets are built +set(LUA_SRC ${PROJECT_SOURCE_DIR}/thirdparty/lua) +add_library(lua STATIC + ${LUA_SRC}/lapi.c + ${LUA_SRC}/lcode.c + ${LUA_SRC}/lctype.c + ${LUA_SRC}/ldebug.c + ${LUA_SRC}/ldo.c + ${LUA_SRC}/ldump.c + ${LUA_SRC}/lfunc.c + ${LUA_SRC}/lgc.c + ${LUA_SRC}/llex.c + ${LUA_SRC}/lmem.c + ${LUA_SRC}/lobject.c + ${LUA_SRC}/lopcodes.c + ${LUA_SRC}/lparser.c + ${LUA_SRC}/lstate.c + ${LUA_SRC}/lstring.c + ${LUA_SRC}/ltable.c + ${LUA_SRC}/ltm.c + ${LUA_SRC}/lundump.c + ${LUA_SRC}/lvm.c + ${LUA_SRC}/lzio.c + ${LUA_SRC}/ltests.c) +add_library(lauxlib STATIC ${LUA_SRC}/lauxlib.c) +add_library(lualib STATIC + ${LUA_SRC}/lbaselib.c + ${LUA_SRC}/lcorolib.c + ${LUA_SRC}/ldblib.c + ${LUA_SRC}/linit.c + ${LUA_SRC}/liolib.c + ${LUA_SRC}/lmathlib.c + ${LUA_SRC}/loadlib.c + ${LUA_SRC}/loslib.c + ${LUA_SRC}/lstrlib.c + ${LUA_SRC}/ltablib.c + ${LUA_SRC}/lutf8lib.c) +target_compile_definitions(lualib PRIVATE -DLUA_USE_POSIX=1) # to properly use mkstemp +target_include_directories(lua PUBLIC lua) +target_include_directories(lauxlib PUBLIC lua) +target_include_directories(lualib PUBLIC lua) +target_link_libraries(lauxlib lua) +set(LUA_LIBRARIES lua lualib lauxlib) +include_directories(${PROJECT_SOURCE_DIR}/thirdparty/lua) + +# System specific includes +if (UNIX) + set(RES_LIB src/linux/res.h) +endif () + +add_executable(${PROJECT_NAME} src/main.cpp src/Level.cpp src/Level.h src/CApi.h src/Scene.h src/LuaApi.h src/MessageBox.h ${RES_LIB}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${LUA_LIBRARIES}) + +# configure and link SFML +set(BUILD_SHARED_LIBS FALSE) +set(SFML_LIBRARIES sfml-system sfml-window sfml-graphics) +if (WIN32) + set(SFML_USE_STATIC_STD_LIBS TRUE) +endif () +set(SFML_USE_SYSTEM_DEPS ON) +set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON) +add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/SFML EXCLUDE_FROM_ALL) +target_link_libraries(${PROJECT_NAME} PUBLIC ${SFML_LIBRARIES} ${LUA_LIBRARIES}) + + +# Install Directives + +if (UNIX) + set(SFML_INSTALL_PKGCONFIG_FILES FALSE) +endif () +install(TARGETS ${PROJECT_NAME} DESTINATION .) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION .) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/maps DESTINATION .) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dnglib DESTINATION .) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION .) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/thirdparty-licenses.txt DESTINATION .) + + +# Package Directives +set(CPACK_GEN TGZ) +if (WIN32) + set(CPACK_GEN ZIP) +endif () + +set(CPACK_GENERATOR ${CPACK_GEN}) +set(CPACK_SOURCE_GENERATOR ${CPACK_GEN}) +set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +include(CPack) \ No newline at end of file -- cgit v1.2.3-54-g00ecf