diff --git a/meson.build b/meson.build index 229e502..e8376b9 100644 --- a/meson.build +++ b/meson.build @@ -85,95 +85,23 @@ dependencies += [ sfml_window, lel_guecs ] -sources = [ - 'ai.cpp', - 'ai_debug.cpp', - 'animation.cpp', - 'autowalker.cpp', - 'backend.cpp', - 'battle.cpp', - 'boss/fight.cpp', - 'boss/system.cpp', - 'boss/ui.cpp', - 'camera.cpp', - 'combat.cpp', - 'components.cpp', - 'config.cpp', - 'dbc.cpp', - 'game_level.cpp', - 'goap.cpp', - 'gui/combat_ui.cpp', - 'gui/debug_ui.cpp', - 'gui/dnd_loot.cpp', - 'gui/event_router.cpp', - 'gui/fsm.cpp', - 'gui/guecstra.cpp', - 'gui/loot_ui.cpp', - 'gui/main_ui.cpp', - 'gui/map_view.cpp', - 'gui/mini_map.cpp', - 'gui/overlay_ui.cpp', - 'gui/ritual_ui.cpp', - 'gui/status_ui.cpp', - 'inventory.cpp', - 'lights.cpp', - 'map.cpp', - 'matrix.cpp', - 'maze.cpp', - 'palette.cpp', - 'pathing.cpp', - 'rand.cpp', - 'raycaster.cpp', - 'rituals.cpp', - 'scene.cpp', - 'shaders.cpp', - 'sound.cpp', - 'spatialmap.cpp', - 'stats.cpp', - 'storyboard/ui.cpp', - 'systems.cpp', - 'textures.cpp', - 'worldbuilder.cpp', - 'easing.cpp', -] +inc_dirs = include_directories('src') -executable('runtests', sources + [ - 'tests/ai.cpp', - 'tests/animation.cpp', - 'tests/base.cpp', - 'tests/battle.cpp', - 'tests/camera.cpp', - 'tests/components.cpp', - 'tests/config.cpp', - 'tests/dbc.cpp', - 'tests/dinkyecs.cpp', - 'tests/event_router.cpp', - 'tests/fsm.cpp', - 'tests/inventory.cpp', - 'tests/lighting.cpp', - 'tests/loot.cpp', - 'tests/map.cpp', - 'tests/matrix.cpp', - 'tests/mazes.cpp', - 'tests/palette.cpp', - 'tests/pathing.cpp', - 'tests/rituals.cpp', - 'tests/shaders.cpp', - 'tests/sound.cpp', - 'tests/spatialmap.cpp', - 'tests/stats.cpp', - 'tests/systems.cpp', - 'tests/textures.cpp', - ], +subdir('src') +subdir('tests') + +executable('runtests', sources + tests, cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies + [catch2]) executable('zedcaster', - sources + [ 'main.cpp' ], + sources + [ 'src/main.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) @@ -181,6 +109,7 @@ executable('arena', sources + [ 'tools/arena.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) @@ -188,6 +117,7 @@ executable('animator', sources + [ 'tools/animator.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) @@ -195,20 +125,22 @@ executable('storyboard', sources + [ 'tools/storyboard.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) executable('icongen', - [ 'palette.cpp', 'textures.cpp', 'config.cpp', 'dbc.cpp', 'tools/icongen.cpp' ], + sources + [ 'tools/icongen.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) executable('fragviewer', - [ 'textures.cpp', 'config.cpp', - 'dbc.cpp', 'tools/fragviewer.cpp' ], + sources + [ 'tools/fragviewer.cpp' ], cpp_args: cpp_args, link_args: link_args, + include_directories: inc_dirs, override_options: exe_defaults, dependencies: dependencies) diff --git a/ai.cpp b/src/ai.cpp similarity index 100% rename from ai.cpp rename to src/ai.cpp diff --git a/ai.hpp b/src/ai.hpp similarity index 100% rename from ai.hpp rename to src/ai.hpp diff --git a/ai_debug.cpp b/src/ai_debug.cpp similarity index 100% rename from ai_debug.cpp rename to src/ai_debug.cpp diff --git a/ai_debug.hpp b/src/ai_debug.hpp similarity index 100% rename from ai_debug.hpp rename to src/ai_debug.hpp diff --git a/animation.cpp b/src/animation.cpp similarity index 100% rename from animation.cpp rename to src/animation.cpp diff --git a/animation.hpp b/src/animation.hpp similarity index 100% rename from animation.hpp rename to src/animation.hpp diff --git a/autowalker.cpp b/src/autowalker.cpp similarity index 100% rename from autowalker.cpp rename to src/autowalker.cpp diff --git a/autowalker.hpp b/src/autowalker.hpp similarity index 100% rename from autowalker.hpp rename to src/autowalker.hpp diff --git a/backend.cpp b/src/backend.cpp similarity index 100% rename from backend.cpp rename to src/backend.cpp diff --git a/backend.hpp b/src/backend.hpp similarity index 100% rename from backend.hpp rename to src/backend.hpp diff --git a/battle.cpp b/src/battle.cpp similarity index 100% rename from battle.cpp rename to src/battle.cpp diff --git a/battle.hpp b/src/battle.hpp similarity index 100% rename from battle.hpp rename to src/battle.hpp diff --git a/boss/fight.cpp b/src/boss/fight.cpp similarity index 100% rename from boss/fight.cpp rename to src/boss/fight.cpp diff --git a/boss/fight.hpp b/src/boss/fight.hpp similarity index 100% rename from boss/fight.hpp rename to src/boss/fight.hpp diff --git a/boss/system.cpp b/src/boss/system.cpp similarity index 100% rename from boss/system.cpp rename to src/boss/system.cpp diff --git a/boss/system.hpp b/src/boss/system.hpp similarity index 100% rename from boss/system.hpp rename to src/boss/system.hpp diff --git a/boss/ui.cpp b/src/boss/ui.cpp similarity index 100% rename from boss/ui.cpp rename to src/boss/ui.cpp diff --git a/boss/ui.hpp b/src/boss/ui.hpp similarity index 100% rename from boss/ui.hpp rename to src/boss/ui.hpp diff --git a/camera.cpp b/src/camera.cpp similarity index 100% rename from camera.cpp rename to src/camera.cpp diff --git a/camera.hpp b/src/camera.hpp similarity index 100% rename from camera.hpp rename to src/camera.hpp diff --git a/combat.cpp b/src/combat.cpp similarity index 100% rename from combat.cpp rename to src/combat.cpp diff --git a/components.cpp b/src/components.cpp similarity index 100% rename from components.cpp rename to src/components.cpp diff --git a/components.hpp b/src/components.hpp similarity index 100% rename from components.hpp rename to src/components.hpp diff --git a/config.cpp b/src/config.cpp similarity index 100% rename from config.cpp rename to src/config.cpp diff --git a/config.hpp b/src/config.hpp similarity index 100% rename from config.hpp rename to src/config.hpp diff --git a/constants.hpp b/src/constants.hpp similarity index 100% rename from constants.hpp rename to src/constants.hpp diff --git a/dbc.cpp b/src/dbc.cpp similarity index 100% rename from dbc.cpp rename to src/dbc.cpp diff --git a/dbc.hpp b/src/dbc.hpp similarity index 100% rename from dbc.hpp rename to src/dbc.hpp diff --git a/dinkyecs.hpp b/src/dinkyecs.hpp similarity index 100% rename from dinkyecs.hpp rename to src/dinkyecs.hpp diff --git a/easing.cpp b/src/easing.cpp similarity index 100% rename from easing.cpp rename to src/easing.cpp diff --git a/easing.hpp b/src/easing.hpp similarity index 100% rename from easing.hpp rename to src/easing.hpp diff --git a/events.hpp b/src/events.hpp similarity index 100% rename from events.hpp rename to src/events.hpp diff --git a/game_level.cpp b/src/game_level.cpp similarity index 100% rename from game_level.cpp rename to src/game_level.cpp diff --git a/game_level.hpp b/src/game_level.hpp similarity index 100% rename from game_level.hpp rename to src/game_level.hpp diff --git a/goap.cpp b/src/goap.cpp similarity index 100% rename from goap.cpp rename to src/goap.cpp diff --git a/goap.hpp b/src/goap.hpp similarity index 100% rename from goap.hpp rename to src/goap.hpp diff --git a/gui/combat_ui.cpp b/src/gui/combat_ui.cpp similarity index 100% rename from gui/combat_ui.cpp rename to src/gui/combat_ui.cpp diff --git a/gui/combat_ui.hpp b/src/gui/combat_ui.hpp similarity index 100% rename from gui/combat_ui.hpp rename to src/gui/combat_ui.hpp diff --git a/gui/debug_ui.cpp b/src/gui/debug_ui.cpp similarity index 100% rename from gui/debug_ui.cpp rename to src/gui/debug_ui.cpp diff --git a/gui/debug_ui.hpp b/src/gui/debug_ui.hpp similarity index 100% rename from gui/debug_ui.hpp rename to src/gui/debug_ui.hpp diff --git a/gui/dnd_loot.cpp b/src/gui/dnd_loot.cpp similarity index 100% rename from gui/dnd_loot.cpp rename to src/gui/dnd_loot.cpp diff --git a/gui/dnd_loot.hpp b/src/gui/dnd_loot.hpp similarity index 100% rename from gui/dnd_loot.hpp rename to src/gui/dnd_loot.hpp diff --git a/gui/event_router.cpp b/src/gui/event_router.cpp similarity index 100% rename from gui/event_router.cpp rename to src/gui/event_router.cpp diff --git a/gui/event_router.hpp b/src/gui/event_router.hpp similarity index 100% rename from gui/event_router.hpp rename to src/gui/event_router.hpp diff --git a/gui/fsm.cpp b/src/gui/fsm.cpp similarity index 100% rename from gui/fsm.cpp rename to src/gui/fsm.cpp diff --git a/gui/fsm.hpp b/src/gui/fsm.hpp similarity index 100% rename from gui/fsm.hpp rename to src/gui/fsm.hpp diff --git a/gui/guecstra.cpp b/src/gui/guecstra.cpp similarity index 100% rename from gui/guecstra.cpp rename to src/gui/guecstra.cpp diff --git a/gui/guecstra.hpp b/src/gui/guecstra.hpp similarity index 100% rename from gui/guecstra.hpp rename to src/gui/guecstra.hpp diff --git a/gui/loot_ui.cpp b/src/gui/loot_ui.cpp similarity index 100% rename from gui/loot_ui.cpp rename to src/gui/loot_ui.cpp diff --git a/gui/loot_ui.hpp b/src/gui/loot_ui.hpp similarity index 100% rename from gui/loot_ui.hpp rename to src/gui/loot_ui.hpp diff --git a/gui/main_ui.cpp b/src/gui/main_ui.cpp similarity index 100% rename from gui/main_ui.cpp rename to src/gui/main_ui.cpp diff --git a/gui/main_ui.hpp b/src/gui/main_ui.hpp similarity index 100% rename from gui/main_ui.hpp rename to src/gui/main_ui.hpp diff --git a/gui/map_view.cpp b/src/gui/map_view.cpp similarity index 100% rename from gui/map_view.cpp rename to src/gui/map_view.cpp diff --git a/gui/map_view.hpp b/src/gui/map_view.hpp similarity index 100% rename from gui/map_view.hpp rename to src/gui/map_view.hpp diff --git a/gui/mini_map.cpp b/src/gui/mini_map.cpp similarity index 100% rename from gui/mini_map.cpp rename to src/gui/mini_map.cpp diff --git a/gui/mini_map.hpp b/src/gui/mini_map.hpp similarity index 100% rename from gui/mini_map.hpp rename to src/gui/mini_map.hpp diff --git a/gui/overlay_ui.cpp b/src/gui/overlay_ui.cpp similarity index 100% rename from gui/overlay_ui.cpp rename to src/gui/overlay_ui.cpp diff --git a/gui/overlay_ui.hpp b/src/gui/overlay_ui.hpp similarity index 100% rename from gui/overlay_ui.hpp rename to src/gui/overlay_ui.hpp diff --git a/gui/ritual_ui.cpp b/src/gui/ritual_ui.cpp similarity index 100% rename from gui/ritual_ui.cpp rename to src/gui/ritual_ui.cpp diff --git a/gui/ritual_ui.hpp b/src/gui/ritual_ui.hpp similarity index 100% rename from gui/ritual_ui.hpp rename to src/gui/ritual_ui.hpp diff --git a/gui/status_ui.cpp b/src/gui/status_ui.cpp similarity index 100% rename from gui/status_ui.cpp rename to src/gui/status_ui.cpp diff --git a/gui/status_ui.hpp b/src/gui/status_ui.hpp similarity index 100% rename from gui/status_ui.hpp rename to src/gui/status_ui.hpp diff --git a/inventory.cpp b/src/inventory.cpp similarity index 100% rename from inventory.cpp rename to src/inventory.cpp diff --git a/inventory.hpp b/src/inventory.hpp similarity index 100% rename from inventory.hpp rename to src/inventory.hpp diff --git a/json_mods.hpp b/src/json_mods.hpp similarity index 100% rename from json_mods.hpp rename to src/json_mods.hpp diff --git a/lights.cpp b/src/lights.cpp similarity index 100% rename from lights.cpp rename to src/lights.cpp diff --git a/lights.hpp b/src/lights.hpp similarity index 100% rename from lights.hpp rename to src/lights.hpp diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/map.cpp b/src/map.cpp similarity index 100% rename from map.cpp rename to src/map.cpp diff --git a/map.hpp b/src/map.hpp similarity index 100% rename from map.hpp rename to src/map.hpp diff --git a/matrix.cpp b/src/matrix.cpp similarity index 100% rename from matrix.cpp rename to src/matrix.cpp diff --git a/matrix.hpp b/src/matrix.hpp similarity index 100% rename from matrix.hpp rename to src/matrix.hpp diff --git a/maze.cpp b/src/maze.cpp similarity index 100% rename from maze.cpp rename to src/maze.cpp diff --git a/maze.hpp b/src/maze.hpp similarity index 100% rename from maze.hpp rename to src/maze.hpp diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..713c995 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,51 @@ +sources = files( + 'ai.cpp', + 'ai_debug.cpp', + 'animation.cpp', + 'autowalker.cpp', + 'backend.cpp', + 'battle.cpp', + 'boss/fight.cpp', + 'boss/system.cpp', + 'boss/ui.cpp', + 'camera.cpp', + 'combat.cpp', + 'components.cpp', + 'config.cpp', + 'dbc.cpp', + 'game_level.cpp', + 'goap.cpp', + 'gui/combat_ui.cpp', + 'gui/debug_ui.cpp', + 'gui/dnd_loot.cpp', + 'gui/event_router.cpp', + 'gui/fsm.cpp', + 'gui/guecstra.cpp', + 'gui/loot_ui.cpp', + 'gui/main_ui.cpp', + 'gui/map_view.cpp', + 'gui/mini_map.cpp', + 'gui/overlay_ui.cpp', + 'gui/ritual_ui.cpp', + 'gui/status_ui.cpp', + 'inventory.cpp', + 'lights.cpp', + 'map.cpp', + 'matrix.cpp', + 'maze.cpp', + 'palette.cpp', + 'pathing.cpp', + 'rand.cpp', + 'raycaster.cpp', + 'rituals.cpp', + 'scene.cpp', + 'shaders.cpp', + 'sound.cpp', + 'spatialmap.cpp', + 'stats.cpp', + 'storyboard/ui.cpp', + 'systems.cpp', + 'textures.cpp', + 'worldbuilder.cpp', + 'easing.cpp', +) diff --git a/palette.cpp b/src/palette.cpp similarity index 100% rename from palette.cpp rename to src/palette.cpp diff --git a/palette.hpp b/src/palette.hpp similarity index 100% rename from palette.hpp rename to src/palette.hpp diff --git a/pathing.cpp b/src/pathing.cpp similarity index 100% rename from pathing.cpp rename to src/pathing.cpp diff --git a/pathing.hpp b/src/pathing.hpp similarity index 100% rename from pathing.hpp rename to src/pathing.hpp diff --git a/point.hpp b/src/point.hpp similarity index 100% rename from point.hpp rename to src/point.hpp diff --git a/rand.cpp b/src/rand.cpp similarity index 100% rename from rand.cpp rename to src/rand.cpp diff --git a/rand.hpp b/src/rand.hpp similarity index 100% rename from rand.hpp rename to src/rand.hpp diff --git a/raycaster.cpp b/src/raycaster.cpp similarity index 100% rename from raycaster.cpp rename to src/raycaster.cpp diff --git a/raycaster.hpp b/src/raycaster.hpp similarity index 100% rename from raycaster.hpp rename to src/raycaster.hpp diff --git a/rituals.cpp b/src/rituals.cpp similarity index 100% rename from rituals.cpp rename to src/rituals.cpp diff --git a/rituals.hpp b/src/rituals.hpp similarity index 100% rename from rituals.hpp rename to src/rituals.hpp diff --git a/scene.cpp b/src/scene.cpp similarity index 100% rename from scene.cpp rename to src/scene.cpp diff --git a/scene.hpp b/src/scene.hpp similarity index 100% rename from scene.hpp rename to src/scene.hpp diff --git a/shaders.cpp b/src/shaders.cpp similarity index 100% rename from shaders.cpp rename to src/shaders.cpp diff --git a/shaders.hpp b/src/shaders.hpp similarity index 100% rename from shaders.hpp rename to src/shaders.hpp diff --git a/shiterator.hpp b/src/shiterator.hpp similarity index 100% rename from shiterator.hpp rename to src/shiterator.hpp diff --git a/simplefsm.hpp b/src/simplefsm.hpp similarity index 100% rename from simplefsm.hpp rename to src/simplefsm.hpp diff --git a/sound.cpp b/src/sound.cpp similarity index 100% rename from sound.cpp rename to src/sound.cpp diff --git a/sound.hpp b/src/sound.hpp similarity index 100% rename from sound.hpp rename to src/sound.hpp diff --git a/spatialmap.cpp b/src/spatialmap.cpp similarity index 100% rename from spatialmap.cpp rename to src/spatialmap.cpp diff --git a/spatialmap.hpp b/src/spatialmap.hpp similarity index 100% rename from spatialmap.hpp rename to src/spatialmap.hpp diff --git a/stats.cpp b/src/stats.cpp similarity index 100% rename from stats.cpp rename to src/stats.cpp diff --git a/stats.hpp b/src/stats.hpp similarity index 100% rename from stats.hpp rename to src/stats.hpp diff --git a/storyboard/ui.cpp b/src/storyboard/ui.cpp similarity index 100% rename from storyboard/ui.cpp rename to src/storyboard/ui.cpp diff --git a/storyboard/ui.hpp b/src/storyboard/ui.hpp similarity index 100% rename from storyboard/ui.hpp rename to src/storyboard/ui.hpp diff --git a/systems.cpp b/src/systems.cpp similarity index 100% rename from systems.cpp rename to src/systems.cpp diff --git a/systems.hpp b/src/systems.hpp similarity index 100% rename from systems.hpp rename to src/systems.hpp diff --git a/textures.cpp b/src/textures.cpp similarity index 100% rename from textures.cpp rename to src/textures.cpp diff --git a/textures.hpp b/src/textures.hpp similarity index 100% rename from textures.hpp rename to src/textures.hpp diff --git a/worldbuilder.cpp b/src/worldbuilder.cpp similarity index 100% rename from worldbuilder.cpp rename to src/worldbuilder.cpp diff --git a/worldbuilder.hpp b/src/worldbuilder.hpp similarity index 100% rename from worldbuilder.hpp rename to src/worldbuilder.hpp diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000..2a40bbd --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,28 @@ +tests = files( + 'ai.cpp', + 'animation.cpp', + 'base.cpp', + 'battle.cpp', + 'camera.cpp', + 'components.cpp', + 'config.cpp', + 'dbc.cpp', + 'dinkyecs.cpp', + 'event_router.cpp', + 'fsm.cpp', + 'inventory.cpp', + 'lighting.cpp', + 'loot.cpp', + 'map.cpp', + 'matrix.cpp', + 'mazes.cpp', + 'palette.cpp', + 'pathing.cpp', + 'rituals.cpp', + 'shaders.cpp', + 'sound.cpp', + 'spatialmap.cpp', + 'stats.cpp', + 'systems.cpp', + 'textures.cpp', +)