Compare commits

..

2 commits

4 changed files with 27 additions and 66 deletions

View file

@ -76,6 +76,11 @@ sfml_system = subproject('sfml').get_variable('sfml_system_dep')
sfml_window = subproject('sfml').get_variable('sfml_window_dep') sfml_window = subproject('sfml').get_variable('sfml_window_dep')
lel_guecs = subproject('lel-guecs').get_variable('lel_guecs_dep') lel_guecs = subproject('lel-guecs').get_variable('lel_guecs_dep')
inc_dirs = include_directories('src')
subdir('src')
subdir('tests')
dependencies += [ dependencies += [
fmt, json, freetype2, fmt, json, freetype2,
flac, ogg, vorbis, vorbisfile, vorbisenc, flac, ogg, vorbis, vorbisfile, vorbisenc,
@ -84,10 +89,18 @@ dependencies += [
sfml_window, lel_guecs sfml_window, lel_guecs
] ]
inc_dirs = include_directories('src') caster_lib = static_library('caster',
sources,
cpp_args: cpp_args,
include_directories: inc_dirs,
override_options: exe_defaults,
dependencies: dependencies)
subdir('src') caster_dep = declare_dependency(
subdir('tests') link_with: caster_lib,
include_directories: inc_dirs)
dependencies += [ caster_dep ]
executable('runtests', sources + tests, executable('runtests', sources + tests,
cpp_args: cpp_args, cpp_args: cpp_args,
@ -97,7 +110,7 @@ executable('runtests', sources + tests,
dependencies: dependencies + [catch2]) dependencies: dependencies + [catch2])
executable('zedcaster', executable('zedcaster',
sources + [ 'src/main.cpp' ], [ 'src/main.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,
@ -105,7 +118,7 @@ executable('zedcaster',
dependencies: dependencies) dependencies: dependencies)
executable('arena', executable('arena',
arena_sources + [ 'tools/arena.cpp' ], [ 'tools/arena.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,
@ -113,7 +126,7 @@ executable('arena',
dependencies: dependencies) dependencies: dependencies)
executable('animator', executable('animator',
sources + [ 'tools/animator.cpp' ], [ 'tools/animator.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,
@ -121,7 +134,7 @@ executable('animator',
dependencies: dependencies) dependencies: dependencies)
executable('storyboard', executable('storyboard',
sources + [ 'tools/storyboard.cpp' ], [ 'tools/storyboard.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,
@ -129,7 +142,7 @@ executable('storyboard',
dependencies: dependencies) dependencies: dependencies)
executable('icongen', executable('icongen',
sources + [ 'tools/icongen.cpp' ], [ 'tools/icongen.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,
@ -137,7 +150,7 @@ executable('icongen',
dependencies: dependencies) dependencies: dependencies)
executable('fragviewer', executable('fragviewer',
sources + [ 'tools/fragviewer.cpp' ], [ 'tools/fragviewer.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,
include_directories: inc_dirs, include_directories: inc_dirs,

View file

@ -65,7 +65,7 @@ namespace ai {
AIMGR.profile = json({}); AIMGR.profile = json({});
} }
void init(std::string config_path) { void init(const std::string& config_path) {
if(!initialized) { if(!initialized) {
auto config = settings::get(config_path); auto config = settings::get(config_path);
@ -106,7 +106,9 @@ namespace ai {
} }
initialized = true; initialized = true;
} else { } else {
dbc::sentinel("DOUBLE INIT: AI manager should only be intialized once if not in tests."); // 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));
} }
} }

View file

@ -46,7 +46,7 @@ namespace ai {
/* This is really only used in test to load different fixtures. */ /* This is really only used in test to load different fixtures. */
void reset(); void reset();
void init(std::string config_path); void init(const std::string& config_path);
Action config_action(AIProfile& profile, nlohmann::json& config); Action config_action(AIProfile& profile, nlohmann::json& config);
State config_state(AIProfile& profile, nlohmann::json& config); State config_state(AIProfile& profile, nlohmann::json& config);

View file

@ -66,57 +66,3 @@ sources = files(
# root # root
'dbc.cpp', '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',
)