diff --git a/meson.build b/meson.build index b3078a7..f0866d4 100644 --- a/meson.build +++ b/meson.build @@ -76,11 +76,6 @@ sfml_system = subproject('sfml').get_variable('sfml_system_dep') sfml_window = subproject('sfml').get_variable('sfml_window_dep') lel_guecs = subproject('lel-guecs').get_variable('lel_guecs_dep') -inc_dirs = include_directories('src') - -subdir('src') -subdir('tests') - dependencies += [ fmt, json, freetype2, flac, ogg, vorbis, vorbisfile, vorbisenc, @@ -89,18 +84,10 @@ dependencies += [ sfml_window, lel_guecs ] -caster_lib = static_library('caster', - sources, - cpp_args: cpp_args, - include_directories: inc_dirs, - override_options: exe_defaults, - dependencies: dependencies) +inc_dirs = include_directories('src') -caster_dep = declare_dependency( - link_with: caster_lib, - include_directories: inc_dirs) - -dependencies += [ caster_dep ] +subdir('src') +subdir('tests') executable('runtests', sources + tests, cpp_args: cpp_args, @@ -110,7 +97,7 @@ executable('runtests', sources + tests, dependencies: dependencies + [catch2]) executable('zedcaster', - [ 'src/main.cpp' ], + sources + [ 'src/main.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, @@ -118,7 +105,7 @@ executable('zedcaster', dependencies: dependencies) executable('arena', - [ 'tools/arena.cpp' ], + arena_sources + [ 'tools/arena.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, @@ -126,7 +113,7 @@ executable('arena', dependencies: dependencies) executable('animator', - [ 'tools/animator.cpp' ], + sources + [ 'tools/animator.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, @@ -134,7 +121,7 @@ executable('animator', dependencies: dependencies) executable('storyboard', - [ 'tools/storyboard.cpp' ], + sources + [ 'tools/storyboard.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, @@ -142,7 +129,7 @@ executable('storyboard', dependencies: dependencies) executable('icongen', - [ 'tools/icongen.cpp' ], + sources + [ 'tools/icongen.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, @@ -150,7 +137,7 @@ executable('icongen', dependencies: dependencies) executable('fragviewer', - [ 'tools/fragviewer.cpp' ], + sources + [ 'tools/fragviewer.cpp' ], cpp_args: cpp_args, link_args: link_args, include_directories: inc_dirs, diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index 1df9c07..132d2f0 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -65,7 +65,7 @@ namespace ai { AIMGR.profile = json({}); } - void init(const std::string& config_path) { + void init(std::string config_path) { if(!initialized) { auto config = settings::get(config_path); @@ -106,9 +106,7 @@ namespace ai { } initialized = true; } else { - // BUG: should track the inits per file, or create a separate init that's an overload of the default - // then this version is just used in tests - dbc::sentinel($F("DOUBLE INIT {}: AI manager should only be intialized once if not in tests.", config_path)); + dbc::sentinel("DOUBLE INIT: AI manager should only be intialized once if not in tests."); } } diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index fcf007c..3e0fd81 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -46,7 +46,7 @@ namespace ai { /* This is really only used in test to load different fixtures. */ void reset(); - void init(const std::string& config_path); + void init(std::string config_path); Action config_action(AIProfile& profile, nlohmann::json& config); State config_state(AIProfile& profile, nlohmann::json& config); diff --git a/src/meson.build b/src/meson.build index 0afa78f..dfc953c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -66,3 +66,57 @@ sources = files( # root 'dbc.cpp', ) + +arena_sources = files( + # ai + 'ai/ai.cpp', + 'ai/ai_debug.cpp', + 'ai/goap.cpp', + + # combat + 'combat/battle.cpp', + 'combat/combat.cpp', + + # boss fight mini game + 'boss/fight.cpp', + 'boss/system.cpp', + 'boss/ui.cpp', + + # gui + 'gui/backend.cpp', + 'gui/combat_ui.cpp', + 'gui/debug_ui.cpp', + 'gui/event_router.cpp', + 'gui/guecstra.cpp', + + # graphics + 'graphics/animation.cpp', + 'graphics/camera.cpp', + 'graphics/easing.cpp', + 'graphics/palette.cpp', + 'graphics/scene.cpp', + 'graphics/shaders.cpp', + 'graphics/textures.cpp', + 'graphics/lights.cpp', + + # algos + 'algos/matrix.cpp', + 'algos/maze.cpp', + 'algos/spatialmap.cpp', + 'algos/rand.cpp', + 'algos/pathing.cpp', + + # game + 'game/worldbuilder.cpp', + 'game/map.cpp', + 'game/level.cpp', + 'game/inventory.cpp', + 'game/sound.cpp', + 'game/systems.cpp', + 'game/components.cpp', + 'game/config.cpp', + 'game/rituals.cpp', + + # root + 'dbc.cpp', +)