Compare commits

..

No commits in common. "da7f24c126bf80a61094f148f0a1936dcc06daf9" and "f0b04107ab729e29b988f4a2fc787d00eed690ef" have entirely different histories.

4 changed files with 66 additions and 27 deletions

View file

@ -76,11 +76,6 @@ 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,
@ -89,18 +84,10 @@ dependencies += [
sfml_window, lel_guecs sfml_window, lel_guecs
] ]
caster_lib = static_library('caster', inc_dirs = include_directories('src')
sources,
cpp_args: cpp_args,
include_directories: inc_dirs,
override_options: exe_defaults,
dependencies: dependencies)
caster_dep = declare_dependency( subdir('src')
link_with: caster_lib, subdir('tests')
include_directories: inc_dirs)
dependencies += [ caster_dep ]
executable('runtests', sources + tests, executable('runtests', sources + tests,
cpp_args: cpp_args, cpp_args: cpp_args,
@ -110,7 +97,7 @@ executable('runtests', sources + tests,
dependencies: dependencies + [catch2]) dependencies: dependencies + [catch2])
executable('zedcaster', executable('zedcaster',
[ 'src/main.cpp' ], sources + [ '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,
@ -118,7 +105,7 @@ executable('zedcaster',
dependencies: dependencies) dependencies: dependencies)
executable('arena', executable('arena',
[ 'tools/arena.cpp' ], arena_sources + [ '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,
@ -126,7 +113,7 @@ executable('arena',
dependencies: dependencies) dependencies: dependencies)
executable('animator', executable('animator',
[ 'tools/animator.cpp' ], sources + [ '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,
@ -134,7 +121,7 @@ executable('animator',
dependencies: dependencies) dependencies: dependencies)
executable('storyboard', executable('storyboard',
[ 'tools/storyboard.cpp' ], sources + [ '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,
@ -142,7 +129,7 @@ executable('storyboard',
dependencies: dependencies) dependencies: dependencies)
executable('icongen', executable('icongen',
[ 'tools/icongen.cpp' ], sources + [ '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,
@ -150,7 +137,7 @@ executable('icongen',
dependencies: dependencies) dependencies: dependencies)
executable('fragviewer', executable('fragviewer',
[ 'tools/fragviewer.cpp' ], sources + [ '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(const std::string& config_path) { void init(std::string config_path) {
if(!initialized) { if(!initialized) {
auto config = settings::get(config_path); auto config = settings::get(config_path);
@ -106,9 +106,7 @@ namespace ai {
} }
initialized = true; initialized = true;
} else { } else {
// BUG: should track the inits per file, or create a separate init that's an overload of the default dbc::sentinel("DOUBLE INIT: AI manager should only be intialized once if not in tests.");
// 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(const std::string& config_path); void init(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,3 +66,57 @@ 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',
)