diff options
54 files changed, 145 insertions, 147 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 00cf1df3..1a0221f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,11 +61,9 @@ if(NOT BOOTSTRAP_DEPENDS) if(MSVC) add_definitions(-FI"compat/prelude.hpp") else() - # GCC or Clang add_definitions(-include compat/prelude.hpp) endif() - add_definitions(-DGAME_PROJECT_NAME=floormat) add_subdirectory(src) add_subdirectory(draw) add_subdirectory(main) diff --git a/anim-crop-tool/atlas.cpp b/anim-crop-tool/atlas.cpp index 05575298..dcb8b636 100644 --- a/anim-crop-tool/atlas.cpp +++ b/anim-crop-tool/atlas.cpp @@ -5,7 +5,7 @@ #include <filesystem> #include <opencv2/imgcodecs.hpp> -using namespace Magnum::Examples::Serialize; +using namespace floormat::Serialize; void anim_atlas_row::add_entry(const anim_atlas_entry& x) { diff --git a/anim-crop-tool/atlas.hpp b/anim-crop-tool/atlas.hpp index be74b40a..32819a2e 100644 --- a/anim-crop-tool/atlas.hpp +++ b/anim-crop-tool/atlas.hpp @@ -7,7 +7,7 @@ namespace std::filesystem { class path; } -namespace Magnum::Examples::Serialize { +namespace floormat::Serialize { struct anim_frame; @@ -38,4 +38,4 @@ public: [[nodiscard]] bool dump(const std::filesystem::path& filename) const; }; -} // namespace Magnum::Examples::Serialize +} // namespace floormat::Serialize diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index a95d3bae..b268321e 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -28,7 +28,7 @@ using Corrade::Utility::Debug; using std::filesystem::path; -using namespace Magnum::Examples::Serialize; +using namespace floormat::Serialize; struct options { diff --git a/attic/hash.hpp b/attic/hash.hpp index 75eea7a9..c915ce95 100644 --- a/attic/hash.hpp +++ b/attic/hash.hpp @@ -2,7 +2,7 @@ #include <cstddef> #include <cstdint> -namespace Magnum::Examples { +namespace floormat { template<unsigned N = sizeof(std::size_t)*8> struct hash; @@ -22,4 +22,4 @@ struct hash<64> final { } }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/compat/assert.hpp b/compat/assert.hpp index 3b59fd56..860a9cde 100644 --- a/compat/assert.hpp +++ b/compat/assert.hpp @@ -4,7 +4,7 @@ #include <cstdio> #include <type_traits> -namespace Magnum::Examples::detail { +namespace floormat::detail { template<std::size_t N, std::size_t M, typename... Xs> constexpr void emit_debug(const char(&pfx)[M], const char(&fmt)[N], Xs... xs) noexcept @@ -35,14 +35,14 @@ constexpr inline void abort(const char (&fmt)[N], Xs... xs) noexcept } } -} // namespace Magnum::Examples::detail +} // namespace floormat::detail -#define ABORT(...) ::Magnum::Examples::detail::abort(__VA_ARGS__) +#define ABORT(...) ::floormat::detail::abort(__VA_ARGS__) #define ASSERT(...) \ do { \ if (!(__VA_ARGS__)) { \ - ::Magnum::Examples::detail:: \ + ::floormat::detail:: \ abort("assertion failed: '%s' in %s:%d", \ #__VA_ARGS__, __FILE__, __LINE__); \ } \ @@ -55,7 +55,7 @@ constexpr inline void abort(const char (&fmt)[N], Xs... xs) noexcept return (var); \ })() -#define WARN(...) ::Magnum::Examples::detail::emit_debug("warning: ", __VA_ARGS__) -#define ERR(...) ::Magnum::Examples::detail::emit_debug("error: ", __VA_ARGS__) -#define MESSAGE(...) ::Magnum::Examples::detail::emit_debug("", __VA_ARGS__) -#define DEBUG(...) ::Magnum::Examples::detail::emit_debug("", __VA_ARGS__) +#define WARN(...) ::floormat::detail::emit_debug("warning: ", __VA_ARGS__) +#define ERR(...) ::floormat::detail::emit_debug("error: ", __VA_ARGS__) +#define MESSAGE(...) ::floormat::detail::emit_debug("", __VA_ARGS__) +#define DEBUG(...) ::floormat::detail::emit_debug("", __VA_ARGS__) diff --git a/compat/enum-bitset.hpp b/compat/enum-bitset.hpp index bf705138..95c82ff7 100644 --- a/compat/enum-bitset.hpp +++ b/compat/enum-bitset.hpp @@ -1,7 +1,7 @@ #pragma once #include <bitset> -namespace Magnum::Examples { +namespace floormat { template<typename Enum> struct enum_bitset : std::bitset<(std::size_t)Enum::MAX> { @@ -14,4 +14,4 @@ struct enum_bitset : std::bitset<(std::size_t)Enum::MAX> { } }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/compat/prelude.hpp b/compat/prelude.hpp index 8b0387c5..077d5a75 100644 --- a/compat/prelude.hpp +++ b/compat/prelude.hpp @@ -1,6 +1,6 @@ #pragma once namespace Magnum {} -namespace GAME_PROJECT_NAME { +namespace floormat { using namespace ::Magnum; -} // namespace GAME_PROJECT_NAME +} // namespace floormat diff --git a/corrade b/corrade -Subproject 9e35d4eb31b60c8d0aaa2d0028eae469b59ed7b +Subproject 3f33f27ab203dfea755e97f7effadffe56dfc8a diff --git a/draw/floor-mesh.cpp b/draw/floor-mesh.cpp index 3698bc6e..da8fe7f2 100644 --- a/draw/floor-mesh.cpp +++ b/draw/floor-mesh.cpp @@ -5,7 +5,7 @@ #include "tile-atlas.hpp" #include <Magnum/GL/MeshView.h> -namespace Magnum::Examples { +namespace floormat { constexpr auto quad_index_count = 6; @@ -75,4 +75,4 @@ std::array<std::array<Vector3, 4>, TILE_COUNT> floor_mesh::make_position_array() return array; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/draw/floor-mesh.hpp b/draw/floor-mesh.hpp index fed5867c..f81a7593 100644 --- a/draw/floor-mesh.hpp +++ b/draw/floor-mesh.hpp @@ -8,7 +8,7 @@ #include <Magnum/GL/Mesh.h> #include <Magnum/GL/Buffer.h> -namespace Magnum::Examples { +namespace floormat { struct tile_shader; struct chunk; @@ -36,4 +36,4 @@ private: static void set_tile(quad_data& data, tile& x); }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/draw/wall-mesh.cpp b/draw/wall-mesh.cpp index d698b508..acd4ac75 100644 --- a/draw/wall-mesh.cpp +++ b/draw/wall-mesh.cpp @@ -5,7 +5,7 @@ #include <Magnum/GL/RectangleTexture.h> #include <Magnum/GL/MeshView.h> -namespace Magnum::Examples { +namespace floormat { constexpr auto quad_index_count = 6; @@ -90,4 +90,4 @@ std::array<std::array<Vector3, 4>, wall_mesh::COUNT> wall_mesh::make_position_ar return array; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/draw/wall-mesh.hpp b/draw/wall-mesh.hpp index 4a4e9615..364f3831 100644 --- a/draw/wall-mesh.hpp +++ b/draw/wall-mesh.hpp @@ -8,7 +8,7 @@ #include <Magnum/GL/Mesh.h> #include <Magnum/GL/Buffer.h> -namespace Magnum::Examples { +namespace floormat { struct tile_shader; struct chunk; @@ -40,4 +40,4 @@ private: static std::array<std::array<Vector3, 4>, COUNT> make_position_array(); }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/draw/wireframe-box.cpp b/draw/wireframe-box.cpp index c5e4d9ac..49606bd8 100644 --- a/draw/wireframe-box.cpp +++ b/draw/wireframe-box.cpp @@ -3,7 +3,7 @@ #include <Magnum/Math/Vector3.h> #include <Magnum/GL/Renderer.h> -namespace Magnum::Examples::wireframe { +namespace floormat::wireframe { box::box(Vector3 center, Vector3 size, float line_width) : center{center}, size{size}, line_width{line_width} @@ -50,4 +50,4 @@ box::index_array box::make_index_array() }}; } -} // namespace Magnum::Examples::wireframe +} // namespace floormat::wireframe diff --git a/draw/wireframe-box.hpp b/draw/wireframe-box.hpp index b5cc1688..998ad92c 100644 --- a/draw/wireframe-box.hpp +++ b/draw/wireframe-box.hpp @@ -2,7 +2,7 @@ #include <Magnum/Math/Vector3.h> #include <Magnum/GL/Mesh.h> -namespace Magnum::Examples::wireframe { +namespace floormat::wireframe { struct box final { @@ -24,4 +24,4 @@ private: float line_width = 2; }; -} // namespace Magnum::Examples::wireframe +} // namespace floormat::wireframe diff --git a/draw/wireframe-mesh.cpp b/draw/wireframe-mesh.cpp index 35103055..32aa72aa 100644 --- a/draw/wireframe-mesh.cpp +++ b/draw/wireframe-mesh.cpp @@ -9,7 +9,7 @@ #include <Magnum/PixelStorage.h> #include <Magnum/Trade/ImageData.h> -namespace Magnum::Examples::wireframe +namespace floormat::wireframe { GL::RectangleTexture mesh_base::make_constant_texture() @@ -48,4 +48,4 @@ void mesh_base::draw(tile_shader& shader) } -} // namespace Magnum::Examples::wireframe +} // namespace floormat::wireframe diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp index f9c5e369..3c0deb37 100644 --- a/draw/wireframe-mesh.hpp +++ b/draw/wireframe-mesh.hpp @@ -9,7 +9,7 @@ #include <Magnum/GL/Mesh.h> #include "Magnum/GL/RectangleTexture.h" -namespace Magnum::Examples { +namespace floormat { struct tile_shader; @@ -60,4 +60,4 @@ template <wireframe::traits T> void wireframe_mesh<T>::draw(tile_shader& shader, mesh_base::draw(shader); } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/draw/wireframe-quad.cpp b/draw/wireframe-quad.cpp index e167a074..56aa0845 100644 --- a/draw/wireframe-quad.cpp +++ b/draw/wireframe-quad.cpp @@ -2,7 +2,7 @@ #include <array> #include <Magnum/GL/Renderer.h> -namespace Magnum::Examples::wireframe { +namespace floormat::wireframe { quad::vertex_array quad::make_vertex_array() const { @@ -22,4 +22,4 @@ void quad::on_draw() const GL::Renderer::setLineWidth(line_width); } -} // namespace Magnum::Examples::wireframe +} // namespace floormat::wireframe diff --git a/draw/wireframe-quad.hpp b/draw/wireframe-quad.hpp index 28ab651a..c2679781 100644 --- a/draw/wireframe-quad.hpp +++ b/draw/wireframe-quad.hpp @@ -4,7 +4,7 @@ #include <Magnum/Math/Vector3.h> #include <Magnum/GL/Mesh.h> -namespace Magnum::Examples::wireframe { +namespace floormat::wireframe { struct quad final { @@ -25,4 +25,4 @@ private: float line_width; }; -} // namespace Magnum::Examples::wireframe +} // namespace floormat::wireframe diff --git a/magnum b/magnum -Subproject a55fe9db4de187f8192d4e329f376e9b4668a20 +Subproject 35c4cdb86558ab0073abe577b3b5314d1f93fd4 diff --git a/main/app.cpp b/main/app.cpp index 6d2474b4..cc5dbe78 100644 --- a/main/app.cpp +++ b/main/app.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include "compat/fpu.hpp" -namespace Magnum::Examples { +namespace floormat { app::app(const Arguments& arguments): Platform::Application{ @@ -28,4 +28,4 @@ void app::update(float dt) Platform::Sdl2Application::exit(0); } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/app.hpp b/main/app.hpp index 35fb9481..2303a8b8 100644 --- a/main/app.hpp +++ b/main/app.hpp @@ -14,7 +14,7 @@ #include <Magnum/GL/DebugOutput.h> #include <memory> -namespace Magnum::Examples { +namespace floormat { struct app final : Platform::Application { @@ -64,4 +64,4 @@ struct app final : Platform::Application Magnum::Timeline timeline; }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/camera.cpp b/main/camera.cpp index 2887d02f..c91a743e 100644 --- a/main/camera.cpp +++ b/main/camera.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include <Magnum/GL/DefaultFramebuffer.h> -namespace Magnum::Examples { +namespace floormat { void app::do_camera(float dt) { @@ -38,4 +38,4 @@ void app::viewportEvent(Platform::Sdl2Application::ViewportEvent& event) GL::defaultFramebuffer.setViewport({{}, event.windowSize()}); } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/debug.cpp b/main/debug.cpp index 46340db8..ebf3c124 100644 --- a/main/debug.cpp +++ b/main/debug.cpp @@ -2,7 +2,7 @@ #include <chrono> #include <Magnum/GL/Renderer.h> -namespace Magnum::Examples { +namespace floormat { using Feature = GL::Renderer::Feature; using Source = GL::DebugOutput::Source; @@ -79,4 +79,4 @@ void* app::register_debug_callback() return nullptr; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/keyboard.cpp b/main/keyboard.cpp index 14daa19c..50bc214a 100644 --- a/main/keyboard.cpp +++ b/main/keyboard.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -namespace Magnum::Examples { +namespace floormat { void app::do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated) { @@ -40,4 +40,4 @@ void app::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event) do_key(event.key(), event.modifiers(), false, false); } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/loader-impl.cpp b/main/loader-impl.cpp index aeefd081..ff1bb08f 100644 --- a/main/loader-impl.cpp +++ b/main/loader-impl.cpp @@ -16,7 +16,7 @@ #include <Magnum/Trade/ImageData.h> #include <Magnum/Trade/AbstractImageConverter.h> -namespace Magnum::Examples { +namespace floormat { struct loader_impl final : loader_ { @@ -117,4 +117,4 @@ static loader_& make_default_loader() // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) loader_& loader = make_default_loader(); -} // namespace Magnum::Examples +} // namespace floormat diff --git a/main/main.cpp b/main/main.cpp index c0e894be..62dd687c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -5,7 +5,7 @@ #include <Magnum/GL/Renderer.h> #include <Magnum/Trade/AbstractImporter.h> -namespace Magnum::Examples { +namespace floormat { chunk app::make_test_chunk() { @@ -82,9 +82,9 @@ void app::draw_wireframe_box() _wireframe_box.draw(_shader, {center2, size, LINE_WIDTH}); } -} // namespace Magnum::Examples +} // namespace floormat -MAGNUM_APPLICATION_MAIN(Magnum::Examples::app) +MAGNUM_APPLICATION_MAIN(floormat::app) #ifdef _MSC_VER #include <cstdlib> // for __arg{c,v} diff --git a/serialize/anim.cpp b/serialize/anim.cpp index 42ad1de2..0e3b371f 100644 --- a/serialize/anim.cpp +++ b/serialize/anim.cpp @@ -6,15 +6,15 @@ #include <Corrade/Utility/Debug.h> #include <Corrade/Utility/DebugStl.h> -namespace Magnum::Examples::Serialize { +namespace floormat::Serialize { NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_frame, ground, offset, size) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_group, name, frames, ground) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim, name, nframes, actionframe, fps, groups, width, height) -} // namespace Magnum::Examples::Serialize +} // namespace floormat::Serialize -using namespace Magnum::Examples::Serialize; +using namespace floormat::Serialize; namespace nlohmann { diff --git a/serialize/anim.hpp b/serialize/anim.hpp index 6a78f9dd..244799fb 100644 --- a/serialize/anim.hpp +++ b/serialize/anim.hpp @@ -10,7 +10,7 @@ namespace std::filesystem { class path; } -namespace Magnum::Examples::Serialize { +namespace floormat::Serialize { struct anim_frame final { @@ -41,26 +41,26 @@ struct anim final int actionframe = -1, fps = default_fps; }; -} // namespace Magnum::Examples::Serialize +} // namespace floormat::Serialize namespace nlohmann { template<> -struct adl_serializer<Magnum::Examples::Serialize::anim_frame> { - static void to_json(json& j, const Magnum::Examples::Serialize::anim_frame& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim_frame& val); +struct adl_serializer<floormat::Serialize::anim_frame> { + static void to_json(json& j, const floormat::Serialize::anim_frame& val); + static void from_json(const json& j, floormat::Serialize::anim_frame& val); }; template<> -struct adl_serializer<Magnum::Examples::Serialize::anim_group> { - static void to_json(json& j, const Magnum::Examples::Serialize::anim_group& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim_group& val); +struct adl_serializer<floormat::Serialize::anim_group> { + static void to_json(json& j, const floormat::Serialize::anim_group& val); + static void from_json(const json& j, floormat::Serialize::anim_group& val); }; template<> -struct adl_serializer<Magnum::Examples::Serialize::anim> { - static void to_json(json& j, const Magnum::Examples::Serialize::anim& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim& val); +struct adl_serializer<floormat::Serialize::anim> { + static void to_json(json& j, const floormat::Serialize::anim& val); + static void from_json(const json& j, floormat::Serialize::anim& val); }; } // namespace nlohmann diff --git a/serialize/tile-atlas.cpp b/serialize/tile-atlas.cpp index 8021f1d5..ab72fc43 100644 --- a/serialize/tile-atlas.cpp +++ b/serialize/tile-atlas.cpp @@ -7,12 +7,12 @@ #include <nlohmann/json.hpp> using namespace Magnum; -using namespace Magnum::Examples; +using namespace floormat; namespace nlohmann { using proxy_atlas = std::tuple<std::string, Vector2ui>; -using shared_atlas = std::shared_ptr<Magnum::Examples::tile_atlas>; +using shared_atlas = std::shared_ptr<floormat::tile_atlas>; void adl_serializer<shared_atlas>::to_json(json& j, const shared_atlas& x) { diff --git a/serialize/tile-atlas.hpp b/serialize/tile-atlas.hpp index 8dfa8c86..f4549d7c 100644 --- a/serialize/tile-atlas.hpp +++ b/serialize/tile-atlas.hpp @@ -2,14 +2,14 @@ #include <memory> #include <nlohmann/json_fwd.hpp> -namespace Magnum::Examples { struct tile_atlas; } +namespace floormat { struct tile_atlas; } namespace nlohmann { template<> -struct adl_serializer<std::shared_ptr<Magnum::Examples::tile_atlas>> final { - static void to_json(json& j, const std::shared_ptr<Magnum::Examples::tile_atlas>& x); - static void from_json(const json& j, std::shared_ptr<Magnum::Examples::tile_atlas>& x); +struct adl_serializer<std::shared_ptr<floormat::tile_atlas>> final { + static void to_json(json& j, const std::shared_ptr<floormat::tile_atlas>& x); + static void from_json(const json& j, std::shared_ptr<floormat::tile_atlas>& x); }; } // namespace nlohmann diff --git a/serialize/tile.cpp b/serialize/tile.cpp index a945f171..2e94bfb8 100644 --- a/serialize/tile.cpp +++ b/serialize/tile.cpp @@ -4,17 +4,17 @@ #include "serialize/tile-atlas.hpp" #include <nlohmann/json.hpp> -namespace Magnum::Examples { +namespace floormat { NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(tile_image, atlas, variant) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(tile, ground_image, wall_north, wall_west, passability) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(local_coords, x, y) -} // namespace Magnum::Examples +} // namespace floormat namespace nlohmann { -using namespace Magnum::Examples; +using namespace floormat; void adl_serializer<tile_image>::to_json(json& j, const tile_image& val) { using nlohmann::to_json; if (val.atlas) to_json(j, val); else j = nullptr; } void adl_serializer<tile_image>::from_json(const json& j, tile_image& val) { using nlohmann::from_json; from_json(j, val); } diff --git a/serialize/tile.hpp b/serialize/tile.hpp index f84ebd8d..318c86bb 100644 --- a/serialize/tile.hpp +++ b/serialize/tile.hpp @@ -1,37 +1,37 @@ #pragma once #include <nlohmann/json_fwd.hpp> -namespace Magnum::Examples { +namespace floormat { struct tile_image; struct tile; struct chunk; struct local_coords; -} // namespace Magnum::Examples +} // namespace floormat namespace nlohmann { template<> -struct adl_serializer<Magnum::Examples::tile_image> { - static void to_json(json& j, const Magnum::Examples::tile_image& val); - static void from_json(const json& j, Magnum::Examples::tile_image& val); +struct adl_serializer<floormat::tile_image> { + static void to_json(json& j, const floormat::tile_image& val); + static void from_json(const json& j, floormat::tile_image& val); }; template<> -struct adl_serializer<Magnum::Examples::tile> { - static void to_json(json& j, const Magnum::Examples::tile& val); - static void from_json(const json& j, Magnum::Examples::tile& val); +struct adl_serializer<floormat::tile> { + static void to_json(json& j, const floormat::tile& val); + static void from_json(const json& j, floormat::tile& val); }; template<> -struct adl_serializer<Magnum::Examples::chunk> { - static void to_json(json& j, const Magnum::Examples::chunk& val); - static void from_json(const json& j, Magnum::Examples::chunk& val); +struct adl_serializer<floormat::chunk> { + static void to_json(json& j, const floormat::chunk& val); + static void from_json(const json& j, floormat::chunk& val); }; template<> -struct adl_serializer<Magnum::Examples::local_coords> { - static void to_json(json& j, const Magnum::Examples::local_coords& val); - static void from_json(const json& j, Magnum::Examples::local_coords& val); +struct adl_serializer<floormat::local_coords> { + static void to_json(json& j, const floormat::local_coords& val); + static void from_json(const json& j, floormat::local_coords& val); }; } // namespace nlohmann diff --git a/shaders/tile-shader.cpp b/shaders/tile-shader.cpp index 4648b263..bf5038bc 100644 --- a/shaders/tile-shader.cpp +++ b/shaders/tile-shader.cpp @@ -8,7 +8,7 @@ #include <Magnum/GL/Shader.h> #include <Magnum/GL/Version.h> -namespace Magnum::Examples { +namespace floormat { tile_shader::tile_shader() { @@ -51,4 +51,4 @@ tile_shader& tile_shader::set_tint(const Vector4& tint) return *this; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/shaders/tile-shader.hpp b/shaders/tile-shader.hpp index c0f0c656..0e1e4442 100644 --- a/shaders/tile-shader.hpp +++ b/shaders/tile-shader.hpp @@ -4,7 +4,7 @@ #include <Magnum/Math/Vector3.h> #include <Magnum/Math/Vector4.h> -namespace Magnum::Examples { +namespace floormat { struct tile_shader : GL::AbstractShaderProgram { @@ -35,4 +35,4 @@ constexpr Vector2 tile_shader::project(const Vector3 pt) return { x-y, (x+y+z*2)*.75f }; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/chunk.cpp b/src/chunk.cpp index 221f8132..4537acec 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -1,5 +1,5 @@ #include "chunk.hpp" -namespace Magnum::Examples { +namespace floormat { -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/chunk.hpp b/src/chunk.hpp index 1a56b622..a20a12ce 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -4,7 +4,7 @@ #include <type_traits> #include <array> -namespace Magnum::Examples { +namespace floormat { template<typename F, typename Tile> concept tile_iterator_fn = requires(F fn, Tile& tile) { @@ -36,4 +36,4 @@ private: std::array<tile, TILE_COUNT> _tiles = {}; }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/loader.cpp b/src/loader.cpp index f6219350..c4329de3 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -1,6 +1,6 @@ #include "loader.hpp" -namespace Magnum::Examples { +namespace floormat { loader_::loader_() = default; loader_::~loader_() = default; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/loader.hpp b/src/loader.hpp index 49299bb6..6657439a 100644 --- a/src/loader.hpp +++ b/src/loader.hpp @@ -7,7 +7,7 @@ #include <optional> #include <memory> -namespace Magnum::Examples { +namespace floormat { struct tile_atlas; @@ -29,4 +29,4 @@ protected: extern loader_& loader; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/local-coords.hpp b/src/local-coords.hpp index 0d62103c..3bb2a33c 100644 --- a/src/local-coords.hpp +++ b/src/local-coords.hpp @@ -5,7 +5,7 @@ #include <Magnum/Magnum.h> #include <Magnum/Math/Vector3.h> -namespace Magnum::Examples { +namespace floormat { struct local_coords final { std::uint8_t x = 0, y = 0; @@ -29,4 +29,4 @@ constexpr local_coords::local_coords(std::size_t x, std::size_t y) noexcept ASSERT(x <= 0xff && y <= 0xff); } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile-atlas.cpp b/src/tile-atlas.cpp index 95e01bfa..dfb0b83c 100644 --- a/src/tile-atlas.cpp +++ b/src/tile-atlas.cpp @@ -4,7 +4,7 @@ #include <Magnum/ImageView.h> #include <Magnum/GL/TextureFormat.h> -namespace Magnum::Examples { +namespace floormat { tile_atlas::tile_atlas(Containers::StringView name, const ImageView2D& image, Vector2ui dims) : name_{name}, @@ -37,4 +37,4 @@ std::array<Vector2, 4> tile_atlas::texcoords_for_id(std::size_t id_) const }}; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile-atlas.hpp b/src/tile-atlas.hpp index af9e505b..81cfc857 100644 --- a/src/tile-atlas.hpp +++ b/src/tile-atlas.hpp @@ -6,7 +6,7 @@ namespace std::filesystem { class path; } -namespace Magnum::Examples { +namespace floormat { struct tile_atlas final { @@ -72,4 +72,4 @@ constexpr tile_atlas::quad tile_atlas::wall_quad_N(const Vector3 center, const V }}; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile-defs.hpp b/src/tile-defs.hpp index 05aaf82d..69827210 100644 --- a/src/tile-defs.hpp +++ b/src/tile-defs.hpp @@ -1,10 +1,10 @@ #pragma once #include <cstddef> -namespace Magnum::Examples { +namespace floormat { constexpr inline std::size_t TILE_MAX_DIM = 16; constexpr inline std::size_t TILE_COUNT = TILE_MAX_DIM*TILE_MAX_DIM; constexpr inline float TILE_SIZE[3] = { 64, 64, 64 }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile-iterator.cpp b/src/tile-iterator.cpp index 3e7586dd..97e34008 100644 --- a/src/tile-iterator.cpp +++ b/src/tile-iterator.cpp @@ -1,9 +1,9 @@ #include "tile-iterator.hpp" #include "tile.hpp" -namespace Magnum::Examples { +namespace floormat { template class basic_tile_iterator<tile>; template class basic_tile_iterator<const tile>; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile-iterator.hpp b/src/tile-iterator.hpp index ce4b645e..5ba4bb88 100644 --- a/src/tile-iterator.hpp +++ b/src/tile-iterator.hpp @@ -5,28 +5,28 @@ #include <utility> #include <type_traits> -namespace Magnum::Examples { +namespace floormat { struct tile; template<typename T> class basic_tile_iterator; template<typename T> struct tile_tuple; -} // namespace Magnum::Examples +} // namespace floormat namespace std { -template<typename T> struct tuple_size<Magnum::Examples::tile_tuple<T>> : std::integral_constant<std::size_t, 3> {}; +template<typename T> struct tuple_size<floormat::tile_tuple<T>> : std::integral_constant<std::size_t, 3> {}; -template<> struct tuple_element<0, Magnum::Examples::tile_tuple<Magnum::Examples::tile>> { using type = Magnum::Examples::tile&; }; -template<> struct tuple_element<0, Magnum::Examples::tile_tuple<const Magnum::Examples::tile>> { using type = const Magnum::Examples::tile&; }; -template<> struct tuple_element<0, const Magnum::Examples::tile_tuple<Magnum::Examples::tile>> { using type = const Magnum::Examples::tile&; }; +template<> struct tuple_element<0, floormat::tile_tuple<floormat::tile>> { using type = floormat::tile&; }; +template<> struct tuple_element<0, floormat::tile_tuple<const floormat::tile>> { using type = const floormat::tile&; }; +template<> struct tuple_element<0, const floormat::tile_tuple<floormat::tile>> { using type = const floormat::tile&; }; -template<typename T> struct tuple_element<1, Magnum::Examples::tile_tuple<T>> { using type = std::size_t; }; -template<typename T> struct tuple_element<2, Magnum::Examples::tile_tuple<T>> { using type = Magnum::Examples::local_coords; }; +template<typename T> struct tuple_element<1, floormat::tile_tuple<T>> { using type = std::size_t; }; +template<typename T> struct tuple_element<2, floormat::tile_tuple<T>> { using type = floormat::local_coords; }; } // namespace std -namespace Magnum::Examples { +namespace floormat { template<typename T> struct tile_tuple { @@ -59,9 +59,9 @@ protected: std::tuple<T*, std::size_t> data = {nullptr, 0}; }; -} // namespace Magnum::Examples +} // namespace floormat -namespace Magnum::Examples { +namespace floormat { template<typename T> class basic_tile_iterator final : private tile_tuple<T> { @@ -82,13 +82,13 @@ public: extern template class basic_tile_iterator<tile>; extern template class basic_tile_iterator<const tile>; -} // namespace Magnum::Examples +} // namespace floormat namespace std { template<typename Tile> -class iterator_traits<Magnum::Examples::basic_tile_iterator<Tile>> { - using T = Magnum::Examples::basic_tile_iterator<Tile>; +class iterator_traits<floormat::basic_tile_iterator<Tile>> { + using T = floormat::basic_tile_iterator<Tile>; public: using difference_type = std::ptrdiff_t; using value_type = T; diff --git a/src/tile.cpp b/src/tile.cpp index b1963415..82970c76 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1,5 +1,5 @@ #include "tile.hpp" -namespace Magnum::Examples { +namespace floormat { -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/tile.hpp b/src/tile.hpp index c6d4e73d..a58d129a 100644 --- a/src/tile.hpp +++ b/src/tile.hpp @@ -5,7 +5,7 @@ #include <cstdint> #include <memory> -namespace Magnum::Examples { +namespace floormat { struct tile_atlas; @@ -31,4 +31,4 @@ struct tile final DECLARE_DEPRECATED_COPY_ASSIGNMENT(tile); }; -} //namespace Magnum::Examples +} //namespace floormat diff --git a/src/world.cpp b/src/world.cpp index 2d19c7d2..3a04c4c7 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -1,6 +1,6 @@ #include "world.hpp" -namespace Magnum::Examples { +namespace floormat { static_assert(sizeof(decltype(local_coords::x))*8 == 8); static_assert(sizeof(decltype(chunk_coords::x))*8 == 16); @@ -9,5 +9,5 @@ static_assert(std::is_same_v<decltype(chunk_coords::x), decltype(chunk_coords::y static_assert(std::is_same_v<decltype(chunk_coords::x), decltype(chunk_coords::y)>); -} // namespace Magnum::Examples +} // namespace floormat diff --git a/src/world.hpp b/src/world.hpp index 99b984c2..0d28429e 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -2,7 +2,7 @@ #include "src/chunk.hpp" #include "compat/assert.hpp" -namespace Magnum::Examples { +namespace floormat { struct chunk_coords final { std::int16_t x = 0, y = 0; @@ -26,4 +26,4 @@ constexpr chunk_coords global_coords::local() const noexcept { return {x_, y_}; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/test/app.hpp b/test/app.hpp index a7bb7d8b..4647001e 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -1,7 +1,7 @@ #pragma once #include <Magnum/Magnum.h> #include <Magnum/Platform/WindowlessWglApplication.h> -namespace Magnum::Examples { +namespace floormat { struct app final : Platform::WindowlessWglApplication // NOLINT(cppcoreguidelines-virtual-class-destructor) { explicit app(const Arguments& arguments); @@ -11,4 +11,4 @@ struct app final : Platform::WindowlessWglApplication // NOLINT(cppcoreguideline static bool test_tile_iter(); static bool test_const_math(); }; -} // namespace Magnum::Examples +} // namespace floormat diff --git a/test/const-math.cpp b/test/const-math.cpp index 3f125a1f..1d07d08f 100644 --- a/test/const-math.cpp +++ b/test/const-math.cpp @@ -57,7 +57,7 @@ static constexpr void* compile_tests() return nullptr; } -namespace Magnum::Examples { +namespace floormat { bool app::test_const_math() { @@ -65,7 +65,7 @@ bool app::test_const_math() return true; } -} // namespace Magnum::Examples +} // namespace floormat #ifdef __GNUG__ # pragma GCC diagnostic pop diff --git a/test/json.cpp b/test/json.cpp index 46bdf528..31733101 100644 --- a/test/json.cpp +++ b/test/json.cpp @@ -9,7 +9,7 @@ #include "chunk.hpp" #include "loader.hpp" -namespace Magnum::Examples { +namespace floormat { static chunk make_test_chunk() { @@ -56,4 +56,4 @@ bool app::test_json() // NOLINT(readability-convert-member-functions-to-static) return ret; } -} // namespace Magnum::Examples +} // namespace floormat diff --git a/test/main.cpp b/test/main.cpp index 6dfe1f85..8e053d23 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -7,7 +7,7 @@ #include <Corrade/Utility/Path.h> #include <Magnum/Magnum.h> -namespace Magnum::Examples { +namespace floormat { app::app(const Arguments& arguments): Platform::WindowlessWglApplication{ @@ -31,11 +31,11 @@ int app::exec() return !ret; } -} // namespace Magnum::Examples +} // namespace floormat int main(int argc, char** argv) { - Magnum::Examples::app application{{argc, argv}}; + floormat::app application{{argc, argv}}; return application.exec(); } diff --git a/test/tile-iter.cpp b/test/tile-iter.cpp index 360b2319..3aeb3ba2 100644 --- a/test/tile-iter.cpp +++ b/test/tile-iter.cpp @@ -1,6 +1,6 @@ #include "app.hpp" #include "chunk.hpp" -namespace Magnum::Examples { +namespace floormat { static inline bool always_false() { @@ -47,5 +47,5 @@ bool app::test_tile_iter() // NOLINT(readability-function-size) return true; } -} // namespace Magnum::Examples +} // namespace floormat |