diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c3056180..d5f05dc1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,5 +41,4 @@ add_subdirectory (storage) add_subdirectory (iniparser) add_subdirectory (quicklist) add_subdirectory (critbit) -add_subdirectory (core/src eressea) -add_subdirectory (src server) +add_subdirectory (src eressea) diff --git a/Makefile b/Makefile index 573ba6503..566f74ffd 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,2 @@ -all: bin/eressea - -bin: - mkdir bin - -bin/eressea: bin/Makefile - cd bin ; make - -bin/Makefile: bin - cd bin ; cmake .. - -clean: - rm -rf bin +all: + @echo "Please use the cmake build system by running configure" diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt deleted file mode 100755 index 9f9fc2152..000000000 --- a/core/src/CMakeLists.txt +++ /dev/null @@ -1,209 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project (eressea C) - -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -set (ERESSEA_LIBRARY eressea CACHE INTERNAL "eressea library") -set (ERESSEA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "eressea includes") - -include_directories (${ERESSEA_INCLUDE_DIR}) -include_directories (${CRITBIT_INCLUDE_DIR}) -include_directories (${CRYPTO_INCLUDE_DIR}) -include_directories (${QUICKLIST_INCLUDE_DIR}) -include_directories (${STORAGE_INCLUDE_DIR}) -include_directories (${CUTEST_INCLUDE_DIR}) -include_directories (${LUA_INCLUDE_DIR}) -include_directories (${LIBXML2_INCLUDE_DIR}) -include_directories (${INIPARSER_INCLUDE_DIR}) - -FILE (GLOB_RECURSE LIB_HDR *.h) - -set (TEST_SRC - tests.c - tests_test.c - gamecode/economy_test.c - gamecode/laws_test.c - gamecode/market_test.c - kernel/ally_test.c - kernel/battle_test.c - kernel/building_test.c - kernel/curse_test.c - kernel/equipment_test.c - kernel/item_test.c - kernel/magic_test.c - kernel/move_test.c - kernel/pool_test.c - kernel/reports_test.c - kernel/ship_test.c - kernel/spellbook_test.c - kernel/spell_test.c - util/base36_test.c - util/bsdstring_test.c - util/functions_test.c - util/umlaut_test.c -) - -set (LIB_SRC - attributes/alliance.c - attributes/attributes.c - attributes/fleechance.c - attributes/follow.c - attributes/giveitem.c - attributes/gm.c - attributes/hate.c - attributes/iceberg.c - attributes/key.c - attributes/matmod.c - attributes/moved.c - attributes/movement.c - attributes/object.c - attributes/orcification.c - attributes/otherfaction.c - attributes/overrideroads.c - attributes/racename.c - attributes/raceprefix.c - attributes/reduceproduction.c - attributes/targetregion.c - eressea.c - gamecode/archetype.c - gamecode/creation.c - gamecode/creport.c - gamecode/economy.c - gamecode/give.c - gamecode/items.c - gamecode/laws.c - gamecode/market.c - gamecode/monster.c - gamecode/randenc.c - gamecode/report.c - gamecode/spy.c - gamecode/study.c - gamecode/summary.c - gamecode/xmlreport.c - gmtool.c - items/artrewards.c - items/demonseye.c - items/itemtypes.c - items/phoenixcompass.c - items/seed.c - items/speedsail.c - items/weapons.c - items/xerewards.c - kernel/alchemy.c - kernel/alliance.c - kernel/ally.c - kernel/battle.c - kernel/build.c - kernel/building.c - kernel/calendar.c - kernel/command.c - kernel/config.c - kernel/connection.c - kernel/curse.c - kernel/equipment.c - kernel/faction.c - kernel/group.c - kernel/item.c - kernel/magic.c - kernel/message.c - kernel/move.c - kernel/names.c - kernel/order.c - kernel/pathfinder.c - kernel/plane.c - kernel/player.c - kernel/pool.c - kernel/race.c - kernel/region.c - kernel/reports.c - kernel/resources.c - kernel/save.c - kernel/ship.c - kernel/skill.c - kernel/spellbook.c - kernel/spell.c - kernel/sqlite.c - kernel/teleport.c - kernel/terrain.c - kernel/unit.c - kernel/xmlreader.c - modules/arena.c - modules/autoseed.c - modules/dungeon.c - modules/gmcmd.c - modules/museum.c - modules/score.c - modules/weather.c - modules/wormhole.c - modules/xmas.c - triggers/changefaction.c - triggers/changerace.c - triggers/clonedied.c - triggers/createcurse.c - triggers/createunit.c - triggers/gate.c - triggers/giveitem.c - triggers/killunit.c - triggers/removecurse.c - triggers/shock.c - triggers/timeout.c - triggers/triggers.c - triggers/unguard.c - triggers/unitmessage.c - util/attrib.c - util/base36.c - util/bsdstring.c - util/console.c - util/crmessage.c - util/dice.c - util/event.c - util/filereader.c - util/functions.c - util/goodies.c - util/language.c - util/listbox.c - util/lists.c - util/log.c - util/message.c - util/nrmessage.c - util/parser.c - util/rand.c - util/resolve.c - util/sql.c - util/strings.c - util/translation.c - util/umlaut.c - util/unicode.c - util/xml.c -) - -add_library(${ERESSEA_LIBRARY} ${LIB_SRC} ${BIND_SRC} ${LIB_HDR}) -target_link_libraries(${ERESSEA_LIBRARY} - ${STORAGE_LIBRARIES} - ${CRITBIT_LIBRARIES} - ${QUICKLIST_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${INIPARSER_LIBRARIES} - ${LIBXML2_LIBRARIES} - ${SQLITE3_LIBRARIES} - ${CURSES_LIBRARIES} - ${LUA_LIBRARIES} -) - -add_executable(test_eressea ${TEST_SRC}) -target_link_libraries(test_eressea - ${ERESSEA_LIBRARY} - ${CUTEST_LIBRARIES} -) - -add_test(eressea test_eressea) - -IF (MSVC) - find_package (MSVC MODULE) - MSVC_CRT_SECURE_NO_WARNINGS (${ERESSEA_LIBRARY}) -ENDIF (MSVC) - -add_subdirectory(bindings) diff --git a/core/src/bindings/CMakeLists.txt b/core/src/bindings/CMakeLists.txt deleted file mode 100755 index 88df05cfb..000000000 --- a/core/src/bindings/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project (bindings C) - -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long") -ELSEIF(MSVC) -ELSE(CMAKE_COMPILER_IS_GNUCC) - MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -set (BINDINGS_LIBRARY ${PROJECT_NAME} CACHE INTERNAL "Eressea Lua Bindings") - -find_package (Lua 5 REQUIRED) -find_package (ToLua REQUIRED) - -include_directories (${STORAGE_INCLUDE_DIR}) -include_directories (${TOLUA_INCLUDE_DIR}) - -FILE (GLOB_RECURSE BINDINGS_HDR *.h) - -MACRO(ADD_LUA_MODULE MODULE_NAME FILES) - ADD_LIBRARY (${MODULE_NAME} SHARED ${FILES}) - SET_TARGET_PROPERTIES(${MODULE_NAME} - PROPERTIES - PREFIX "" - ) -ENDMACRO(ADD_LUA_MODULE) - -MACRO(TOLUA_BINDING PKGFILE FILES) - ADD_CUSTOM_COMMAND( - OUTPUT ${PKGFILE}.c - DEPENDS ${FILES} ${PKGFILE} - COMMAND ${TOLUA_EXECUTABLE} - ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/${PKGFILE}.c ${PKGFILE} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) -ENDMACRO(TOLUA_BINDING) - -TOLUA_BINDING(process.pkg bind_process.h) -TOLUA_BINDING(eressea.pkg bind_eressea.h) -TOLUA_BINDING(settings.pkg bind_settings.h) - -set (BINDINGS_SRC - process.pkg.c - eressea.pkg.c - settings.pkg.c - bind_process.c - bind_eressea.c - bind_settings.c - bind_building.c - bind_faction.c - bind_gmtool.c - bind_hashtable.c - bindings.c - bind_message.c - bind_region.c - bind_ship.c - bind_sqlite.c - bind_storage.c - bind_unit.c - helpers.c -) - -add_library(${BINDINGS_LIBRARY} ${BINDINGS_SRC} ${BINDINGS_HDR}) -target_link_libraries(${BINDINGS_LIBRARY} ${TOLUA_LIBRARIES}) -target_link_libraries(${BINDINGS_LIBRARY} ${ERESSEA_LIBRARY}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2488de482..1b947955b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,7 +9,11 @@ ELSE(CMAKE_COMPILER_IS_GNUCC) MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}") ENDIF(CMAKE_COMPILER_IS_GNUCC) -include_directories (${ERESSEA_INCLUDE_DIR}) +find_package (Lua 5 REQUIRED) +find_package (ToLua REQUIRED) +find_package (SQLite3 REQUIRED) + +include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories (${CRITBIT_INCLUDE_DIR}) include_directories (${STORAGE_INCLUDE_DIR}) include_directories (${CRYPTO_INCLUDE_DIR}) @@ -21,23 +25,90 @@ include_directories (${BSON_INCLUDE_DIR}) include_directories (${INIPARSER_INCLUDE_DIR}) include_directories (${CURSES_INCLUDE_DIR}) -set (SERVER_SRC - races/races.c - races/dragons.c - races/zombies.c - races/illusion.c - main.c - bindings.c - monsters.c - spells/combatspells.c - spells/shipcurse.c - spells/regioncurse.c - spells/buildingcurse.c - spells/alp.c - spells/unitcurse.c - spells/spells.c - curses.c +add_subdirectory(util) +add_subdirectory(kernel) +add_subdirectory(items) +add_subdirectory(attributes) +add_subdirectory(bindings) +add_subdirectory(spells) +add_subdirectory(triggers) +add_subdirectory(modules) +add_subdirectory(races) + +set(TESTS + laws_test.c + economy_test.c + market_test.c ) -add_executable(server ${SERVER_SRC}) -target_link_libraries(server ${BINDINGS_LIBRARY}) +set (SERVER_SRC + eressea.c + archetype.c + creation.c + creport.c + economy.c + give.c + items.c + laws.c + market.c + monster.c + randenc.c + report.c + spy.c + study.c + summary.c + xmlreport.c + gmtool.c + monsters.c + ${BINDINGS_SRC} + ${SPELLS_SRC} + ${RACES_SRC} + ${ITEMS_SRC} + ${MODULES_SRC} + ${TRIGGERS_SRC} + ${ATTRIBUTES_SRC} + ${KERNEL_SRC} + ${UTIL_SRC} +) + +add_executable(eressea ${SERVER_SRC} main.c) +target_link_libraries(eressea + ${LUA_LIBRARIES} + ${TOLUA_LIBRARIES} + ${QUICKLIST_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${STORAGE_LIBRARIES} + ${SQLITE3_LIBRARIES} + ${CRITBIT_LIBRARIES} + ${CRYPTO_LIBRARIES} + ${CURSES_LIBRARIES} + ${INIPARSER_LIBRARIES} + ) + +set(SERVER_TEST_SRC + test_eressea.c + tests.c + tests_test.c + economy_test.c + market_test.c + laws_test.c + ${UTIL_TESTS} + ${KERNEL_TESTS} +) + +add_executable(test_eressea ${SERVER_SRC} ${SERVER_TEST_SRC}) +target_link_libraries(test_eressea ${CUTEST_LIBRARIES}) +target_link_libraries(test_eressea + ${LUA_LIBRARIES} + ${TOLUA_LIBRARIES} + ${QUICKLIST_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${STORAGE_LIBRARIES} + ${SQLITE3_LIBRARIES} + ${CRITBIT_LIBRARIES} + ${CRYPTO_LIBRARIES} + ${CURSES_LIBRARIES} + ${INIPARSER_LIBRARIES} + ) + +add_test(server test_eressea) diff --git a/core/src/gamecode/archetype.c b/src/archetype.c similarity index 100% rename from core/src/gamecode/archetype.c rename to src/archetype.c diff --git a/core/src/gamecode/archetype.h b/src/archetype.h similarity index 100% rename from core/src/gamecode/archetype.h rename to src/archetype.h diff --git a/src/attributes/CMakeLists.txt b/src/attributes/CMakeLists.txt new file mode 100644 index 000000000..7268b6436 --- /dev/null +++ b/src/attributes/CMakeLists.txt @@ -0,0 +1,28 @@ +PROJECT(attributes C) +SET(_FILES +alliance.c +attributes.c +fleechance.c +follow.c +giveitem.c +gm.c +hate.c +iceberg.c +key.c +matmod.c +moved.c +movement.c +object.c +orcification.c +otherfaction.c +overrideroads.c +racename.c +raceprefix.c +reduceproduction.c +targetregion.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(ATTRIBUTES_SRC ${_SOURCES} PARENT_SCOPE) + \ No newline at end of file diff --git a/core/src/attributes/aggressive.h b/src/attributes/aggressive.h similarity index 100% rename from core/src/attributes/aggressive.h rename to src/attributes/aggressive.h diff --git a/core/src/attributes/alliance.c b/src/attributes/alliance.c similarity index 100% rename from core/src/attributes/alliance.c rename to src/attributes/alliance.c diff --git a/core/src/attributes/alliance.h b/src/attributes/alliance.h similarity index 100% rename from core/src/attributes/alliance.h rename to src/attributes/alliance.h diff --git a/core/src/attributes/attributes.c b/src/attributes/attributes.c similarity index 100% rename from core/src/attributes/attributes.c rename to src/attributes/attributes.c diff --git a/core/src/attributes/attributes.h b/src/attributes/attributes.h similarity index 100% rename from core/src/attributes/attributes.h rename to src/attributes/attributes.h diff --git a/core/src/attributes/fleechance.c b/src/attributes/fleechance.c similarity index 100% rename from core/src/attributes/fleechance.c rename to src/attributes/fleechance.c diff --git a/core/src/attributes/fleechance.h b/src/attributes/fleechance.h similarity index 100% rename from core/src/attributes/fleechance.h rename to src/attributes/fleechance.h diff --git a/core/src/attributes/follow.c b/src/attributes/follow.c similarity index 100% rename from core/src/attributes/follow.c rename to src/attributes/follow.c diff --git a/core/src/attributes/follow.h b/src/attributes/follow.h similarity index 100% rename from core/src/attributes/follow.h rename to src/attributes/follow.h diff --git a/core/src/attributes/giveitem.c b/src/attributes/giveitem.c similarity index 100% rename from core/src/attributes/giveitem.c rename to src/attributes/giveitem.c diff --git a/core/src/attributes/giveitem.h b/src/attributes/giveitem.h similarity index 100% rename from core/src/attributes/giveitem.h rename to src/attributes/giveitem.h diff --git a/core/src/attributes/gm.c b/src/attributes/gm.c similarity index 100% rename from core/src/attributes/gm.c rename to src/attributes/gm.c diff --git a/core/src/attributes/gm.h b/src/attributes/gm.h similarity index 100% rename from core/src/attributes/gm.h rename to src/attributes/gm.h diff --git a/core/src/attributes/hate.c b/src/attributes/hate.c similarity index 100% rename from core/src/attributes/hate.c rename to src/attributes/hate.c diff --git a/core/src/attributes/hate.h b/src/attributes/hate.h similarity index 100% rename from core/src/attributes/hate.h rename to src/attributes/hate.h diff --git a/core/src/attributes/iceberg.c b/src/attributes/iceberg.c similarity index 100% rename from core/src/attributes/iceberg.c rename to src/attributes/iceberg.c diff --git a/core/src/attributes/iceberg.h b/src/attributes/iceberg.h similarity index 100% rename from core/src/attributes/iceberg.h rename to src/attributes/iceberg.h diff --git a/core/src/attributes/key.c b/src/attributes/key.c similarity index 100% rename from core/src/attributes/key.c rename to src/attributes/key.c diff --git a/core/src/attributes/key.h b/src/attributes/key.h similarity index 100% rename from core/src/attributes/key.h rename to src/attributes/key.h diff --git a/core/src/attributes/matmod.c b/src/attributes/matmod.c similarity index 100% rename from core/src/attributes/matmod.c rename to src/attributes/matmod.c diff --git a/core/src/attributes/matmod.h b/src/attributes/matmod.h similarity index 100% rename from core/src/attributes/matmod.h rename to src/attributes/matmod.h diff --git a/core/src/attributes/moved.c b/src/attributes/moved.c similarity index 100% rename from core/src/attributes/moved.c rename to src/attributes/moved.c diff --git a/core/src/attributes/moved.h b/src/attributes/moved.h similarity index 100% rename from core/src/attributes/moved.h rename to src/attributes/moved.h diff --git a/core/src/attributes/movement.c b/src/attributes/movement.c similarity index 100% rename from core/src/attributes/movement.c rename to src/attributes/movement.c diff --git a/core/src/attributes/movement.h b/src/attributes/movement.h similarity index 100% rename from core/src/attributes/movement.h rename to src/attributes/movement.h diff --git a/core/src/attributes/object.c b/src/attributes/object.c similarity index 100% rename from core/src/attributes/object.c rename to src/attributes/object.c diff --git a/core/src/attributes/object.h b/src/attributes/object.h similarity index 100% rename from core/src/attributes/object.h rename to src/attributes/object.h diff --git a/core/src/attributes/orcification.c b/src/attributes/orcification.c similarity index 100% rename from core/src/attributes/orcification.c rename to src/attributes/orcification.c diff --git a/core/src/attributes/orcification.h b/src/attributes/orcification.h similarity index 100% rename from core/src/attributes/orcification.h rename to src/attributes/orcification.h diff --git a/core/src/attributes/otherfaction.c b/src/attributes/otherfaction.c similarity index 100% rename from core/src/attributes/otherfaction.c rename to src/attributes/otherfaction.c diff --git a/core/src/attributes/otherfaction.h b/src/attributes/otherfaction.h similarity index 100% rename from core/src/attributes/otherfaction.h rename to src/attributes/otherfaction.h diff --git a/core/src/attributes/overrideroads.c b/src/attributes/overrideroads.c similarity index 100% rename from core/src/attributes/overrideroads.c rename to src/attributes/overrideroads.c diff --git a/core/src/attributes/overrideroads.h b/src/attributes/overrideroads.h similarity index 100% rename from core/src/attributes/overrideroads.h rename to src/attributes/overrideroads.h diff --git a/core/src/attributes/racename.c b/src/attributes/racename.c similarity index 100% rename from core/src/attributes/racename.c rename to src/attributes/racename.c diff --git a/core/src/attributes/racename.h b/src/attributes/racename.h similarity index 100% rename from core/src/attributes/racename.h rename to src/attributes/racename.h diff --git a/core/src/attributes/raceprefix.c b/src/attributes/raceprefix.c similarity index 100% rename from core/src/attributes/raceprefix.c rename to src/attributes/raceprefix.c diff --git a/core/src/attributes/raceprefix.h b/src/attributes/raceprefix.h similarity index 100% rename from core/src/attributes/raceprefix.h rename to src/attributes/raceprefix.h diff --git a/core/src/attributes/reduceproduction.c b/src/attributes/reduceproduction.c similarity index 100% rename from core/src/attributes/reduceproduction.c rename to src/attributes/reduceproduction.c diff --git a/core/src/attributes/reduceproduction.h b/src/attributes/reduceproduction.h similarity index 100% rename from core/src/attributes/reduceproduction.h rename to src/attributes/reduceproduction.h diff --git a/core/src/attributes/targetregion.c b/src/attributes/targetregion.c similarity index 100% rename from core/src/attributes/targetregion.c rename to src/attributes/targetregion.c diff --git a/core/src/attributes/targetregion.h b/src/attributes/targetregion.h similarity index 100% rename from core/src/attributes/targetregion.h rename to src/attributes/targetregion.h diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt new file mode 100755 index 000000000..02df502c1 --- /dev/null +++ b/src/bindings/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 2.6) +project (bindings C) + +MACRO(ADD_LUA_MODULE MODULE_NAME FILES) + ADD_LIBRARY (${MODULE_NAME} SHARED ${FILES}) + SET_TARGET_PROPERTIES(${MODULE_NAME} + PROPERTIES + PREFIX "" + ) +ENDMACRO(ADD_LUA_MODULE) + +MACRO(TOLUA_BINDING PKGFILE FILES) + ADD_CUSTOM_COMMAND( + OUTPUT ${PKGFILE}.c + DEPENDS ${FILES} ${PKGFILE} + COMMAND ${TOLUA_EXECUTABLE} + ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/${PKGFILE}.c ${PKGFILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +ENDMACRO(TOLUA_BINDING) + +TOLUA_BINDING(process.pkg bind_process.h) +TOLUA_BINDING(eressea.pkg bind_eressea.h) +TOLUA_BINDING(settings.pkg bind_settings.h) + +set (_FILES +process.pkg.c +eressea.pkg.c +settings.pkg.c +bind_process.c +bind_eressea.c +bind_settings.c +bind_building.c +bind_faction.c +bind_gmtool.c +bind_hashtable.c +bindings.c +bind_message.c +bind_monsters.c +bind_region.c +bind_ship.c +bind_sqlite.c +bind_storage.c +bind_unit.c +helpers.c +) + +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(BINDINGS_SRC ${_SOURCES} PARENT_SCOPE) diff --git a/core/src/bindings/bind_attrib.c b/src/bindings/bind_attrib.c similarity index 100% rename from core/src/bindings/bind_attrib.c rename to src/bindings/bind_attrib.c diff --git a/core/src/bindings/bind_attrib.h b/src/bindings/bind_attrib.h similarity index 100% rename from core/src/bindings/bind_attrib.h rename to src/bindings/bind_attrib.h diff --git a/core/src/bindings/bind_building.c b/src/bindings/bind_building.c similarity index 100% rename from core/src/bindings/bind_building.c rename to src/bindings/bind_building.c diff --git a/core/src/bindings/bind_building.h b/src/bindings/bind_building.h similarity index 100% rename from core/src/bindings/bind_building.h rename to src/bindings/bind_building.h diff --git a/core/src/bindings/bind_eressea.c b/src/bindings/bind_eressea.c similarity index 100% rename from core/src/bindings/bind_eressea.c rename to src/bindings/bind_eressea.c diff --git a/core/src/bindings/bind_eressea.h b/src/bindings/bind_eressea.h similarity index 100% rename from core/src/bindings/bind_eressea.h rename to src/bindings/bind_eressea.h diff --git a/core/src/bindings/bind_faction.c b/src/bindings/bind_faction.c similarity index 100% rename from core/src/bindings/bind_faction.c rename to src/bindings/bind_faction.c diff --git a/core/src/bindings/bind_faction.h b/src/bindings/bind_faction.h similarity index 100% rename from core/src/bindings/bind_faction.h rename to src/bindings/bind_faction.h diff --git a/core/src/bindings/bind_gmtool.c b/src/bindings/bind_gmtool.c similarity index 99% rename from core/src/bindings/bind_gmtool.c rename to src/bindings/bind_gmtool.c index 9a1483b76..b3e027a58 100644 --- a/core/src/bindings/bind_gmtool.c +++ b/src/bindings/bind_gmtool.c @@ -3,8 +3,8 @@ #include #include "bind_gmtool.h" -#include "../gmtool.h" -#include "../gmtool_structs.h" +#include "gmtool.h" +#include "gmtool_structs.h" #include #include diff --git a/core/src/bindings/bind_gmtool.h b/src/bindings/bind_gmtool.h similarity index 100% rename from core/src/bindings/bind_gmtool.h rename to src/bindings/bind_gmtool.h diff --git a/core/src/bindings/bind_hashtable.c b/src/bindings/bind_hashtable.c similarity index 100% rename from core/src/bindings/bind_hashtable.c rename to src/bindings/bind_hashtable.c diff --git a/core/src/bindings/bind_hashtable.h b/src/bindings/bind_hashtable.h similarity index 100% rename from core/src/bindings/bind_hashtable.h rename to src/bindings/bind_hashtable.h diff --git a/core/src/bindings/bind_message.c b/src/bindings/bind_message.c similarity index 100% rename from core/src/bindings/bind_message.c rename to src/bindings/bind_message.c diff --git a/core/src/bindings/bind_message.h b/src/bindings/bind_message.h similarity index 100% rename from core/src/bindings/bind_message.h rename to src/bindings/bind_message.h diff --git a/src/bindings.c b/src/bindings/bind_monsters.c similarity index 98% rename from src/bindings.c rename to src/bindings/bind_monsters.c index eb325b501..640e667fa 100644 --- a/src/bindings.c +++ b/src/bindings/bind_monsters.c @@ -79,7 +79,7 @@ static int fix_familiars(struct lua_State *L) return 0; } -void bind_eressea(struct lua_State *L) +void bind_monsters(struct lua_State *L) { tolua_module(L, NULL, 0); tolua_beginmodule(L, NULL); diff --git a/core/src/bindings/bind_process.c b/src/bindings/bind_process.c similarity index 97% rename from core/src/bindings/bind_process.c rename to src/bindings/bind_process.c index 83420578b..00a501a6b 100755 --- a/core/src/bindings/bind_process.c +++ b/src/bindings/bind_process.c @@ -11,10 +11,10 @@ #include #include #include -#include -#include -#include -#include +#include "economy.h" +#include "laws.h" +#include "market.h" +#include "study.h" #define PROC_LAND_REGION 0x0001 #define PROC_LONG_ORDER 0x0002 diff --git a/core/src/bindings/bind_process.h b/src/bindings/bind_process.h similarity index 100% rename from core/src/bindings/bind_process.h rename to src/bindings/bind_process.h diff --git a/core/src/bindings/bind_region.c b/src/bindings/bind_region.c similarity index 100% rename from core/src/bindings/bind_region.c rename to src/bindings/bind_region.c diff --git a/core/src/bindings/bind_region.h b/src/bindings/bind_region.h similarity index 100% rename from core/src/bindings/bind_region.h rename to src/bindings/bind_region.h diff --git a/core/src/bindings/bind_settings.c b/src/bindings/bind_settings.c similarity index 100% rename from core/src/bindings/bind_settings.c rename to src/bindings/bind_settings.c diff --git a/core/src/bindings/bind_settings.h b/src/bindings/bind_settings.h similarity index 100% rename from core/src/bindings/bind_settings.h rename to src/bindings/bind_settings.h diff --git a/core/src/bindings/bind_ship.c b/src/bindings/bind_ship.c similarity index 100% rename from core/src/bindings/bind_ship.c rename to src/bindings/bind_ship.c diff --git a/core/src/bindings/bind_ship.h b/src/bindings/bind_ship.h similarity index 100% rename from core/src/bindings/bind_ship.h rename to src/bindings/bind_ship.h diff --git a/core/src/bindings/bind_sqlite.c b/src/bindings/bind_sqlite.c similarity index 100% rename from core/src/bindings/bind_sqlite.c rename to src/bindings/bind_sqlite.c diff --git a/core/src/bindings/bind_storage.c b/src/bindings/bind_storage.c similarity index 100% rename from core/src/bindings/bind_storage.c rename to src/bindings/bind_storage.c diff --git a/core/src/bindings/bind_storage.h b/src/bindings/bind_storage.h similarity index 100% rename from core/src/bindings/bind_storage.h rename to src/bindings/bind_storage.h diff --git a/core/src/bindings/bind_unit.c b/src/bindings/bind_unit.c similarity index 100% rename from core/src/bindings/bind_unit.c rename to src/bindings/bind_unit.c diff --git a/core/src/bindings/bind_unit.h b/src/bindings/bind_unit.h similarity index 100% rename from core/src/bindings/bind_unit.h rename to src/bindings/bind_unit.h diff --git a/core/src/bindings/bindings.c b/src/bindings/bindings.c similarity index 99% rename from core/src/bindings/bindings.c rename to src/bindings/bindings.c index 7d19db282..bcf7f76f3 100755 --- a/core/src/bindings/bindings.c +++ b/src/bindings/bindings.c @@ -48,12 +48,12 @@ without prior permission by the authors of Eressea. #include #include -#include -#include -#include -#include -#include -#include +#include "creport.h" +#include "economy.h" +#include "summary.h" +#include "laws.h" +#include "monster.h" +#include "market.h" #include #include diff --git a/core/src/bindings/bindings.h b/src/bindings/bindings.h similarity index 100% rename from core/src/bindings/bindings.h rename to src/bindings/bindings.h diff --git a/core/src/bindings/eressea.pkg b/src/bindings/eressea.pkg similarity index 87% rename from core/src/bindings/eressea.pkg rename to src/bindings/eressea.pkg index 78740c485..361edafc5 100755 --- a/core/src/bindings/eressea.pkg +++ b/src/bindings/eressea.pkg @@ -1,4 +1,4 @@ -$#include +$#include "bind_eressea.h" module eressea { void eressea_free_game @ free_game(void); diff --git a/core/src/bindings/helpers.c b/src/bindings/helpers.c similarity index 99% rename from core/src/bindings/helpers.c rename to src/bindings/helpers.c index 96407ca07..491a6f2e5 100644 --- a/core/src/bindings/helpers.c +++ b/src/bindings/helpers.c @@ -29,7 +29,7 @@ without prior permission by the authors of Eressea. #include #include -#include +#include "archetype.h" #include #include diff --git a/core/src/bindings/helpers.h b/src/bindings/helpers.h similarity index 100% rename from core/src/bindings/helpers.h rename to src/bindings/helpers.h diff --git a/core/src/bindings/process.pkg b/src/bindings/process.pkg similarity index 98% rename from core/src/bindings/process.pkg rename to src/bindings/process.pkg index fb68e3a42..8b880e171 100755 --- a/core/src/bindings/process.pkg +++ b/src/bindings/process.pkg @@ -1,4 +1,4 @@ -$#include +$#include "bind_process.h" module eressea { module process { diff --git a/core/src/bindings/settings.pkg b/src/bindings/settings.pkg similarity index 81% rename from core/src/bindings/settings.pkg rename to src/bindings/settings.pkg index 8269dbd58..39c392608 100755 --- a/core/src/bindings/settings.pkg +++ b/src/bindings/settings.pkg @@ -1,4 +1,4 @@ -$#include +$#include "bind_settings.h" module eressea { module settings { diff --git a/core/src/gamecode/creation.c b/src/creation.c similarity index 100% rename from core/src/gamecode/creation.c rename to src/creation.c diff --git a/core/src/gamecode/creation.h b/src/creation.h similarity index 100% rename from core/src/gamecode/creation.h rename to src/creation.h diff --git a/core/src/gamecode/creport.c b/src/creport.c similarity index 100% rename from core/src/gamecode/creport.c rename to src/creport.c diff --git a/core/src/gamecode/creport.h b/src/creport.h similarity index 100% rename from core/src/gamecode/creport.h rename to src/creport.h diff --git a/core/src/gamecode/economy.c b/src/economy.c similarity index 100% rename from core/src/gamecode/economy.c rename to src/economy.c diff --git a/core/src/gamecode/economy.h b/src/economy.h similarity index 100% rename from core/src/gamecode/economy.h rename to src/economy.h diff --git a/core/src/gamecode/economy_test.c b/src/economy_test.c similarity index 100% rename from core/src/gamecode/economy_test.c rename to src/economy_test.c diff --git a/core/src/eressea.c b/src/eressea.c similarity index 91% rename from core/src/eressea.c rename to src/eressea.c index d56fdfc9a..d8f56f692 100755 --- a/core/src/eressea.c +++ b/src/eressea.c @@ -22,13 +22,13 @@ #include #include #include -#include -#include -#include -#include -#include #include #include +#include "archetype.h" +#include "report.h" +#include "items.h" +#include "creport.h" +#include "xmlreport.h" void game_done(void) { diff --git a/core/src/eressea.h b/src/eressea.h similarity index 100% rename from core/src/eressea.h rename to src/eressea.h diff --git a/core/src/gamecode/give.c b/src/give.c similarity index 100% rename from core/src/gamecode/give.c rename to src/give.c diff --git a/core/src/gamecode/give.h b/src/give.h similarity index 100% rename from core/src/gamecode/give.h rename to src/give.h diff --git a/core/src/gmtool.c b/src/gmtool.c similarity index 100% rename from core/src/gmtool.c rename to src/gmtool.c diff --git a/core/src/gmtool.h b/src/gmtool.h similarity index 100% rename from core/src/gmtool.h rename to src/gmtool.h diff --git a/core/src/gmtool_structs.h b/src/gmtool_structs.h similarity index 100% rename from core/src/gmtool_structs.h rename to src/gmtool_structs.h diff --git a/core/src/gamecode/items.c b/src/items.c similarity index 100% rename from core/src/gamecode/items.c rename to src/items.c diff --git a/core/src/gamecode/items.h b/src/items.h similarity index 100% rename from core/src/gamecode/items.h rename to src/items.h diff --git a/src/items/CMakeLists.txt b/src/items/CMakeLists.txt new file mode 100644 index 000000000..5046403d1 --- /dev/null +++ b/src/items/CMakeLists.txt @@ -0,0 +1,17 @@ +PROJECT(items C) +SET(_FILES +artrewards.c +demonseye.c +itemtypes.c +phoenixcompass.c +seed.c +speedsail.c +weapons.c +xerewards.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(ITEMS_SRC ${_SOURCES} PARENT_SCOPE) + + \ No newline at end of file diff --git a/core/src/items/artrewards.c b/src/items/artrewards.c similarity index 100% rename from core/src/items/artrewards.c rename to src/items/artrewards.c diff --git a/core/src/items/artrewards.h b/src/items/artrewards.h similarity index 100% rename from core/src/items/artrewards.h rename to src/items/artrewards.h diff --git a/core/src/items/demonseye.c b/src/items/demonseye.c similarity index 100% rename from core/src/items/demonseye.c rename to src/items/demonseye.c diff --git a/core/src/items/demonseye.h b/src/items/demonseye.h similarity index 100% rename from core/src/items/demonseye.h rename to src/items/demonseye.h diff --git a/core/src/items/itemtypes.c b/src/items/itemtypes.c similarity index 100% rename from core/src/items/itemtypes.c rename to src/items/itemtypes.c diff --git a/core/src/items/itemtypes.h b/src/items/itemtypes.h similarity index 100% rename from core/src/items/itemtypes.h rename to src/items/itemtypes.h diff --git a/core/src/items/phoenixcompass.c b/src/items/phoenixcompass.c similarity index 100% rename from core/src/items/phoenixcompass.c rename to src/items/phoenixcompass.c diff --git a/core/src/items/phoenixcompass.h b/src/items/phoenixcompass.h similarity index 100% rename from core/src/items/phoenixcompass.h rename to src/items/phoenixcompass.h diff --git a/core/src/items/seed.c b/src/items/seed.c similarity index 100% rename from core/src/items/seed.c rename to src/items/seed.c diff --git a/core/src/items/seed.h b/src/items/seed.h similarity index 100% rename from core/src/items/seed.h rename to src/items/seed.h diff --git a/core/src/items/speedsail.c b/src/items/speedsail.c similarity index 100% rename from core/src/items/speedsail.c rename to src/items/speedsail.c diff --git a/core/src/items/speedsail.h b/src/items/speedsail.h similarity index 100% rename from core/src/items/speedsail.h rename to src/items/speedsail.h diff --git a/core/src/items/weapons.c b/src/items/weapons.c similarity index 100% rename from core/src/items/weapons.c rename to src/items/weapons.c diff --git a/core/src/items/weapons.h b/src/items/weapons.h similarity index 100% rename from core/src/items/weapons.h rename to src/items/weapons.h diff --git a/core/src/items/xerewards.c b/src/items/xerewards.c similarity index 100% rename from core/src/items/xerewards.c rename to src/items/xerewards.c diff --git a/core/src/items/xerewards.h b/src/items/xerewards.h similarity index 100% rename from core/src/items/xerewards.h rename to src/items/xerewards.h diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt new file mode 100644 index 000000000..8e5eef9ca --- /dev/null +++ b/src/kernel/CMakeLists.txt @@ -0,0 +1,68 @@ +project(kernel C) + +SET(_TEST_FILES +ship_test.c +spell_test.c +ally_test.c +battle_test.c +building_test.c +magic_test.c +equipment_test.c +curse_test.c +item_test.c +move_test.c +pool_test.c +reports_test.c +spellbook_test.c +curse_test.c +) + +SET(_FILES +alchemy.c +alliance.c +ally.c +battle.c +build.c +building.c +calendar.c +command.c +config.c +connection.c +curse.c +equipment.c +faction.c +group.c +item.c +magic.c +message.c +move.c +names.c +order.c +pathfinder.c +plane.c +player.c +pool.c +race.c +region.c +reports.c +resources.c +save.c +ship.c +skill.c +spellbook.c +spell.c +sqlite.c +teleport.c +terrain.c +unit.c +xmlreader.c +) + +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(KERNEL_SRC ${_SOURCES} PARENT_SCOPE) +FOREACH(_FILE ${_TEST_FILES}) + LIST(APPEND _TESTS ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(KERNEL_TESTS ${_TESTS} PARENT_SCOPE) diff --git a/core/src/kernel/alchemy.c b/src/kernel/alchemy.c similarity index 100% rename from core/src/kernel/alchemy.c rename to src/kernel/alchemy.c diff --git a/core/src/kernel/alchemy.h b/src/kernel/alchemy.h similarity index 100% rename from core/src/kernel/alchemy.h rename to src/kernel/alchemy.h diff --git a/core/src/kernel/alliance.c b/src/kernel/alliance.c similarity index 100% rename from core/src/kernel/alliance.c rename to src/kernel/alliance.c diff --git a/core/src/kernel/alliance.h b/src/kernel/alliance.h similarity index 100% rename from core/src/kernel/alliance.h rename to src/kernel/alliance.h diff --git a/core/src/kernel/ally.c b/src/kernel/ally.c similarity index 100% rename from core/src/kernel/ally.c rename to src/kernel/ally.c diff --git a/core/src/kernel/ally.h b/src/kernel/ally.h similarity index 100% rename from core/src/kernel/ally.h rename to src/kernel/ally.h diff --git a/core/src/kernel/ally_test.c b/src/kernel/ally_test.c similarity index 100% rename from core/src/kernel/ally_test.c rename to src/kernel/ally_test.c diff --git a/core/src/kernel/battle.c b/src/kernel/battle.c similarity index 100% rename from core/src/kernel/battle.c rename to src/kernel/battle.c diff --git a/core/src/kernel/battle.h b/src/kernel/battle.h similarity index 100% rename from core/src/kernel/battle.h rename to src/kernel/battle.h diff --git a/core/src/kernel/battle_test.c b/src/kernel/battle_test.c similarity index 100% rename from core/src/kernel/battle_test.c rename to src/kernel/battle_test.c diff --git a/core/src/kernel/build.c b/src/kernel/build.c similarity index 100% rename from core/src/kernel/build.c rename to src/kernel/build.c diff --git a/core/src/kernel/build.h b/src/kernel/build.h similarity index 100% rename from core/src/kernel/build.h rename to src/kernel/build.h diff --git a/core/src/kernel/building.c b/src/kernel/building.c similarity index 100% rename from core/src/kernel/building.c rename to src/kernel/building.c diff --git a/core/src/kernel/building.h b/src/kernel/building.h similarity index 100% rename from core/src/kernel/building.h rename to src/kernel/building.h diff --git a/core/src/kernel/building_test.c b/src/kernel/building_test.c similarity index 100% rename from core/src/kernel/building_test.c rename to src/kernel/building_test.c diff --git a/core/src/kernel/calendar.c b/src/kernel/calendar.c similarity index 100% rename from core/src/kernel/calendar.c rename to src/kernel/calendar.c diff --git a/core/src/kernel/calendar.h b/src/kernel/calendar.h similarity index 100% rename from core/src/kernel/calendar.h rename to src/kernel/calendar.h diff --git a/core/src/kernel/command.c b/src/kernel/command.c similarity index 100% rename from core/src/kernel/command.c rename to src/kernel/command.c diff --git a/core/src/kernel/command.h b/src/kernel/command.h similarity index 100% rename from core/src/kernel/command.h rename to src/kernel/command.h diff --git a/core/src/kernel/config.c b/src/kernel/config.c similarity index 100% rename from core/src/kernel/config.c rename to src/kernel/config.c diff --git a/core/src/kernel/config.h b/src/kernel/config.h similarity index 100% rename from core/src/kernel/config.h rename to src/kernel/config.h diff --git a/core/src/kernel/connection.c b/src/kernel/connection.c similarity index 100% rename from core/src/kernel/connection.c rename to src/kernel/connection.c diff --git a/core/src/kernel/connection.h b/src/kernel/connection.h similarity index 100% rename from core/src/kernel/connection.h rename to src/kernel/connection.h diff --git a/core/src/kernel/curse.c b/src/kernel/curse.c similarity index 100% rename from core/src/kernel/curse.c rename to src/kernel/curse.c diff --git a/core/src/kernel/curse.h b/src/kernel/curse.h similarity index 100% rename from core/src/kernel/curse.h rename to src/kernel/curse.h diff --git a/core/src/kernel/curse_test.c b/src/kernel/curse_test.c similarity index 100% rename from core/src/kernel/curse_test.c rename to src/kernel/curse_test.c diff --git a/core/src/kernel/equipment.c b/src/kernel/equipment.c similarity index 100% rename from core/src/kernel/equipment.c rename to src/kernel/equipment.c diff --git a/core/src/kernel/equipment.h b/src/kernel/equipment.h similarity index 100% rename from core/src/kernel/equipment.h rename to src/kernel/equipment.h diff --git a/core/src/kernel/equipment_test.c b/src/kernel/equipment_test.c similarity index 100% rename from core/src/kernel/equipment_test.c rename to src/kernel/equipment_test.c diff --git a/core/src/kernel/faction.c b/src/kernel/faction.c similarity index 100% rename from core/src/kernel/faction.c rename to src/kernel/faction.c diff --git a/core/src/kernel/faction.h b/src/kernel/faction.h similarity index 100% rename from core/src/kernel/faction.h rename to src/kernel/faction.h diff --git a/core/src/kernel/group.c b/src/kernel/group.c similarity index 100% rename from core/src/kernel/group.c rename to src/kernel/group.c diff --git a/core/src/kernel/group.h b/src/kernel/group.h similarity index 100% rename from core/src/kernel/group.h rename to src/kernel/group.h diff --git a/core/src/kernel/item.c b/src/kernel/item.c similarity index 100% rename from core/src/kernel/item.c rename to src/kernel/item.c diff --git a/core/src/kernel/item.h b/src/kernel/item.h similarity index 100% rename from core/src/kernel/item.h rename to src/kernel/item.h diff --git a/core/src/kernel/item_test.c b/src/kernel/item_test.c similarity index 100% rename from core/src/kernel/item_test.c rename to src/kernel/item_test.c diff --git a/core/src/kernel/magic.c b/src/kernel/magic.c similarity index 100% rename from core/src/kernel/magic.c rename to src/kernel/magic.c diff --git a/core/src/kernel/magic.h b/src/kernel/magic.h similarity index 100% rename from core/src/kernel/magic.h rename to src/kernel/magic.h diff --git a/core/src/kernel/magic_test.c b/src/kernel/magic_test.c similarity index 100% rename from core/src/kernel/magic_test.c rename to src/kernel/magic_test.c diff --git a/core/src/kernel/message.c b/src/kernel/message.c similarity index 100% rename from core/src/kernel/message.c rename to src/kernel/message.c diff --git a/core/src/kernel/message.h b/src/kernel/message.h similarity index 100% rename from core/src/kernel/message.h rename to src/kernel/message.h diff --git a/core/src/kernel/move.c b/src/kernel/move.c similarity index 100% rename from core/src/kernel/move.c rename to src/kernel/move.c diff --git a/core/src/kernel/move.h b/src/kernel/move.h similarity index 100% rename from core/src/kernel/move.h rename to src/kernel/move.h diff --git a/core/src/kernel/move_test.c b/src/kernel/move_test.c similarity index 100% rename from core/src/kernel/move_test.c rename to src/kernel/move_test.c diff --git a/core/src/kernel/names.c b/src/kernel/names.c similarity index 100% rename from core/src/kernel/names.c rename to src/kernel/names.c diff --git a/core/src/kernel/names.h b/src/kernel/names.h similarity index 100% rename from core/src/kernel/names.h rename to src/kernel/names.h diff --git a/core/src/kernel/objtypes.h b/src/kernel/objtypes.h similarity index 100% rename from core/src/kernel/objtypes.h rename to src/kernel/objtypes.h diff --git a/core/src/kernel/order.c b/src/kernel/order.c similarity index 100% rename from core/src/kernel/order.c rename to src/kernel/order.c diff --git a/core/src/kernel/order.h b/src/kernel/order.h similarity index 100% rename from core/src/kernel/order.h rename to src/kernel/order.h diff --git a/core/src/kernel/pathfinder.c b/src/kernel/pathfinder.c similarity index 100% rename from core/src/kernel/pathfinder.c rename to src/kernel/pathfinder.c diff --git a/core/src/kernel/pathfinder.h b/src/kernel/pathfinder.h similarity index 100% rename from core/src/kernel/pathfinder.h rename to src/kernel/pathfinder.h diff --git a/core/src/kernel/plane.c b/src/kernel/plane.c similarity index 100% rename from core/src/kernel/plane.c rename to src/kernel/plane.c diff --git a/core/src/kernel/plane.h b/src/kernel/plane.h similarity index 100% rename from core/src/kernel/plane.h rename to src/kernel/plane.h diff --git a/core/src/kernel/player.c b/src/kernel/player.c similarity index 100% rename from core/src/kernel/player.c rename to src/kernel/player.c diff --git a/core/src/kernel/player.h b/src/kernel/player.h similarity index 100% rename from core/src/kernel/player.h rename to src/kernel/player.h diff --git a/core/src/kernel/pool.c b/src/kernel/pool.c similarity index 100% rename from core/src/kernel/pool.c rename to src/kernel/pool.c diff --git a/core/src/kernel/pool.h b/src/kernel/pool.h similarity index 100% rename from core/src/kernel/pool.h rename to src/kernel/pool.h diff --git a/core/src/kernel/pool_test.c b/src/kernel/pool_test.c similarity index 100% rename from core/src/kernel/pool_test.c rename to src/kernel/pool_test.c diff --git a/core/src/kernel/race.c b/src/kernel/race.c similarity index 100% rename from core/src/kernel/race.c rename to src/kernel/race.c diff --git a/core/src/kernel/race.h b/src/kernel/race.h similarity index 100% rename from core/src/kernel/race.h rename to src/kernel/race.h diff --git a/core/src/kernel/region.c b/src/kernel/region.c similarity index 100% rename from core/src/kernel/region.c rename to src/kernel/region.c diff --git a/core/src/kernel/region.h b/src/kernel/region.h similarity index 100% rename from core/src/kernel/region.h rename to src/kernel/region.h diff --git a/core/src/kernel/render.h b/src/kernel/render.h similarity index 100% rename from core/src/kernel/render.h rename to src/kernel/render.h diff --git a/core/src/kernel/reports.c b/src/kernel/reports.c similarity index 100% rename from core/src/kernel/reports.c rename to src/kernel/reports.c diff --git a/core/src/kernel/reports.h b/src/kernel/reports.h similarity index 100% rename from core/src/kernel/reports.h rename to src/kernel/reports.h diff --git a/core/src/kernel/reports_test.c b/src/kernel/reports_test.c similarity index 100% rename from core/src/kernel/reports_test.c rename to src/kernel/reports_test.c diff --git a/core/src/kernel/resources.c b/src/kernel/resources.c similarity index 100% rename from core/src/kernel/resources.c rename to src/kernel/resources.c diff --git a/core/src/kernel/resources.h b/src/kernel/resources.h similarity index 100% rename from core/src/kernel/resources.h rename to src/kernel/resources.h diff --git a/core/src/kernel/save.c b/src/kernel/save.c similarity index 100% rename from core/src/kernel/save.c rename to src/kernel/save.c diff --git a/core/src/kernel/save.h b/src/kernel/save.h similarity index 100% rename from core/src/kernel/save.h rename to src/kernel/save.h diff --git a/core/src/kernel/ship.c b/src/kernel/ship.c similarity index 100% rename from core/src/kernel/ship.c rename to src/kernel/ship.c diff --git a/core/src/kernel/ship.h b/src/kernel/ship.h similarity index 100% rename from core/src/kernel/ship.h rename to src/kernel/ship.h diff --git a/core/src/kernel/ship_test.c b/src/kernel/ship_test.c similarity index 100% rename from core/src/kernel/ship_test.c rename to src/kernel/ship_test.c diff --git a/core/src/kernel/skill.c b/src/kernel/skill.c similarity index 100% rename from core/src/kernel/skill.c rename to src/kernel/skill.c diff --git a/core/src/kernel/skill.h b/src/kernel/skill.h similarity index 100% rename from core/src/kernel/skill.h rename to src/kernel/skill.h diff --git a/core/src/kernel/spell.c b/src/kernel/spell.c similarity index 100% rename from core/src/kernel/spell.c rename to src/kernel/spell.c diff --git a/core/src/kernel/spell.h b/src/kernel/spell.h similarity index 100% rename from core/src/kernel/spell.h rename to src/kernel/spell.h diff --git a/core/src/kernel/spell_test.c b/src/kernel/spell_test.c similarity index 100% rename from core/src/kernel/spell_test.c rename to src/kernel/spell_test.c diff --git a/core/src/kernel/spellbook.c b/src/kernel/spellbook.c similarity index 100% rename from core/src/kernel/spellbook.c rename to src/kernel/spellbook.c diff --git a/core/src/kernel/spellbook.h b/src/kernel/spellbook.h similarity index 100% rename from core/src/kernel/spellbook.h rename to src/kernel/spellbook.h diff --git a/core/src/kernel/spellbook_test.c b/src/kernel/spellbook_test.c similarity index 100% rename from core/src/kernel/spellbook_test.c rename to src/kernel/spellbook_test.c diff --git a/core/src/kernel/spellid.h b/src/kernel/spellid.h similarity index 100% rename from core/src/kernel/spellid.h rename to src/kernel/spellid.h diff --git a/core/src/kernel/sqlite.c b/src/kernel/sqlite.c similarity index 100% rename from core/src/kernel/sqlite.c rename to src/kernel/sqlite.c diff --git a/core/src/kernel/teleport.c b/src/kernel/teleport.c similarity index 100% rename from core/src/kernel/teleport.c rename to src/kernel/teleport.c diff --git a/core/src/kernel/teleport.h b/src/kernel/teleport.h similarity index 100% rename from core/src/kernel/teleport.h rename to src/kernel/teleport.h diff --git a/core/src/kernel/terrain.c b/src/kernel/terrain.c similarity index 100% rename from core/src/kernel/terrain.c rename to src/kernel/terrain.c diff --git a/core/src/kernel/terrain.h b/src/kernel/terrain.h similarity index 100% rename from core/src/kernel/terrain.h rename to src/kernel/terrain.h diff --git a/core/src/kernel/terrainid.h b/src/kernel/terrainid.h similarity index 100% rename from core/src/kernel/terrainid.h rename to src/kernel/terrainid.h diff --git a/core/src/kernel/types.h b/src/kernel/types.h similarity index 100% rename from core/src/kernel/types.h rename to src/kernel/types.h diff --git a/core/src/kernel/unit.c b/src/kernel/unit.c similarity index 100% rename from core/src/kernel/unit.c rename to src/kernel/unit.c diff --git a/core/src/kernel/unit.h b/src/kernel/unit.h similarity index 100% rename from core/src/kernel/unit.h rename to src/kernel/unit.h diff --git a/core/src/kernel/version.h b/src/kernel/version.h similarity index 100% rename from core/src/kernel/version.h rename to src/kernel/version.h diff --git a/core/src/kernel/xmlkernel.h b/src/kernel/xmlkernel.h similarity index 100% rename from core/src/kernel/xmlkernel.h rename to src/kernel/xmlkernel.h diff --git a/core/src/kernel/xmlreader.c b/src/kernel/xmlreader.c similarity index 100% rename from core/src/kernel/xmlreader.c rename to src/kernel/xmlreader.c diff --git a/core/src/kernel/xmlreader.h b/src/kernel/xmlreader.h similarity index 100% rename from core/src/kernel/xmlreader.h rename to src/kernel/xmlreader.h diff --git a/core/src/gamecode/laws.c b/src/laws.c similarity index 100% rename from core/src/gamecode/laws.c rename to src/laws.c diff --git a/core/src/gamecode/laws.h b/src/laws.h similarity index 100% rename from core/src/gamecode/laws.h rename to src/laws.h diff --git a/core/src/gamecode/laws_test.c b/src/laws_test.c similarity index 100% rename from core/src/gamecode/laws_test.c rename to src/laws_test.c diff --git a/src/main.c b/src/main.c index cd0e4053c..28bf98307 100644 --- a/src/main.c +++ b/src/main.c @@ -23,13 +23,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include -#include -#include +#include "eressea.h" +#include "gmtool.h" +#include "bindings/bindings.h" #include "races/races.h" #include "spells/spells.h" -#include "curses.h" +#include "spells/borders.h" #include #include @@ -237,7 +237,7 @@ void locale_init(void) } } -extern void bind_eressea(struct lua_State *L); +extern void bind_monsters(struct lua_State *L); int main(int argc, char **argv) { @@ -262,9 +262,9 @@ int main(int argc, char **argv) L = lua_init(); game_init(); register_races(); - register_curses(); + register_borders(); register_spells(); - bind_eressea(L); + bind_monsters(L); err = eressea_run(L, luafile, entry_point); if (err) { diff --git a/core/src/gamecode/market.c b/src/market.c similarity index 100% rename from core/src/gamecode/market.c rename to src/market.c diff --git a/core/src/gamecode/market.h b/src/market.h similarity index 100% rename from core/src/gamecode/market.h rename to src/market.h diff --git a/core/src/gamecode/market_test.c b/src/market_test.c similarity index 100% rename from core/src/gamecode/market_test.c rename to src/market_test.c diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt new file mode 100644 index 000000000..14882c139 --- /dev/null +++ b/src/modules/CMakeLists.txt @@ -0,0 +1,16 @@ +PROJECT(modules C) +SET(_FILES +arena.c +autoseed.c +dungeon.c +gmcmd.c +museum.c +score.c +weather.c +wormhole.c +xmas.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(MODULES_SRC ${_SOURCES} PARENT_SCOPE) diff --git a/core/src/modules/arena.c b/src/modules/arena.c similarity index 100% rename from core/src/modules/arena.c rename to src/modules/arena.c diff --git a/core/src/modules/arena.h b/src/modules/arena.h similarity index 100% rename from core/src/modules/arena.h rename to src/modules/arena.h diff --git a/core/src/modules/autoseed.c b/src/modules/autoseed.c similarity index 100% rename from core/src/modules/autoseed.c rename to src/modules/autoseed.c diff --git a/core/src/modules/autoseed.h b/src/modules/autoseed.h similarity index 100% rename from core/src/modules/autoseed.h rename to src/modules/autoseed.h diff --git a/core/src/modules/dungeon.c b/src/modules/dungeon.c similarity index 100% rename from core/src/modules/dungeon.c rename to src/modules/dungeon.c diff --git a/core/src/modules/dungeon.h b/src/modules/dungeon.h similarity index 100% rename from core/src/modules/dungeon.h rename to src/modules/dungeon.h diff --git a/core/src/modules/gmcmd.c b/src/modules/gmcmd.c similarity index 100% rename from core/src/modules/gmcmd.c rename to src/modules/gmcmd.c diff --git a/core/src/modules/gmcmd.h b/src/modules/gmcmd.h similarity index 100% rename from core/src/modules/gmcmd.h rename to src/modules/gmcmd.h diff --git a/core/src/modules/museum.c b/src/modules/museum.c similarity index 100% rename from core/src/modules/museum.c rename to src/modules/museum.c diff --git a/core/src/modules/museum.h b/src/modules/museum.h similarity index 100% rename from core/src/modules/museum.h rename to src/modules/museum.h diff --git a/core/src/modules/score.c b/src/modules/score.c similarity index 100% rename from core/src/modules/score.c rename to src/modules/score.c diff --git a/core/src/modules/score.h b/src/modules/score.h similarity index 100% rename from core/src/modules/score.h rename to src/modules/score.h diff --git a/core/src/modules/weather.c b/src/modules/weather.c similarity index 100% rename from core/src/modules/weather.c rename to src/modules/weather.c diff --git a/core/src/modules/weather.h b/src/modules/weather.h similarity index 100% rename from core/src/modules/weather.h rename to src/modules/weather.h diff --git a/core/src/modules/wormhole.c b/src/modules/wormhole.c similarity index 100% rename from core/src/modules/wormhole.c rename to src/modules/wormhole.c diff --git a/core/src/modules/wormhole.h b/src/modules/wormhole.h similarity index 100% rename from core/src/modules/wormhole.h rename to src/modules/wormhole.h diff --git a/core/src/modules/xmas.c b/src/modules/xmas.c similarity index 100% rename from core/src/modules/xmas.c rename to src/modules/xmas.c diff --git a/core/src/modules/xmas.h b/src/modules/xmas.h similarity index 100% rename from core/src/modules/xmas.h rename to src/modules/xmas.h diff --git a/core/src/gamecode/monster.c b/src/monster.c similarity index 100% rename from core/src/gamecode/monster.c rename to src/monster.c diff --git a/core/src/gamecode/monster.h b/src/monster.h similarity index 100% rename from core/src/gamecode/monster.h rename to src/monster.h diff --git a/src/monsters.c b/src/monsters.c index 14dba72af..9aa534b9b 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -22,6 +22,10 @@ #include #include +#include "economy.h" +#include "give.h" +#include "monster.h" + /* triggers includes */ #include @@ -49,10 +53,6 @@ #include #include -#include -#include -#include - /* util includes */ #include #include diff --git a/core/src/platform.h b/src/platform.h similarity index 100% rename from core/src/platform.h rename to src/platform.h diff --git a/src/races/CMakeLists.txt b/src/races/CMakeLists.txt new file mode 100644 index 000000000..1f3044e3a --- /dev/null +++ b/src/races/CMakeLists.txt @@ -0,0 +1,11 @@ +PROJECT(races C) +SET(_FILES +dragons.c +illusion.c +races.c +zombies.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(RACES_SRC ${_SOURCES} PARENT_SCOPE) diff --git a/src/races/races.c b/src/races/races.c index 487f489b0..c2af9b323 100644 --- a/src/races/races.c +++ b/src/races/races.c @@ -8,7 +8,7 @@ * */ -#include +#include "platform.h" #include #include "races.h" diff --git a/core/src/gamecode/randenc.c b/src/randenc.c similarity index 100% rename from core/src/gamecode/randenc.c rename to src/randenc.c diff --git a/core/src/gamecode/randenc.h b/src/randenc.h similarity index 100% rename from core/src/gamecode/randenc.h rename to src/randenc.h diff --git a/core/src/gamecode/report.c b/src/report.c similarity index 100% rename from core/src/gamecode/report.c rename to src/report.c diff --git a/core/src/gamecode/report.h b/src/report.h similarity index 100% rename from core/src/gamecode/report.h rename to src/report.h diff --git a/core/src/settings.h b/src/settings.h similarity index 100% rename from core/src/settings.h rename to src/settings.h diff --git a/src/spells/CMakeLists.txt b/src/spells/CMakeLists.txt new file mode 100644 index 000000000..be2891c8f --- /dev/null +++ b/src/spells/CMakeLists.txt @@ -0,0 +1,15 @@ +PROJECT(spells C) +SET(_FILES +alp.c +borders.c +buildingcurse.c +combatspells.c +regioncurse.c +shipcurse.c +spells.c +unitcurse.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(SPELLS_SRC ${_SOURCES} PARENT_SCOPE) diff --git a/src/curses.c b/src/spells/borders.c similarity index 96% rename from src/curses.c rename to src/spells/borders.c index ae78dc966..86767d06c 100644 --- a/src/curses.c +++ b/src/spells/borders.c @@ -1,7 +1,7 @@ #include #include -#include "curses.h" +#include "borders.h" #include #include @@ -14,11 +14,6 @@ #include #include -#include "spells/regioncurse.h" -#include "spells/unitcurse.h" -#include "spells/shipcurse.h" -#include "spells/buildingcurse.h" - #include #include #include @@ -294,7 +289,7 @@ border_type bt_wisps = { /* only here for reading old data */ 0 }; -void register_curses(void) +void register_borders(void) { border_convert_cb = &convert_firewall_timeouts; at_register(&at_cursewall); @@ -302,9 +297,4 @@ void register_curses(void) register_bordertype(&bt_firewall); register_bordertype(&bt_wisps); register_bordertype(&bt_chaosgate); - - register_unitcurse(); - register_regioncurse(); - register_shipcurse(); - register_buildingcurse(); } diff --git a/src/curses.h b/src/spells/borders.h similarity index 93% rename from src/curses.h rename to src/spells/borders.h index 912f73da9..faf80ffd9 100644 --- a/src/curses.h +++ b/src/spells/borders.h @@ -4,7 +4,7 @@ extern "C" { #endif - extern void register_curses(void); + extern void register_borders(void); /* für Feuerwände: in movement muß das noch explizit getestet werden. ** besser wäre eine blcok_type::move() routine, die den effekt diff --git a/src/spells/spells.c b/src/spells/spells.c index e595000ff..46217f70e 100644 --- a/src/spells/spells.c +++ b/src/spells/spells.c @@ -15,9 +15,10 @@ #include #include #include -#include "spells.h" -#include "../curses.h" +#include "../spy.h" +#include "spells.h" +#include "borders.h" #include "buildingcurse.h" #include "regioncurse.h" #include "unitcurse.h" @@ -53,8 +54,6 @@ #include #include -#include - /* spells includes */ #include "alp.h" @@ -6750,4 +6749,9 @@ void register_spells(void) register_function((pf_generic) sp_kampfzauber, "combat_spell"); register_spelldata(); + + register_unitcurse(); + register_regioncurse(); + register_shipcurse(); + register_buildingcurse(); } diff --git a/core/src/gamecode/spy.c b/src/spy.c similarity index 100% rename from core/src/gamecode/spy.c rename to src/spy.c diff --git a/core/src/gamecode/spy.h b/src/spy.h similarity index 100% rename from core/src/gamecode/spy.h rename to src/spy.h diff --git a/core/src/stdafx.h b/src/stdafx.h similarity index 100% rename from core/src/stdafx.h rename to src/stdafx.h diff --git a/core/src/gamecode/study.c b/src/study.c similarity index 100% rename from core/src/gamecode/study.c rename to src/study.c diff --git a/core/src/gamecode/study.h b/src/study.h similarity index 100% rename from core/src/gamecode/study.h rename to src/study.h diff --git a/core/src/gamecode/summary.c b/src/summary.c similarity index 100% rename from core/src/gamecode/summary.c rename to src/summary.c diff --git a/core/src/gamecode/summary.h b/src/summary.h similarity index 100% rename from core/src/gamecode/summary.h rename to src/summary.h diff --git a/src/test_eressea.c b/src/test_eressea.c new file mode 100644 index 000000000..2a56c087e --- /dev/null +++ b/src/test_eressea.c @@ -0,0 +1,72 @@ +#include +#include +#include + +CuSuite *get_tests_suite(void); +CuSuite *get_economy_suite(void); +CuSuite *get_laws_suite(void); +CuSuite *get_market_suite(void); +CuSuite *get_battle_suite(void); +CuSuite *get_building_suite(void); +CuSuite *get_curse_suite(void); +CuSuite *get_equipment_suite(void); +CuSuite *get_item_suite(void); +CuSuite *get_magic_suite(void); +CuSuite *get_move_suite(void); +CuSuite *get_pool_suite(void); +CuSuite *get_reports_suite(void); +CuSuite *get_ship_suite(void); +CuSuite *get_spellbook_suite(void); +CuSuite *get_spell_suite(void); +CuSuite *get_base36_suite(void); +CuSuite *get_bsdstring_suite(void); +CuSuite *get_functions_suite(void); +CuSuite *get_umlaut_suite(void); +CuSuite *get_ally_suite(void); + +int RunAllTests(void) +{ + CuString *output = CuStringNew(); + CuSuite *suite = CuSuiteNew(); + int flags = log_flags; + + log_flags = LOG_FLUSH | LOG_CPERROR; + + /* self-test */ + CuSuiteAddSuite(suite, get_tests_suite()); + /* util */ + CuSuiteAddSuite(suite, get_base36_suite()); + CuSuiteAddSuite(suite, get_bsdstring_suite()); + CuSuiteAddSuite(suite, get_functions_suite()); + CuSuiteAddSuite(suite, get_umlaut_suite()); + /* kernel */ + CuSuiteAddSuite(suite, get_pool_suite()); + CuSuiteAddSuite(suite, get_curse_suite()); + CuSuiteAddSuite(suite, get_equipment_suite()); + CuSuiteAddSuite(suite, get_item_suite()); + CuSuiteAddSuite(suite, get_magic_suite()); + CuSuiteAddSuite(suite, get_move_suite()); + CuSuiteAddSuite(suite, get_reports_suite()); + CuSuiteAddSuite(suite, get_ship_suite()); + CuSuiteAddSuite(suite, get_spellbook_suite()); + CuSuiteAddSuite(suite, get_building_suite()); + CuSuiteAddSuite(suite, get_spell_suite()); + CuSuiteAddSuite(suite, get_battle_suite()); + CuSuiteAddSuite(suite, get_ally_suite()); + /* gamecode */ + CuSuiteAddSuite(suite, get_market_suite()); + CuSuiteAddSuite(suite, get_laws_suite()); + CuSuiteAddSuite(suite, get_economy_suite()); + + CuSuiteRun(suite); + CuSuiteSummary(suite, output); + CuSuiteDetails(suite, output); + printf("%s\n", output->buffer); + + log_flags = flags; + return suite->failCount; +} + +int main(int argc, char ** argv) { + return RunAllTests(); +} diff --git a/core/src/tests.c b/src/tests.c similarity index 75% rename from core/src/tests.c rename to src/tests.c index 35356fec1..cbb72279b 100644 --- a/core/src/tests.c +++ b/src/tests.c @@ -1,6 +1,3 @@ -#include -#include - #include #include #include "tests.h" @@ -23,49 +20,6 @@ #include -int RunAllTests(void) -{ - CuString *output = CuStringNew(); - CuSuite *suite = CuSuiteNew(); - int flags = log_flags; - - log_flags = LOG_FLUSH | LOG_CPERROR; - - /* self-test */ - CuSuiteAddSuite(suite, get_tests_suite()); - /* util */ - CuSuiteAddSuite(suite, get_base36_suite()); - CuSuiteAddSuite(suite, get_bsdstring_suite()); - CuSuiteAddSuite(suite, get_functions_suite()); - CuSuiteAddSuite(suite, get_umlaut_suite()); - /* kernel */ - CuSuiteAddSuite(suite, get_pool_suite()); - CuSuiteAddSuite(suite, get_curse_suite()); - CuSuiteAddSuite(suite, get_equipment_suite()); - CuSuiteAddSuite(suite, get_item_suite()); - CuSuiteAddSuite(suite, get_magic_suite()); - CuSuiteAddSuite(suite, get_move_suite()); - CuSuiteAddSuite(suite, get_reports_suite()); - CuSuiteAddSuite(suite, get_ship_suite()); - CuSuiteAddSuite(suite, get_spellbook_suite()); - CuSuiteAddSuite(suite, get_building_suite()); - CuSuiteAddSuite(suite, get_spell_suite()); - CuSuiteAddSuite(suite, get_battle_suite()); - CuSuiteAddSuite(suite, get_ally_suite()); - /* gamecode */ - CuSuiteAddSuite(suite, get_market_suite()); - CuSuiteAddSuite(suite, get_laws_suite()); - CuSuiteAddSuite(suite, get_economy_suite()); - - CuSuiteRun(suite); - CuSuiteSummary(suite, output); - CuSuiteDetails(suite, output); - printf("%s\n", output->buffer); - - log_flags = flags; - return suite->failCount; -} - struct race *test_create_race(const char *name) { race *rc = rc_add(rc_new(name)); @@ -214,6 +168,3 @@ void test_create_world(void) test_create_shiptype(names+2); } -int main(int argc, char ** argv) { - return RunAllTests(); -} diff --git a/core/src/tests.h b/src/tests.h similarity index 56% rename from core/src/tests.h rename to src/tests.h index 15aa7a230..7ebd903a8 100644 --- a/core/src/tests.h +++ b/src/tests.h @@ -5,28 +5,6 @@ extern "C" { #endif #include - CuSuite *get_tests_suite(void); - CuSuite *get_economy_suite(void); - CuSuite *get_laws_suite(void); - CuSuite *get_market_suite(void); - CuSuite *get_battle_suite(void); - CuSuite *get_building_suite(void); - CuSuite *get_curse_suite(void); - CuSuite *get_equipment_suite(void); - CuSuite *get_item_suite(void); - CuSuite *get_magic_suite(void); - CuSuite *get_move_suite(void); - CuSuite *get_pool_suite(void); - CuSuite *get_reports_suite(void); - CuSuite *get_ship_suite(void); - CuSuite *get_spellbook_suite(void); - CuSuite *get_spell_suite(void); - CuSuite *get_base36_suite(void); - CuSuite *get_bsdstring_suite(void); - CuSuite *get_functions_suite(void); - CuSuite *get_umlaut_suite(void); - CuSuite *get_ally_suite(void); - void test_cleanup(void); struct terrain_type * test_create_terrain(const char * name, unsigned int flags); diff --git a/core/src/tests_test.c b/src/tests_test.c similarity index 100% rename from core/src/tests_test.c rename to src/tests_test.c diff --git a/src/triggers/CMakeLists.txt b/src/triggers/CMakeLists.txt new file mode 100644 index 000000000..76e7bf02f --- /dev/null +++ b/src/triggers/CMakeLists.txt @@ -0,0 +1,21 @@ +PROJECT(triggers C) +SET(_FILES +changefaction.c +changerace.c +clonedied.c +createcurse.c +createunit.c +gate.c +giveitem.c +killunit.c +removecurse.c +shock.c +timeout.c +triggers.c +unguard.c +unitmessage.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(TRIGGERS_SRC ${_SOURCES} PARENT_SCOPE) diff --git a/core/src/triggers/changefaction.c b/src/triggers/changefaction.c similarity index 100% rename from core/src/triggers/changefaction.c rename to src/triggers/changefaction.c diff --git a/core/src/triggers/changefaction.h b/src/triggers/changefaction.h similarity index 100% rename from core/src/triggers/changefaction.h rename to src/triggers/changefaction.h diff --git a/core/src/triggers/changerace.c b/src/triggers/changerace.c similarity index 100% rename from core/src/triggers/changerace.c rename to src/triggers/changerace.c diff --git a/core/src/triggers/changerace.h b/src/triggers/changerace.h similarity index 100% rename from core/src/triggers/changerace.h rename to src/triggers/changerace.h diff --git a/core/src/triggers/clonedied.c b/src/triggers/clonedied.c similarity index 100% rename from core/src/triggers/clonedied.c rename to src/triggers/clonedied.c diff --git a/core/src/triggers/clonedied.h b/src/triggers/clonedied.h similarity index 100% rename from core/src/triggers/clonedied.h rename to src/triggers/clonedied.h diff --git a/core/src/triggers/createcurse.c b/src/triggers/createcurse.c similarity index 100% rename from core/src/triggers/createcurse.c rename to src/triggers/createcurse.c diff --git a/core/src/triggers/createcurse.h b/src/triggers/createcurse.h similarity index 100% rename from core/src/triggers/createcurse.h rename to src/triggers/createcurse.h diff --git a/core/src/triggers/createunit.c b/src/triggers/createunit.c similarity index 100% rename from core/src/triggers/createunit.c rename to src/triggers/createunit.c diff --git a/core/src/triggers/createunit.h b/src/triggers/createunit.h similarity index 100% rename from core/src/triggers/createunit.h rename to src/triggers/createunit.h diff --git a/core/src/triggers/gate.c b/src/triggers/gate.c similarity index 100% rename from core/src/triggers/gate.c rename to src/triggers/gate.c diff --git a/core/src/triggers/gate.h b/src/triggers/gate.h similarity index 100% rename from core/src/triggers/gate.h rename to src/triggers/gate.h diff --git a/core/src/triggers/giveitem.c b/src/triggers/giveitem.c similarity index 100% rename from core/src/triggers/giveitem.c rename to src/triggers/giveitem.c diff --git a/core/src/triggers/giveitem.h b/src/triggers/giveitem.h similarity index 100% rename from core/src/triggers/giveitem.h rename to src/triggers/giveitem.h diff --git a/core/src/triggers/killunit.c b/src/triggers/killunit.c similarity index 100% rename from core/src/triggers/killunit.c rename to src/triggers/killunit.c diff --git a/core/src/triggers/killunit.h b/src/triggers/killunit.h similarity index 100% rename from core/src/triggers/killunit.h rename to src/triggers/killunit.h diff --git a/core/src/triggers/removecurse.c b/src/triggers/removecurse.c similarity index 100% rename from core/src/triggers/removecurse.c rename to src/triggers/removecurse.c diff --git a/core/src/triggers/removecurse.h b/src/triggers/removecurse.h similarity index 100% rename from core/src/triggers/removecurse.h rename to src/triggers/removecurse.h diff --git a/core/src/triggers/shock.c b/src/triggers/shock.c similarity index 100% rename from core/src/triggers/shock.c rename to src/triggers/shock.c diff --git a/core/src/triggers/shock.h b/src/triggers/shock.h similarity index 100% rename from core/src/triggers/shock.h rename to src/triggers/shock.h diff --git a/core/src/triggers/timeout.c b/src/triggers/timeout.c similarity index 100% rename from core/src/triggers/timeout.c rename to src/triggers/timeout.c diff --git a/core/src/triggers/timeout.h b/src/triggers/timeout.h similarity index 100% rename from core/src/triggers/timeout.h rename to src/triggers/timeout.h diff --git a/core/src/triggers/triggers.c b/src/triggers/triggers.c similarity index 100% rename from core/src/triggers/triggers.c rename to src/triggers/triggers.c diff --git a/core/src/triggers/triggers.h b/src/triggers/triggers.h similarity index 100% rename from core/src/triggers/triggers.h rename to src/triggers/triggers.h diff --git a/core/src/triggers/unguard.c b/src/triggers/unguard.c similarity index 100% rename from core/src/triggers/unguard.c rename to src/triggers/unguard.c diff --git a/core/src/triggers/unguard.h b/src/triggers/unguard.h similarity index 100% rename from core/src/triggers/unguard.h rename to src/triggers/unguard.h diff --git a/core/src/triggers/unitmessage.c b/src/triggers/unitmessage.c similarity index 100% rename from core/src/triggers/unitmessage.c rename to src/triggers/unitmessage.c diff --git a/core/src/triggers/unitmessage.h b/src/triggers/unitmessage.h similarity index 100% rename from core/src/triggers/unitmessage.h rename to src/triggers/unitmessage.h diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt new file mode 100644 index 000000000..fb0b58607 --- /dev/null +++ b/src/util/CMakeLists.txt @@ -0,0 +1,44 @@ +project(util C) + +SET(_TEST_FILES +base36_test.c +bsdstring_test.c +functions_test.c +umlaut_test.c +) + +SET(_FILES +attrib.c +base36.c +bsdstring.c +console.c +crmessage.c +dice.c +event.c +filereader.c +functions.c +goodies.c +language.c +listbox.c +lists.c +log.c +message.c +nrmessage.c +parser.c +rand.c +resolve.c +sql.c +strings.c +translation.c +umlaut.c +unicode.c +xml.c +) +FOREACH(_FILE ${_FILES}) + LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(UTIL_SRC ${_SOURCES} PARENT_SCOPE) +FOREACH(_FILE ${_TEST_FILES}) + LIST(APPEND _TESTS ${PROJECT_NAME}/${_FILE}) +ENDFOREACH(_FILE) +SET(UTIL_TESTS ${_TESTS} PARENT_SCOPE) diff --git a/core/src/util/attrib.c b/src/util/attrib.c similarity index 100% rename from core/src/util/attrib.c rename to src/util/attrib.c diff --git a/core/src/util/attrib.h b/src/util/attrib.h similarity index 100% rename from core/src/util/attrib.h rename to src/util/attrib.h diff --git a/core/src/util/base36.c b/src/util/base36.c similarity index 100% rename from core/src/util/base36.c rename to src/util/base36.c diff --git a/core/src/util/base36.h b/src/util/base36.h similarity index 100% rename from core/src/util/base36.h rename to src/util/base36.h diff --git a/core/src/util/base36_test.c b/src/util/base36_test.c similarity index 100% rename from core/src/util/base36_test.c rename to src/util/base36_test.c diff --git a/core/src/util/bool.h b/src/util/bool.h similarity index 100% rename from core/src/util/bool.h rename to src/util/bool.h diff --git a/core/src/util/bsdstring.c b/src/util/bsdstring.c similarity index 100% rename from core/src/util/bsdstring.c rename to src/util/bsdstring.c diff --git a/core/src/util/bsdstring.h b/src/util/bsdstring.h similarity index 100% rename from core/src/util/bsdstring.h rename to src/util/bsdstring.h diff --git a/core/src/util/bsdstring_test.c b/src/util/bsdstring_test.c similarity index 100% rename from core/src/util/bsdstring_test.c rename to src/util/bsdstring_test.c diff --git a/core/src/util/console.c b/src/util/console.c similarity index 100% rename from core/src/util/console.c rename to src/util/console.c diff --git a/core/src/util/console.h b/src/util/console.h similarity index 100% rename from core/src/util/console.h rename to src/util/console.h diff --git a/core/src/util/crmessage.c b/src/util/crmessage.c similarity index 100% rename from core/src/util/crmessage.c rename to src/util/crmessage.c diff --git a/core/src/util/crmessage.h b/src/util/crmessage.h similarity index 100% rename from core/src/util/crmessage.h rename to src/util/crmessage.h diff --git a/core/src/util/dice.c b/src/util/dice.c similarity index 100% rename from core/src/util/dice.c rename to src/util/dice.c diff --git a/core/src/util/encoding.h b/src/util/encoding.h similarity index 100% rename from core/src/util/encoding.h rename to src/util/encoding.h diff --git a/core/src/util/event.c b/src/util/event.c similarity index 100% rename from core/src/util/event.c rename to src/util/event.c diff --git a/core/src/util/event.h b/src/util/event.h similarity index 100% rename from core/src/util/event.h rename to src/util/event.h diff --git a/core/src/util/filereader.c b/src/util/filereader.c similarity index 100% rename from core/src/util/filereader.c rename to src/util/filereader.c diff --git a/core/src/util/filereader.h b/src/util/filereader.h similarity index 100% rename from core/src/util/filereader.h rename to src/util/filereader.h diff --git a/core/src/util/functions.c b/src/util/functions.c similarity index 100% rename from core/src/util/functions.c rename to src/util/functions.c diff --git a/core/src/util/functions.h b/src/util/functions.h similarity index 100% rename from core/src/util/functions.h rename to src/util/functions.h diff --git a/core/src/util/functions_test.c b/src/util/functions_test.c similarity index 100% rename from core/src/util/functions_test.c rename to src/util/functions_test.c diff --git a/core/src/util/goodies.c b/src/util/goodies.c similarity index 100% rename from core/src/util/goodies.c rename to src/util/goodies.c diff --git a/core/src/util/goodies.h b/src/util/goodies.h similarity index 100% rename from core/src/util/goodies.h rename to src/util/goodies.h diff --git a/core/src/util/language.c b/src/util/language.c similarity index 100% rename from core/src/util/language.c rename to src/util/language.c diff --git a/core/src/util/language.h b/src/util/language.h similarity index 100% rename from core/src/util/language.h rename to src/util/language.h diff --git a/core/src/util/language_struct.h b/src/util/language_struct.h similarity index 100% rename from core/src/util/language_struct.h rename to src/util/language_struct.h diff --git a/core/src/util/listbox.c b/src/util/listbox.c similarity index 100% rename from core/src/util/listbox.c rename to src/util/listbox.c diff --git a/core/src/util/listbox.h b/src/util/listbox.h similarity index 100% rename from core/src/util/listbox.h rename to src/util/listbox.h diff --git a/core/src/util/lists.c b/src/util/lists.c similarity index 100% rename from core/src/util/lists.c rename to src/util/lists.c diff --git a/core/src/util/lists.h b/src/util/lists.h similarity index 100% rename from core/src/util/lists.h rename to src/util/lists.h diff --git a/core/src/util/log.c b/src/util/log.c similarity index 100% rename from core/src/util/log.c rename to src/util/log.c diff --git a/core/src/util/log.h b/src/util/log.h similarity index 100% rename from core/src/util/log.h rename to src/util/log.h diff --git a/core/src/util/message.c b/src/util/message.c similarity index 100% rename from core/src/util/message.c rename to src/util/message.c diff --git a/core/src/util/message.h b/src/util/message.h similarity index 100% rename from core/src/util/message.h rename to src/util/message.h diff --git a/core/src/util/nrmessage.c b/src/util/nrmessage.c similarity index 100% rename from core/src/util/nrmessage.c rename to src/util/nrmessage.c diff --git a/core/src/util/nrmessage.h b/src/util/nrmessage.h similarity index 100% rename from core/src/util/nrmessage.h rename to src/util/nrmessage.h diff --git a/core/src/util/nrmessage_struct.h b/src/util/nrmessage_struct.h similarity index 100% rename from core/src/util/nrmessage_struct.h rename to src/util/nrmessage_struct.h diff --git a/core/src/util/parser.c b/src/util/parser.c similarity index 100% rename from core/src/util/parser.c rename to src/util/parser.c diff --git a/core/src/util/parser.h b/src/util/parser.h similarity index 100% rename from core/src/util/parser.h rename to src/util/parser.h diff --git a/core/src/util/rand.c b/src/util/rand.c similarity index 100% rename from core/src/util/rand.c rename to src/util/rand.c diff --git a/core/src/util/rand.h b/src/util/rand.h similarity index 100% rename from core/src/util/rand.h rename to src/util/rand.h diff --git a/core/src/util/resolve.c b/src/util/resolve.c similarity index 100% rename from core/src/util/resolve.c rename to src/util/resolve.c diff --git a/core/src/util/resolve.h b/src/util/resolve.h similarity index 100% rename from core/src/util/resolve.h rename to src/util/resolve.h diff --git a/core/src/util/rng.h b/src/util/rng.h similarity index 100% rename from core/src/util/rng.h rename to src/util/rng.h diff --git a/core/src/util/sql.c b/src/util/sql.c similarity index 100% rename from core/src/util/sql.c rename to src/util/sql.c diff --git a/core/src/util/sql.h b/src/util/sql.h similarity index 100% rename from core/src/util/sql.h rename to src/util/sql.h diff --git a/core/src/util/strings.c b/src/util/strings.c similarity index 100% rename from core/src/util/strings.c rename to src/util/strings.c diff --git a/core/src/util/translation.c b/src/util/translation.c similarity index 100% rename from core/src/util/translation.c rename to src/util/translation.c diff --git a/core/src/util/translation.h b/src/util/translation.h similarity index 100% rename from core/src/util/translation.h rename to src/util/translation.h diff --git a/core/src/util/umlaut.c b/src/util/umlaut.c similarity index 100% rename from core/src/util/umlaut.c rename to src/util/umlaut.c diff --git a/core/src/util/umlaut.h b/src/util/umlaut.h similarity index 100% rename from core/src/util/umlaut.h rename to src/util/umlaut.h diff --git a/core/src/util/umlaut_test.c b/src/util/umlaut_test.c similarity index 100% rename from core/src/util/umlaut_test.c rename to src/util/umlaut_test.c diff --git a/core/src/util/unicode.c b/src/util/unicode.c similarity index 100% rename from core/src/util/unicode.c rename to src/util/unicode.c diff --git a/core/src/util/unicode.h b/src/util/unicode.h similarity index 100% rename from core/src/util/unicode.h rename to src/util/unicode.h diff --git a/core/src/util/variant.h b/src/util/variant.h similarity index 100% rename from core/src/util/variant.h rename to src/util/variant.h diff --git a/core/src/util/xml.c b/src/util/xml.c similarity index 100% rename from core/src/util/xml.c rename to src/util/xml.c diff --git a/core/src/util/xml.h b/src/util/xml.h similarity index 100% rename from core/src/util/xml.h rename to src/util/xml.h diff --git a/core/src/gamecode/xmlreport.c b/src/xmlreport.c similarity index 100% rename from core/src/gamecode/xmlreport.c rename to src/xmlreport.c diff --git a/core/src/gamecode/xmlreport.h b/src/xmlreport.h similarity index 100% rename from core/src/gamecode/xmlreport.h rename to src/xmlreport.h