From eed01703b192f2fdd473633db45ceecac93de45b Mon Sep 17 00:00:00 2001 From: Jon Daniel Date: Tue, 15 Mar 2022 09:42:30 +0100 Subject: [PATCH] Add CMake build system and and updated README.md --- .gitignore | 39 ++++++++- CMakeLists.txt | 45 ++++++++++ README.md | 55 ++++++++++++ cmake/FindMath.cmake | 76 +++++++++++++++++ cmake/examples.cmake | 28 +++++++ {example4 => examples/putemple}/Makefile.win | 0 {example4 => examples/putemple}/putemple.c | 10 +-- {example4 => examples/putemple}/putemple.dev | 0 .../putemple}/putemple_private.h | 0 .../putemple}/putemple_private.rc | 0 {example1 => examples/putgems}/Makefile.win | 0 {example1 => examples/putgems}/putgems.c | 12 +-- {example1 => examples/putgems}/putgems.dev | 0 {example2 => examples/puttrain}/Makefile.win | 0 {example2 => examples/puttrain}/puttrain.c | 12 +-- {example2 => examples/puttrain}/puttrain.dev | 0 {example3 => examples/viewmap}/Makefile.win | 0 {example3 => examples/viewmap}/viewmap.c | 10 +-- {example3 => examples/viewmap}/viewmap.dev | 0 .../viewmap}/viewmap_private.h | 0 .../viewmap}/viewmap_private.rc | 0 libadikted/CMakeLists.txt | 83 +++++++++---------- libadikted/{Makefile => Makefile.win} | 0 libadikted/cmake/FindMath.cmake | 76 +++++++++++++++++ libadikted/libadikted.pc.in | 12 +++ mapslang/CMakeLists.txt | 77 +++++++++++++++++ mapslang/{Makefile => Makefile.win} | 6 +- mapslang/cmake/FindMath.cmake | 76 +++++++++++++++++ mapslang/input_kb.c | 2 +- mapslang/main.c | 12 ++- mapslang/output_scr.c | 2 +- mapslang/scr_actn.c | 2 +- mapslang/scr_actn.h | 2 +- mapslang/scr_clm.c | 2 +- mapslang/scr_cube.c | 2 +- mapslang/scr_help.c | 11 ++- mapslang/scr_help.h | 5 ++ mapslang/scr_list.c | 2 +- mapslang/scr_rwrk.c | 2 +- mapslang/scr_slab.c | 2 +- mapslang/scr_thing.c | 2 +- mapslang/scr_tileset.c | 6 +- mapslang/scr_txted.c | 2 +- mapslang/scr_txtgen.c | 2 +- mapslang/textmenu.c | 3 +- mapslang/textmenu.h | 2 +- mapslang/var_utils.c | 6 +- 47 files changed, 589 insertions(+), 97 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 cmake/FindMath.cmake create mode 100644 cmake/examples.cmake rename {example4 => examples/putemple}/Makefile.win (100%) rename {example4 => examples/putemple}/putemple.c (98%) rename {example4 => examples/putemple}/putemple.dev (100%) rename {example4 => examples/putemple}/putemple_private.h (100%) rename {example4 => examples/putemple}/putemple_private.rc (100%) rename {example1 => examples/putgems}/Makefile.win (100%) rename {example1 => examples/putgems}/putgems.c (90%) rename {example1 => examples/putgems}/putgems.dev (100%) rename {example2 => examples/puttrain}/Makefile.win (100%) rename {example2 => examples/puttrain}/puttrain.c (94%) rename {example2 => examples/puttrain}/puttrain.dev (100%) rename {example3 => examples/viewmap}/Makefile.win (100%) rename {example3 => examples/viewmap}/viewmap.c (97%) rename {example3 => examples/viewmap}/viewmap.dev (100%) rename {example3 => examples/viewmap}/viewmap_private.h (100%) rename {example3 => examples/viewmap}/viewmap_private.rc (100%) rename libadikted/{Makefile => Makefile.win} (100%) create mode 100644 libadikted/cmake/FindMath.cmake create mode 100644 libadikted/libadikted.pc.in create mode 100644 mapslang/CMakeLists.txt rename mapslang/{Makefile => Makefile.win} (95%) create mode 100644 mapslang/cmake/FindMath.cmake diff --git a/.gitignore b/.gitignore index 26ec652..ed5879a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,43 @@ *.dll *.def *.exe -/lib/slang* -/mapslang/pkg/* +*.so +*.a +*.pc +*.log +lib/slang* +mapslang/pkg/* +mapslang/mapslang +mapslang/map +map .vs/ .git /.cproject /.project /.settings/ -/tmp/ -/build/ +tmp/ +build/ +Makefile +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +install_manifest.txt +libadikted/CMakeFiles/ +libadikted/CMakeCache.txt +libadikted/Makefile* +libadikted/cmake_install.cmake +libadikted/install_manifest.txt +mapslang/CMakeFiles/ +mapslang/CMakeCache.txt +mapslang/cmake_install.cmake +mapslang/Makefile* +mapslang/install_manifest.txt +mapslang/map +putemple +puttrain +putgems +viewmap* +./putemple +./puttrain +./putgems +./viewmap* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..51c3449 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required( VERSION 3.1 ) + +project( ADiKtED LANGUAGES C ) +set(PROJECT_DESCRIPTION "Dungeon Keeper 1 map editor") + +include(GNUInstallDirs) +include(FindPkgConfig) + +if( NOT CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE ) +endif() + +set( CMAKE_C_STANDARD 99 ) +set( CMAKE_C_STANDARD_REQUIRED ON ) + +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-switch" ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic" ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra" ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-conversion -Wno-traditional-conversion -Wno-sign-compare" ) + +# Add Math::Math +include(cmake/FindMath.cmake) + +# Add examples +include(cmake/examples.cmake) +option( ADIKTED_BUILD_EXAMPLES "Build ADiKtEd examples" ON ) +if( ADIKTED_BUILD_EXAMPLES ) + set( + ADIKTED_EXAMPLES + putgems + puttrain + viewmap + putemple + ) + +foreach( EXAMPLE ${ADIKTED_EXAMPLES} ) + add_example( ${EXAMPLE} ) + endforeach() +endif() + +add_subdirectory(libadikted) +add_subdirectory(mapslang) + +install( TARGETS ${ADIKTED_EXAMPLES} RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binaries) diff --git a/README.md b/README.md new file mode 100644 index 0000000..8bad11e --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# Adikted Dungeon Keeper Map Editor + +Note - there is now a manual available for ADiKtEd. +It even includes a basic tutorial to quickly learn the program. +A version of it is included within this distribution, +called `dk_adikted_manual.htm`. You may wish to print this out. +## Build + +### Unix-like systems + +#### CMake + +Run +`cmake --install-prefix=/usr . && make install` +and copy the examples to the keeperfx directory + +### Windows + +#### make + +Run `cd libadikted/ && make -f Makefile.win && cd mapslang && make -f Makefile.win` + +Here's the Win32 version executable. Just put all the +files in the same directory, edit map.ini as appropriate (you should +change paths to your DK files; you can also change other parameters +if you want), and run it. + +## Usage + +Run `map [mapfile] [-m ] [-v] [-r] [-n] [-s [mapfile]] [-q]` + +When ADiKtEd saves a map, it will ask you what you wish to call it +(unless you're not using quick save). I suggest you don't save +directly over the Dungeon Keeper original levels, but keep it +in the current directory until you're finished. +Then, at end, save it on `map00001` to access it easily in the game. + +You'll need a level script for your newly created level. You may be +able to get by with the script which comes with the original level 1 +- ie just copy it and paste into TXT file of your new map - but +if not, study the level scripts reference from `dk_scripting_ref.htm`. +You can also try looking at the original DK and DD levels for examples. + +Press F1 for help. + +## TODO before final + Fixations in room things parameters (height,other) + Fixations in room corner graphics + +## Author + Jon Skeet, skeet@pobox.com + +Dev-C++ IDE version, +rewritten most of the code: + Tomasz Lis diff --git a/cmake/FindMath.cmake b/cmake/FindMath.cmake new file mode 100644 index 0000000..ca854c9 --- /dev/null +++ b/cmake/FindMath.cmake @@ -0,0 +1,76 @@ +include (CheckLibraryExists) +set(Math_FOUND FALSE) +set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET}) +set(CMAKE_REQUIRED_QUIET ${Math_FIND_QUIETLY}) + +if(CMAKE_C_COMPILER_LOADED) + include (CheckIncludeFile) + include (CheckCSourceCompiles) +elseif(CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) + include (CheckCXXSourceCompiles) +else() + message(FATAL_ERROR "FindMath only works if either C or CXX language is enabled") +endif() + +set(MATH_C_CXX_TEST_SOURCE [====[ +#include + +int main() +{ + const double x = 7.3; + ceil(x); + acos(x); + sin(x); + sqrt(x); + + return 0; +} +]====]) + + +if(CMAKE_C_COMPILER_LOADED) + CHECK_INCLUDE_FILE("math.h" CMAKE_HAVE_MATH_H) +else() + CHECK_INCLUDE_FILE_CXX("math.h" CMAKE_HAVE_MATH_H) +endif() + +if(CMAKE_HAVE_MATH_H) + set(CMAKE_HAVE_MATH_LIBRARY) + + set(CMAKE_REQUIRED_LIBRARIES -lm) + if(CMAKE_C_COMPILER_LOADED) + CHECK_C_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + elseif(CMAKE_CXX_COMPILER_LOADED) + CHECK_CXX_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + endif() + + if(CMAKE_HAVE_LIBC_LIBM) + set(CMAKE_MATH_LIBS_INIT ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_HAVE_MATH_LIBRARY 1) + set(Math_FOUND TRUE) + else() + set(Math_FOUND FALSE) + endif() + + unset(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE}) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Math DEFAULT_MSG Math_FOUND) + + if(MATH_FOUND AND NOT TARGET Math::Math) + add_library(Math::Math INTERFACE IMPORTED) + + if(CMAKE_MATH_LIBS_INIT) + set_property(TARGET Math::Math PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_MATH_LIBS_INIT}") + endif() + elseif(NOT MATH_FOUND) + file(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler accepts -lm failed with the following output:\n${_cmake_find_math_output}\n\n") + message(SEND_ERROR "Required Math library not found!") + endif() +endif() + +unset(_cmake_find_math_output) diff --git a/cmake/examples.cmake b/cmake/examples.cmake new file mode 100644 index 0000000..76eab47 --- /dev/null +++ b/cmake/examples.cmake @@ -0,0 +1,28 @@ +function( add_example ARG_NAME ) + list( APPEND ARG_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/examples/${ARG_NAME}" ) + set( SOURCES "" ) + set( RESOURCES "" ) + foreach( DIR ${ARG_DIRECTORIES} ) + file( GLOB GLOB_SOURCES ${DIR}/*.c ${DIR}/*.h ) + list( APPEND SOURCES ${GLOB_SOURCES} ) + file( GLOB GLOB_RESOURCES ${DIR}/*.rc ) + list( APPEND RESOURCES ${GLOB_RESOURCES} ) + endforeach() + add_executable( ${ARG_NAME} ${SOURCES} ) + target_link_libraries( ${ARG_NAME} PUBLIC adikted ) + find_package( SDL REQUIRED ) + target_link_libraries( ${ARG_NAME} PUBLIC ${SDL_LIBRARY} ) + target_compile_definitions( ${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_SDL ) + target_link_libraries( ${ARG_NAME} PUBLIC X11 Math::Math ) + target_include_directories(${ARG_NAME} PUBLIC Math::Math + $ + $ + ${SDL_INCLUDE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.) + + # Directory name + set_target_properties( ${ARG_NAME} PROPERTIES FOLDER + "${CMAKE_CURRENT_SOURCE_DIR}/examples" ) + add_test(${ARG_NAME} ${ARG_NAME}) +endfunction() + diff --git a/example4/Makefile.win b/examples/putemple/Makefile.win similarity index 100% rename from example4/Makefile.win rename to examples/putemple/Makefile.win diff --git a/example4/putemple.c b/examples/putemple/putemple.c similarity index 98% rename from example4/putemple.c rename to examples/putemple/putemple.c index 8af279e..24903e9 100644 --- a/example4/putemple.c +++ b/examples/putemple/putemple.c @@ -1,6 +1,6 @@ /******************************************************************************/ /** @file putemple.c - * ADiKtEd library example 4. + * ADiKtEd library putemple example. * @par Purpose: * Demonstrates fast drawing routines and putting slabs with mouse. * Also, shows how to draw ADiKtEd messages using DK font. @@ -23,7 +23,7 @@ #include #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #define ONE_LOOP_DELAY 20 /** @@ -404,7 +404,7 @@ static void process_events() // contains error message. // Release the error message. message_release(); - message_info("example4 finished with map load error"); + message_info("putemple finished with map load error"); reload_data=0; level_redraw=0; clip_view=0; @@ -425,7 +425,7 @@ static void process_events() { // Release the error message. message_release(); - message_info("example4 finished with data files load error"); + message_info("putemple finished with data files load error"); level_redraw=0; clip_view=0; done = 1; @@ -493,7 +493,7 @@ int main (int argc, char *argv[]) free_messages(); return 2; } - SDL_WM_SetCaption ("ADiKtEd Libray example 4", NULL); + SDL_WM_SetCaption ("ADiKtEd Libray putemple example", NULL); message_log("Preparing data structures"); // create object for storing map diff --git a/example4/putemple.dev b/examples/putemple/putemple.dev similarity index 100% rename from example4/putemple.dev rename to examples/putemple/putemple.dev diff --git a/example4/putemple_private.h b/examples/putemple/putemple_private.h similarity index 100% rename from example4/putemple_private.h rename to examples/putemple/putemple_private.h diff --git a/example4/putemple_private.rc b/examples/putemple/putemple_private.rc similarity index 100% rename from example4/putemple_private.rc rename to examples/putemple/putemple_private.rc diff --git a/example1/Makefile.win b/examples/putgems/Makefile.win similarity index 100% rename from example1/Makefile.win rename to examples/putgems/Makefile.win diff --git a/example1/putgems.c b/examples/putgems/putgems.c similarity index 90% rename from example1/putgems.c rename to examples/putgems/putgems.c index 6c33380..c6f9eff 100644 --- a/example1/putgems.c +++ b/examples/putgems/putgems.c @@ -1,6 +1,6 @@ /******************************************************************************/ /** @file putgems.c - * ADiKtEd library example 1. + * ADiKtEd library putgems example. * @par Purpose: * This example puts gems on center of gold vein in map 1. * Demonstrates how to load/save map, and how to change slabs. @@ -19,7 +19,7 @@ #include #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" int main(int argc, char *argv[]) { @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) // but still they have to be initialized) init_messages(); - printf("\nexample1: how to put gems on map\n\n"); + printf("\nputgems: how to put gems on map\n\n"); // Setting file name of the map to load format_lvl_fname(lvl,"Levels/MAP00001"); @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) if (result!=ERR_NONE) { printf("cannot load map\n"); - printf("example1 finished with error\n"); + printf("putgems finished with error\n"); system("pause"); // The following two commands should be used to free memory @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) if (result!=ERR_NONE) { printf("cannot save map\n"); - printf("example1 finished with error\n"); + printf("putgems finished with error\n"); system("pause"); // The following two commands should be used to free memory @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) return 1; } printf("map \"%s\" saved\n", get_lvl_savfname(lvl)); - printf("example1 finished successfully\n"); + printf("putgems finished successfully\n"); system("pause"); // The following two commands should be used to free memory diff --git a/example1/putgems.dev b/examples/putgems/putgems.dev similarity index 100% rename from example1/putgems.dev rename to examples/putgems/putgems.dev diff --git a/example2/Makefile.win b/examples/puttrain/Makefile.win similarity index 100% rename from example2/Makefile.win rename to examples/puttrain/Makefile.win diff --git a/example2/puttrain.c b/examples/puttrain/puttrain.c similarity index 94% rename from example2/puttrain.c rename to examples/puttrain/puttrain.c index f4ef6c9..899d0d8 100644 --- a/example2/puttrain.c +++ b/examples/puttrain/puttrain.c @@ -1,6 +1,6 @@ /******************************************************************************/ /** @file puttrain.c - * ADiKtEd library example 2. + * ADiKtEd library puttrain example. * @par Purpose: * This example puts 3x5 training room in bottom right part of map 1. * Demonstrates how to change many slabs at once, @@ -20,7 +20,7 @@ #include #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" int main(int argc, char *argv[]) { @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) // Instead of printing the message directly, we will send it // to the internal messages system. - message_info("example2: how to put a larger room on map"); + message_info("puttrain: how to put a larger room on map"); // Now we can easily get the message back, even multiple times. printf("%s\n",message_get()); @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) // Now, as the buffer is released, the message_info() function // can be used to store next message. - message_info("example2 finished with load error"); + message_info("puttrain finished with load error"); printf("%s\n",message_get()); system("pause"); @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) // Now, as the buffer is released, the message_info() function // can be used to store next message. - message_info("example2 finished with save error"); + message_info("puttrain finished with save error"); printf("%s\n",message_get()); system("pause"); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) printf("%s\n",message_get()); message_release(); - message_info("example2 finished successfully"); + message_info("puttrain finished successfully"); printf("%s\n",message_get()); system("pause"); diff --git a/example2/puttrain.dev b/examples/puttrain/puttrain.dev similarity index 100% rename from example2/puttrain.dev rename to examples/puttrain/puttrain.dev diff --git a/example3/Makefile.win b/examples/viewmap/Makefile.win similarity index 100% rename from example3/Makefile.win rename to examples/viewmap/Makefile.win diff --git a/example3/viewmap.c b/examples/viewmap/viewmap.c similarity index 97% rename from example3/viewmap.c rename to examples/viewmap/viewmap.c index 09e6f9a..28f3fe4 100644 --- a/example3/viewmap.c +++ b/examples/viewmap/viewmap.c @@ -1,6 +1,6 @@ /******************************************************************************/ /** @file viewmap.c - * ADiKtEd library example 3. + * ADiKtEd library viewmap example. * @par Purpose: * This example shows how to view maps graphically using libAdikted. * Move with mouse, zoom with numpad +/-. @@ -22,7 +22,7 @@ #include #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #define ONE_LOOP_DELAY 32 /** @@ -279,7 +279,7 @@ static void process_events() // Release the error message. message_release(); - message_info("example3 finished with data files load error"); + message_info("viewmap finished with data files load error"); clip_view=0; done = 1; @@ -339,7 +339,7 @@ int main (int argc, char *argv[]) free_messages(); return 2; } - SDL_WM_SetCaption ("ADiKtEd Libray example 3", NULL); + SDL_WM_SetCaption ("ADiKtEd Libray viewmap example", NULL); // create object for storing map level_init(&lvl,MFV_DKGOLD,NULL); @@ -365,7 +365,7 @@ int main (int argc, char *argv[]) // Release the error message. message_release(); - message_info("example3 finished with map load error"); + message_info("viewmap finished with map load error"); level_free(lvl); level_deinit(&lvl); diff --git a/example3/viewmap.dev b/examples/viewmap/viewmap.dev similarity index 100% rename from example3/viewmap.dev rename to examples/viewmap/viewmap.dev diff --git a/example3/viewmap_private.h b/examples/viewmap/viewmap_private.h similarity index 100% rename from example3/viewmap_private.h rename to examples/viewmap/viewmap_private.h diff --git a/example3/viewmap_private.rc b/examples/viewmap/viewmap_private.rc similarity index 100% rename from example3/viewmap_private.rc rename to examples/viewmap/viewmap_private.rc diff --git a/libadikted/CMakeLists.txt b/libadikted/CMakeLists.txt index 652e56e..e9a1b5a 100644 --- a/libadikted/CMakeLists.txt +++ b/libadikted/CMakeLists.txt @@ -1,80 +1,77 @@ -## -## -## - - -## 3.1 -- CMAKE_C_STANDARD cmake_minimum_required( VERSION 3.1 ) +set( TARGET_NAME adikted ) +project( lib${TARGET_NAME} LANGUAGES C ) +set( PROJECT_DESCRIPTION "Dungeon Keeper 1 ADiKtEd map editor C library" ) -if( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" ) - message( FATAL_ERROR "Building in source is forbidden. Change output directory.") -endif() - - -project( libadikted LANGUAGES C ) - +include(GNUInstallDirs) +include(FindPkgConfig) if( NOT CMAKE_BUILD_TYPE ) - set( CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE ) endif() -if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - ## do not install accidentally to system directory - set( CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install path prefix" FORCE ) -endif() - - set(CMAKE_DEBUG_POSTFIX _d) - -## -## set default compilation standard -## set( CMAKE_C_STANDARD 99 ) set( CMAKE_C_STANDARD_REQUIRED ON ) - -## -## compiler flags, gcc does not handle "appended" values -## -set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-switch" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-conversion -Wno-traditional-conversion -Wno-sign-compare" ) - +include(cmake/FindMath.cmake) ## ================= build ================= -option( USE_RNG_MT "Use Mersenne Twister RNG" OFF ) +option( USE_RNG_MT "Use Mersenne Twister RNG" ON ) if( USE_RNG_MT ) add_definitions( -DRNG_MT ) endif() -set( TARGET_NAME adikted ) if( NOT ${TARGET_NAME}_TYPE ) ## build library as shared by default set( ${TARGET_NAME}_TYPE SHARED ) endif() +file( GLOB c_files ${CMAKE_CURRENT_SOURCE_DIR}/*.c) +file( GLOB h_files ${CMAKE_CURRENT_SOURCE_DIR}/*.h) -file( GLOB_RECURSE c_files *.c ) -file( GLOB_RECURSE h_files *.h ) - -if( NOT USE_RNG_MT ) - list(REMOVE_ITEM h_files "${CMAKE_CURRENT_SOURCE_DIR}/mtwist/mtwist.h" ) - list(REMOVE_ITEM c_files "${CMAKE_CURRENT_SOURCE_DIR}/mtwist/mtwist.c" ) +if( USE_RNG_MT ) + list(APPEND h_files "${CMAKE_CURRENT_SOURCE_DIR}/mtwist/mtwist.h" ) + list(APPEND c_files "${CMAKE_CURRENT_SOURCE_DIR}/mtwist/mtwist.c" ) endif() add_library( ${TARGET_NAME} ${${TARGET_NAME}_TYPE} ${c_files} ) -target_include_directories( ${TARGET_NAME} PUBLIC ".." PRIVATE "." ) set_target_properties( ${TARGET_NAME} PROPERTIES PUBLIC_HEADER "${h_files}" ) - -install( TARGETS ${TARGET_NAME} - PUBLIC_HEADER DESTINATION include/lib${TARGET_NAME} COMPONENT headers - LIBRARY DESTINATION lib COMPONENT binaries +target_include_directories(${TARGET_NAME} PUBLIC Math::Math + $ + $ + PRIVATE "." + ) +target_link_libraries(${TARGET_NAME} Math::Math) + +# pkg-config variables +set(target_name "${TARGET_NAME}") +set(stdclibs "${CMAKE_C_STANDARD_LIBRARIES}" Math:Math) +set(install_prefix "${CMAKE_INSTALL_PREFIX}") +set(install_libdir "${CMAKE_INSTALL_LIBDIR}") +set(install_includedir "${CMAKE_INSTALL_INCLUDEDIR}") +configure_file(lib${TARGET_NAME}.pc.in ${PROJECT_BINARY_DIR}/lib${TARGET_NAME}.pc @ONLY) + +set(ENV{PKG_CONFIG_PATH} "${PROJECT_BINARY_DIR}:$ENV{PKG_CONFIG_PATH}") + +install( TARGETS ${TARGET_NAME} EXPORT lib${TARGET_NAME}Config + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binaries + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lib${TARGET_NAME} COMPONENT headers ) + +install(FILES ${PROJECT_BINARY_DIR}/lib${TARGET_NAME}.pc DESTINATION + ${CMAKE_INSTALL_LIBDIR}/pkgconfig/) + diff --git a/libadikted/Makefile b/libadikted/Makefile.win similarity index 100% rename from libadikted/Makefile rename to libadikted/Makefile.win diff --git a/libadikted/cmake/FindMath.cmake b/libadikted/cmake/FindMath.cmake new file mode 100644 index 0000000..ca854c9 --- /dev/null +++ b/libadikted/cmake/FindMath.cmake @@ -0,0 +1,76 @@ +include (CheckLibraryExists) +set(Math_FOUND FALSE) +set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET}) +set(CMAKE_REQUIRED_QUIET ${Math_FIND_QUIETLY}) + +if(CMAKE_C_COMPILER_LOADED) + include (CheckIncludeFile) + include (CheckCSourceCompiles) +elseif(CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) + include (CheckCXXSourceCompiles) +else() + message(FATAL_ERROR "FindMath only works if either C or CXX language is enabled") +endif() + +set(MATH_C_CXX_TEST_SOURCE [====[ +#include + +int main() +{ + const double x = 7.3; + ceil(x); + acos(x); + sin(x); + sqrt(x); + + return 0; +} +]====]) + + +if(CMAKE_C_COMPILER_LOADED) + CHECK_INCLUDE_FILE("math.h" CMAKE_HAVE_MATH_H) +else() + CHECK_INCLUDE_FILE_CXX("math.h" CMAKE_HAVE_MATH_H) +endif() + +if(CMAKE_HAVE_MATH_H) + set(CMAKE_HAVE_MATH_LIBRARY) + + set(CMAKE_REQUIRED_LIBRARIES -lm) + if(CMAKE_C_COMPILER_LOADED) + CHECK_C_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + elseif(CMAKE_CXX_COMPILER_LOADED) + CHECK_CXX_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + endif() + + if(CMAKE_HAVE_LIBC_LIBM) + set(CMAKE_MATH_LIBS_INIT ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_HAVE_MATH_LIBRARY 1) + set(Math_FOUND TRUE) + else() + set(Math_FOUND FALSE) + endif() + + unset(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE}) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Math DEFAULT_MSG Math_FOUND) + + if(MATH_FOUND AND NOT TARGET Math::Math) + add_library(Math::Math INTERFACE IMPORTED) + + if(CMAKE_MATH_LIBS_INIT) + set_property(TARGET Math::Math PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_MATH_LIBS_INIT}") + endif() + elseif(NOT MATH_FOUND) + file(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler accepts -lm failed with the following output:\n${_cmake_find_math_output}\n\n") + message(SEND_ERROR "Required Math library not found!") + endif() +endif() + +unset(_cmake_find_math_output) diff --git a/libadikted/libadikted.pc.in b/libadikted/libadikted.pc.in new file mode 100644 index 0000000..44b2849 --- /dev/null +++ b/libadikted/libadikted.pc.in @@ -0,0 +1,12 @@ +prefix=@install_prefix@ +exe_prefix=${prefix} +libdir=${prefix}/@install_libdir@ +includedir=${prefix}/@install_includedir@ + +Name: lib@target_name@ +Description: @PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ + +Requires: +Libs: -L${libdir} -l@target_name@ @stdclib@ +Cflags: -I${includedir} -I${includedir}/@target_name@ diff --git a/mapslang/CMakeLists.txt b/mapslang/CMakeLists.txt new file mode 100644 index 0000000..c8ff17d --- /dev/null +++ b/mapslang/CMakeLists.txt @@ -0,0 +1,77 @@ +cmake_minimum_required( VERSION 3.0 ) +project(mapslang LANGUAGES C) +set(TARGET_NAME map) + +include(FindPkgConfig) +include(CMakePackageConfigHelpers) + +set_property( GLOBAL PROPERTY USE_FOLDERS ON ) +set( CMAKE_C_STANDARD 99 ) +set( CMAKE_C_STANDARD_REQUIRED ON ) +set( CMAKE_C_EXTENSIONS ON ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers -Wno-unused-result -Wno-unused-parameter" ) +add_definitions( -DINSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${TARGET_NAME}" ) + +set( MAPSLANG_LIBRARY_TYPE "STATIC" CACHE STRING "Linking type for library" ) + +set_property( CACHE MAPSLANG_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED ) + +if( MAPSLANG_LIBRARY_TYPE MATCHES "SHARED" ) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif() + +if(POLICY CMP0072) + cmake_policy(SET CMP0072 NEW) +endif() + +# Add Math::Math +include(cmake/FindMath.cmake) + +# check for installed slang +pkg_search_module(SLANG REQUIRED slang) +# check for installed libadikted +pkg_search_module(ADIKTED REQUIRED libadikted) + +# Grab the keeperfx source files +file( GLOB MAPSLANG_SOURCES input_kb.c main.c output_scr.c scr_actn.c scr_clm.c scr_cube.c scr_help.c scr_list.c scr_rwrk.c scr_slab.c scr_thing.c scr_tileset.c scr_txted.c scr_txtgen.c textmenu.c var_utils.c ) + +add_executable( ${TARGET_NAME} ${MAPSLANG_SOURCES} ) +target_include_directories( ${TARGET_NAME} + PUBLIC Math::Math + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +target_compile_options( ${TARGET_NAME} PUBLIC ${ADIKTED_CFLAGS} ${SLANG_CFLAGS}) +target_link_libraries( ${TARGET_NAME} PUBLIC ${ADIKTED_LIBRARIES} + ${SLANG_LIBRARIES} Math::Math) + +# Put in a "mapslang" folder in Visual Studio +set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER "mapslang" ) + +# Special Visual Studio Flags +if( MSVC ) + target_compile_definitions( ${TARGET_NAME} PRIVATE "_CRT_SECURE_NO_WARNINGS" ) +endif() + +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE "None") +endif () + +set(uppercase_CMAKE_BUILD_TYPE TOUPPER "${CMAKE_BUILD_TYPE}" "NONE") +# Add debug config required in keeperfx headers since bx is private +if ( uppercase_CMAKE_BUILD_TYPE} STREQUAL "DEBUG" ) + target_compile_definitions( ${TARGET_NAME} PUBLIC "MAP_DEBUG=0" ) +endif() + +install( TARGETS map + EXPORT "${TARGETS_EXPORT_NAME}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + RESOURCE DESTINATION "${CMAKE_INSTALL_DATADIR}/${TARGET_NAME}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + +install(FILES map.hlp map.ini map.ico DESTINATION "${CMAKE_INSTALL_DATADIR}/${TARGET_NAME}" + COMPONENT Resources ) diff --git a/mapslang/Makefile b/mapslang/Makefile.win similarity index 95% rename from mapslang/Makefile rename to mapslang/Makefile.win index 8a1b97f..41dfe09 100644 --- a/mapslang/Makefile +++ b/mapslang/Makefile.win @@ -82,15 +82,15 @@ WARNFLAGS = -Wall -Wextra -Werror-implicit-function-declaration -Wno-co PLATFORM_FLAGS = -march=i486 CSTANDARD = -std=gnu99 CC = $(CROSS_COMPILE)gcc$(CROSS_EXEEXT) $(CSTANDARD) $(WARNFLAGS) -CFLAGS = -c -O -I. -I../lib/$(SLANG_NAME)/src $(DLL_FLAG) $(PLATFORM_FLAGS) -CFLAGS_DEBUG = -c -g -I. -I../lib/$(SLANG_NAME)/src $(DLL_FLAG) $(PLATFORM_FLAGS) -DDEBUG +CFLAGS = -c -O -I.. -I. -I../lib/$(SLANG_NAME)/src $(DLL_FLAG) $(PLATFORM_FLAGS) +CFLAGS_DEBUG = -c -g -I.. -I. -I../lib/$(SLANG_NAME)/src $(DLL_FLAG) $(PLATFORM_FLAGS) -DDEBUG LINK = $(CROSS_COMPILE)gcc$(CROSS_EXEEXT) WINDRES = $(CROSS_COMPILE)windres$(CROSS_EXEEXT) RES = obj/map_private.res RC = map_private.rc LFLAGS = -static-libgcc $(PLATFORM_FLAGS) LFLAGS_DEBUG = -static-libgcc $(PLATFORM_FLAGS) -DDEBUG -LIBS = -L. -L../libadikted/bin -L..$(SLANG_BIN_FOLDER) -lslang -ladikted +LIBS = -L.. -L. -Llibadikted/bin -L..$(SLANG_BIN_FOLDER) -lslang -ladikted SRC = \ input_kb.c \ main.c \ diff --git a/mapslang/cmake/FindMath.cmake b/mapslang/cmake/FindMath.cmake new file mode 100644 index 0000000..ca854c9 --- /dev/null +++ b/mapslang/cmake/FindMath.cmake @@ -0,0 +1,76 @@ +include (CheckLibraryExists) +set(Math_FOUND FALSE) +set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET}) +set(CMAKE_REQUIRED_QUIET ${Math_FIND_QUIETLY}) + +if(CMAKE_C_COMPILER_LOADED) + include (CheckIncludeFile) + include (CheckCSourceCompiles) +elseif(CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) + include (CheckCXXSourceCompiles) +else() + message(FATAL_ERROR "FindMath only works if either C or CXX language is enabled") +endif() + +set(MATH_C_CXX_TEST_SOURCE [====[ +#include + +int main() +{ + const double x = 7.3; + ceil(x); + acos(x); + sin(x); + sqrt(x); + + return 0; +} +]====]) + + +if(CMAKE_C_COMPILER_LOADED) + CHECK_INCLUDE_FILE("math.h" CMAKE_HAVE_MATH_H) +else() + CHECK_INCLUDE_FILE_CXX("math.h" CMAKE_HAVE_MATH_H) +endif() + +if(CMAKE_HAVE_MATH_H) + set(CMAKE_HAVE_MATH_LIBRARY) + + set(CMAKE_REQUIRED_LIBRARIES -lm) + if(CMAKE_C_COMPILER_LOADED) + CHECK_C_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + elseif(CMAKE_CXX_COMPILER_LOADED) + CHECK_CXX_SOURCE_COMPILES("${MATH_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_LIBM) + endif() + + if(CMAKE_HAVE_LIBC_LIBM) + set(CMAKE_MATH_LIBS_INIT ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_HAVE_MATH_LIBRARY 1) + set(Math_FOUND TRUE) + else() + set(Math_FOUND FALSE) + endif() + + unset(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE}) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Math DEFAULT_MSG Math_FOUND) + + if(MATH_FOUND AND NOT TARGET Math::Math) + add_library(Math::Math INTERFACE IMPORTED) + + if(CMAKE_MATH_LIBS_INIT) + set_property(TARGET Math::Math PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_MATH_LIBS_INIT}") + endif() + elseif(NOT MATH_FOUND) + file(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler accepts -lm failed with the following output:\n${_cmake_find_math_output}\n\n") + message(SEND_ERROR "Required Math library not found!") + endif() +endif() + +unset(_cmake_find_math_output) diff --git a/mapslang/input_kb.c b/mapslang/input_kb.c index db2cd6b..5fa6ce1 100644 --- a/mapslang/input_kb.c +++ b/mapslang/input_kb.c @@ -23,7 +23,7 @@ #include #include "output_scr.h" #include "var_utils.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" short input_initied=false; short disable_sounds=false; diff --git a/mapslang/main.c b/mapslang/main.c index 683cea1..882ffe6 100644 --- a/mapslang/main.c +++ b/mapslang/main.c @@ -4,14 +4,14 @@ #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "scr_actn.h" #include "scr_help.h" #include "scr_txted.h" #include "input_kb.h" #include "var_utils.h" -const char config_filename[]="map.ini"; +char *config_filename = NULL; void read_init(struct SCRMODE_DATA *scrmode,struct WORKMODE_DATA *workdata) { @@ -21,7 +21,13 @@ void read_init(struct SCRMODE_DATA *scrmode,struct WORKMODE_DATA *workdata) char buffer[READ_BUFSIZE]; char *p; int l; - + + if(format_data_fname(&config_filename, INSTALL_DATADIR, "%s", "map.ini") == false) + { + message_info_force("Couldn't concatenate data_dir and config_filename string, defaults loaded."); + return; + } + FILE *fp; fp = fopen (config_filename, "rb"); // If we can't get anything, warn but don't die diff --git a/mapslang/output_scr.c b/mapslang/output_scr.c index 86bdd60..41b1451 100644 --- a/mapslang/output_scr.c +++ b/mapslang/output_scr.c @@ -20,7 +20,7 @@ #include "output_scr.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include #include "scr_actn.h" diff --git a/mapslang/scr_actn.c b/mapslang/scr_actn.c index 0086296..224ec0d 100644 --- a/mapslang/scr_actn.c +++ b/mapslang/scr_actn.c @@ -23,7 +23,7 @@ #include #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "var_utils.h" #include "output_scr.h" #include "input_kb.h" diff --git a/mapslang/scr_actn.h b/mapslang/scr_actn.h index 61d9417..cca0eef 100644 --- a/mapslang/scr_actn.h +++ b/mapslang/scr_actn.h @@ -21,7 +21,7 @@ #ifndef ADIKT_SCRACTN_H #define ADIKT_SCRACTN_H -#include "../libadikted/globals.h" +#include "libadikted/globals.h" struct LEVEL; diff --git a/mapslang/scr_clm.c b/mapslang/scr_clm.c index 64baebd..d0498b7 100644 --- a/mapslang/scr_clm.c +++ b/mapslang/scr_clm.c @@ -21,7 +21,7 @@ #include "scr_clm.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_cube.c b/mapslang/scr_cube.c index 90c023f..19a9db1 100644 --- a/mapslang/scr_cube.c +++ b/mapslang/scr_cube.c @@ -20,7 +20,7 @@ #include "scr_cube.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_help.c b/mapslang/scr_help.c index e6b5741..c915f68 100644 --- a/mapslang/scr_help.c +++ b/mapslang/scr_help.c @@ -21,7 +21,7 @@ #include "scr_help.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "scr_actn.h" #include "output_scr.h" #include "input_kb.h" @@ -29,7 +29,7 @@ // Help variables -const char *help_filename="map.hlp"; +char *help_filename = NULL; const int itm_desc_rows=8; short init_help(struct SCRMODE_DATA *scrmode,struct WORKMODE_DATA *workdata) @@ -47,6 +47,13 @@ short init_help(struct SCRMODE_DATA *scrmode,struct WORKMODE_DATA *workdata) char ***what; FILE *fp; strcpy (title, ""); + + if(format_data_fname(&help_filename, INSTALL_DATADIR, "%s", "map.hlp") == false) + { + message_info("Error concatenating data_dir and help_filename."); + return false; + } + fp = fopen (help_filename, "rb"); // Non-fatal error if (!fp) diff --git a/mapslang/scr_help.h b/mapslang/scr_help.h index aff5dc4..38d5e1b 100644 --- a/mapslang/scr_help.h +++ b/mapslang/scr_help.h @@ -28,6 +28,11 @@ struct WORKMODE_DATA; #define DHFLAG_USE_COLORS 1 +#ifndef INSTALL_DATADIR +#define INSTALL_DATADIR "." +#endif + + struct HelpInfo { int numrows; diff --git a/mapslang/scr_list.c b/mapslang/scr_list.c index 4895c85..82475a5 100644 --- a/mapslang/scr_list.c +++ b/mapslang/scr_list.c @@ -21,7 +21,7 @@ #include "scr_list.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_rwrk.c b/mapslang/scr_rwrk.c index 567b568..b9b71fe 100644 --- a/mapslang/scr_rwrk.c +++ b/mapslang/scr_rwrk.c @@ -20,7 +20,7 @@ #include "scr_rwrk.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_slab.c b/mapslang/scr_slab.c index 515b056..7e437f7 100644 --- a/mapslang/scr_slab.c +++ b/mapslang/scr_slab.c @@ -22,7 +22,7 @@ #include "scr_slab.h" #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_thing.c b/mapslang/scr_thing.c index 232c7f5..b838ef3 100644 --- a/mapslang/scr_thing.c +++ b/mapslang/scr_thing.c @@ -22,7 +22,7 @@ #include "scr_thing.h" #include -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "scr_help.h" #include "output_scr.h" #include "input_kb.h" diff --git a/mapslang/scr_tileset.c b/mapslang/scr_tileset.c index e81f61a..7fe633b 100644 --- a/mapslang/scr_tileset.c +++ b/mapslang/scr_tileset.c @@ -19,9 +19,9 @@ /******************************************************************************/ -#include "../libadikted/globals.h" -#include "../libadikted/lev_data.h" -#include "../libadikted/msg_log.h" +#include "libadikted/globals.h" +#include "libadikted/lev_data.h" +#include "libadikted/msg_log.h" #include "input_kb.h" #include "output_scr.h" #include "scr_actn.h" diff --git a/mapslang/scr_txted.c b/mapslang/scr_txted.c index bc9f902..205bc31 100644 --- a/mapslang/scr_txted.c +++ b/mapslang/scr_txted.c @@ -20,7 +20,7 @@ #include "scr_txted.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "output_scr.h" #include "input_kb.h" #include "scr_actn.h" diff --git a/mapslang/scr_txtgen.c b/mapslang/scr_txtgen.c index 1d349d8..2b26576 100644 --- a/mapslang/scr_txtgen.c +++ b/mapslang/scr_txtgen.c @@ -24,7 +24,7 @@ #include "scr_txtgen.h" -#include "../libadikted/adikted.h" +#include "libadikted/adikted.h" #include "var_utils.h" #include "input_kb.h" #include "output_scr.h" diff --git a/mapslang/textmenu.c b/mapslang/textmenu.c index c38485c..5dbc485 100644 --- a/mapslang/textmenu.c +++ b/mapslang/textmenu.c @@ -25,11 +25,12 @@ #include "textmenu.h" -#include "../libadikted/globals.h" +#include "libadikted/globals.h" #include "input_kb.h" #include "output_scr.h" #include "var_utils.h" + inline union _value menu_value_num(long num) { union _value ret; ret.num=num; return ret; } diff --git a/mapslang/textmenu.h b/mapslang/textmenu.h index a71ec51..7b5e2eb 100644 --- a/mapslang/textmenu.h +++ b/mapslang/textmenu.h @@ -20,7 +20,7 @@ #ifndef BULL_TEXTMENU_H #define BULL_TEXTMENU_H -#include "../libadikted/globals.h" +#include "libadikted/globals.h" #define MIT_NUMERIC 0 #define MIT_BOOLEAN 1 diff --git a/mapslang/var_utils.c b/mapslang/var_utils.c index 0b99b05..f0f630c 100644 --- a/mapslang/var_utils.c +++ b/mapslang/var_utils.c @@ -19,11 +19,11 @@ #include "var_utils.h" -#include "../libadikted/globals.h" +#include "libadikted/globals.h" #include #include "input_kb.h" -#include "../libadikted/msg_log.h" -#include "../libadikted/lev_data.h" +#include "libadikted/msg_log.h" +#include "libadikted/lev_data.h" #include "output_scr.h" #include "scr_actn.h"