summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/loader.cpp6
-rw-r--r--src/loader.hpp36
-rw-r--r--src/precomp.hpp15
4 files changed, 11 insertions, 51 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ae5bfd02..5f73bfad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,12 +1,11 @@
-set(self ${PROJECT_NAME})
-file(GLOB sources "*.cpp" "../shaders/*.cpp" "../serialize/*.cpp" "../draw/*.cpp" CONFIGURE_ARGS)
+set(self floormat)
+file(GLOB sources "*.cpp" "../shaders/*.cpp" CONFIGURE_ARGS)
add_library(${self} STATIC "${sources}")
target_link_libraries(
${self} PUBLIC
Magnum::GL
Magnum::Magnum
Magnum::Shaders
- nlohmann_json::nlohmann_json
)
if(FLOORMAT_PRECOMPILED-HEADERS)
target_precompile_headers(${self} PRIVATE precomp.hpp)
diff --git a/src/loader.cpp b/src/loader.cpp
deleted file mode 100644
index c4329de3..00000000
--- a/src/loader.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "loader.hpp"
-
-namespace floormat {
-loader_::loader_() = default;
-loader_::~loader_() = default;
-} // namespace floormat
diff --git a/src/loader.hpp b/src/loader.hpp
deleted file mode 100644
index 32158675..00000000
--- a/src/loader.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-#include <memory>
-#include <Corrade/Containers/ArrayView.h>
-#include <Corrade/Containers/StringView.h>
-#include <Magnum/Trade/ImageData.h>
-
-#define FM_IMAGE_PATH "share/floormat/images/"
-#define FM_ANIM_PATH "share/floormat/anim/"
-
-namespace floormat {
-
-struct tile_atlas;
-struct anim_atlas;
-
-struct loader_
-{
- virtual StringView shader(StringView filename) = 0;
- virtual std::shared_ptr<struct tile_atlas> tile_atlas(StringView filename, Vector2ub size) = 0;
- virtual ArrayView<String> anim_atlas_list() = 0;
- virtual std::shared_ptr<struct anim_atlas> anim_atlas(StringView name) = 0;
- static void destroy();
- static loader_& default_loader() noexcept;
-
- loader_(const loader_&) = delete;
- loader_& operator=(const loader_&) = delete;
-
- virtual ~loader_();
-
-protected:
- loader_();
-};
-
-extern loader_& loader; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
-
-} // namespace floormat
diff --git a/src/precomp.hpp b/src/precomp.hpp
index 9cdc85d6..5ec01fe0 100644
--- a/src/precomp.hpp
+++ b/src/precomp.hpp
@@ -10,10 +10,12 @@
#endif
#include <bit>
+#include <cerrno>
#include <cstddef>
#include <cstdint>
-#include <cstdio>
+#include <cstring>
#include <cmath>
+#include <cstdio>
#include <concepts>
#include <iterator>
@@ -31,13 +33,16 @@
#include <unordered_map>
#include <Corrade/Containers/Array.h>
-#include <Corrade/Containers/ArrayView.h>
-#include <Corrade/Containers/StringView.h>
+#include <Corrade/Containers/ArrayViewStl.h>
+#include <Corrade/Containers/EnumSet.h>
#include <Corrade/Containers/OptionalStl.h>
#include <Corrade/Containers/Pointer.h>
-#include <Corrade/Containers/ArrayViewStl.h> // TODO maybe remove stl
+#include <Corrade/Containers/StringStl.h>
#include <Corrade/Containers/StringStlHash.h>
+
#include <Corrade/Utility/DebugStl.h>
+#include <Corrade/Utility/Resource.h>
+#include <Corrade/Utility/Path.h>
#include <Magnum/Magnum.h>
#include <Magnum/Math/Vector2.h>
@@ -50,5 +55,3 @@
#include <Magnum/GL/Renderer.h>
#include <Magnum/GL/Texture.h>
#include <Magnum/Trade/ImageData.h>
-
-#include <nlohmann/json.hpp>