diff --git a/CMakeLists.txt b/CMakeLists.txt index c0c2bbf..3cce122 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(ZZZZZZ_DESKTOP_DIR /usr/share/applications) set(VERSION_MAJOR 0) set(VERSION_MINOR 1) SET(VERSION_PATCH 0) -SET(RELEASE_TYPE "alpha") +SET(RELEASE_STATE "alpha") # Generate files configure_file ( @@ -30,15 +30,64 @@ project(${PROJECT_NAME} VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATC ##########################Compile########################## # Find required packages set(CURSES_NEED_WIDE TRUE) +set(CURSES_NEED_NCURSES TRUE) find_package(Curses REQUIRED) find_package(cJSON REQUIRED) -#TODO: I know globbing c files is bad practice, but when we're this early in development, it's just plain easier. -file(GLOB SRCS "src/*.c") -add_executable(${PROJECT_NAME} ${SRCS} windows/curses/windows.c windows/curses/menu.c) -#TODO: Inclusion directories in this way is also considered bad practice. -target_include_directories(${PROJECT_NAME} PUBLIC include ${CJSON_INCLUDE_DIR} ${CURSES_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} PUBLIC ${CJSON_LIBRARIES} ${CURSES_LIBRARIES} -lpanel) +# Source files +set (SOURCES + src/action.c + src/actor.c + src/ai.c + src/combat.c + src/fov.c + src/gameover.c + src/invent.c + src/main.c + src/map.c + src/mapgen.c + src/message.c + src/parser.c + src/pqueue.c + src/random.c + src/register.c + src/render.c + src/save.c + src/spawn.c + src/tile.c + windows/curses/windows.c + windows/curses/menu.c) +set (HEADERS + include/action.h + include/actor.h + include/ai.h + include/color.h + include/combat.h + include/fov.h + include/gameover.h + include/invent.h + include/map.h + include/mapgen.h + include/menu.h + include/message.h + include/parser.h + include/pqueue.h + include/random.h + include/register.h + include/render.h + include/save.h + include/spawn.h + include/tactics.h + include/tile.h + include/version.h + include/wfc.h + include/windows.h) +set (INCLUDE_DIR include) + +# Create executable +add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) +target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIR} ${CJSON_INCLUDE_DIR} ${CURSES_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${CJSON_LIBRARIES} -lpanelw ${CURSES_LIBRARIES}) set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") # Copy data files @@ -48,7 +97,8 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD ${CMAKE_SOURCE_DIR}/data $/data COMMENT "Copying data folder to output dir.") -message(STATUS "Configuring CMake for ${PROJECT_NAME} v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${RELEASE_TYPE}") +message(STATUS "Configuring CMake for ${PROJECT_NAME} v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${RELEASE_STATE}") +message(STATUS "Release Type: ${CMAKE_BUILD_TYPE}") ##########################Install########################## install(TARGETS ${PROJECT_NAME} DESTINATION .) install(DIRECTORY ${CMAKE_SOURCE_DIR}/data/ DESTINATION data) diff --git a/CMakePresets.json b/CMakePresets.json index fa19562..54ef77d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -2,7 +2,7 @@ "version": 4, "cmakeMinimumRequired": { "major": 3, - "minor": 23, + "minor": 28, "patch": 0 }, "configurePresets": [ diff --git a/README.md b/README.md index a35031b..1e31ce4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ An attack can be one or more of four types: Low, Mid, High, or Grab. Conversely, If an attack hits, the target takes full damage and enters a stunned state. If an attack is blocked, the target takes only partial damage and is not stunned. +## System Requirements + +This is a console-based roguelike written in plain C. A moldering potato can probably run this game. The potato, however, must be equipped with the following: + +- Ncurses + ## Building from Source Zenzizenzizenzic is built using CMake. @@ -38,12 +44,6 @@ directory. While both the win and lose state are reachable, the game is still very far from what I would consider playable. -### Can My Computer Run It? -This is a console-based roguelike written in plain C. A potato can probably run this game. - -In all seriousness, your computer can almost certainly run this. At worst, using -autoexplore might eat up some RAM in a low memory environment. - ### Why C? This is a traditional roguelike, and follows the Berlin Interpretation diff --git a/include/version.h.in b/include/version.h.in index b50e9bd..ddb791d 100644 --- a/include/version.h.in +++ b/include/version.h.in @@ -7,9 +7,13 @@ #define VERSION_MINOR ${VERSION_MINOR} /* 0.0.x */ #define VERSION_PATCH ${VERSION_PATCH} +/* Alpha, Beta, Release */ +#define RELEASE_STATE "${RELEASE_STATE}" /* Release, Debug, Test, etc. */ -#define RELEASE_TYPE "${RELEASE_TYPE}" -/* Report Repo */ -#define REPO_URL "https://github.com/NullCGT/Zenzizenzizenzic-RL" +#define RELEASE_TYPE "${CMAKE_BUILD_TYPE}" /* Short Description */ -#define SHORT_DESC "${PROJECT_DESCRIPTION}" \ No newline at end of file +#define SHORT_DESC "${PROJECT_DESCRIPTION}" +/* Author */ +#define AUTHOR "${PROJECT_VENDOR}" +/* Report Repo */ +#define REPO_URL "https://github.com/NullCGT/Zenzizenzizenzic-RL" \ No newline at end of file diff --git a/src/main.c b/src/main.c index a142687..4869394 100644 --- a/src/main.c +++ b/src/main.c @@ -153,7 +153,7 @@ error_t parse_args(int key, char *arg, struct argp_state *state) { g.practice = 1; break; case 'v': - printf("v%d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, RELEASE_TYPE); + printf("v%d.%d.%d-%s (%s)\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, RELEASE_STATE, RELEASE_TYPE); exit(0); break; case 't': diff --git a/windows/curses/windows.c b/windows/curses/windows.c index 0447c2a..72ea3be 100644 --- a/windows/curses/windows.c +++ b/windows/curses/windows.c @@ -87,7 +87,7 @@ void title_screen(void) { box(background, 0, 0); snprintf(buf, sizeof(buf), "Zenzizenzizenzic v%d.%d.%d-%s", - VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, RELEASE_TYPE); + VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, RELEASE_STATE); selector = menu_new(buf, 1, 1, 35, 8); menu_add_item(selector, 'p', "Play");