summaryrefslogtreecommitdiffhomepage
path: root/loader/loader.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-07 23:38:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-08 08:43:49 +0100
commita6514d1a95d0f84f0935866215463ef6aed23e19 (patch)
tree639075646b1ea42a3cd4a76ae59af7dda0c4b14a /loader/loader.hpp
parent4575194adb4615deeca174044a872093c3664ad4 (diff)
loader: work toward removing duplicate atlas code
Diffstat (limited to 'loader/loader.hpp')
-rw-r--r--loader/loader.hpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/loader/loader.hpp b/loader/loader.hpp
index 96ab57ed..faa0269a 100644
--- a/loader/loader.hpp
+++ b/loader/loader.hpp
@@ -2,27 +2,26 @@
#include "compat/defs.hpp"
#include "src/pass-mode.hpp"
#include "loader/policy.hpp"
-#include <stdio.h> // NOLINT(*-deprecated-headers)
#include <memory>
#include <Corrade/Containers/String.h>
-namespace Magnum { using Vector2ub = Math::Vector2<unsigned char>; }
-namespace floormat { struct serialized_scenery; }
-namespace Magnum::Trade {
-template<uint32_t> class ImageData;
-using ImageData2D = ImageData<2>;
-} // namespace Magnum::Trade
+//namespace Magnum { using Vector2ub = Math::Vector2<unsigned char>; }
+namespace Magnum::Trade { template<uint32_t> class ImageData; using ImageData2D = ImageData<2>; }
namespace floormat {
+struct serialized_scenery;
+namespace loader_detail {}
+namespace Serialize {}
+
struct anim_def;
class anim_atlas;
-struct anim_info;
+struct anim_cell;
struct scenery_proto;
struct vobj_info;
class ground_atlas;
-struct ground_info;
-struct wall_info;
+struct ground_cell;
+struct wall_cell;
class wall_atlas;
struct scenery_proto;
@@ -35,27 +34,28 @@ struct vobj_info final
struct loader_
{
virtual StringView shader(StringView filename) noexcept = 0;
+ virtual Trade::ImageData2D make_error_texture(Vector2ui size) = 0;
virtual Trade::ImageData2D texture(StringView prefix, StringView filename) noexcept(false) = 0;
- virtual std::shared_ptr<class ground_atlas> ground_atlas(StringView filename, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0;
+ virtual const std::shared_ptr<class ground_atlas>& ground_atlas(StringView filename, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0;
virtual ArrayView<const String> anim_atlas_list() = 0;
virtual std::shared_ptr<class anim_atlas> anim_atlas(StringView name, StringView dir = ANIM_PATH, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0;
virtual std::shared_ptr<class wall_atlas> wall_atlas(StringView name, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0;
- virtual ArrayView<const wall_info> wall_atlas_list() = 0;
+ virtual ArrayView<const wall_cell> wall_atlas_list() = 0;
virtual void destroy() = 0;
static loader_& default_loader() noexcept;
- virtual ArrayView<const ground_info> ground_atlas_list() noexcept(false) = 0; // todo maybe try returning
+ virtual ArrayView<const ground_cell> ground_atlas_list() noexcept(false) = 0; // todo maybe try returning
virtual ArrayView<const serialized_scenery> sceneries() = 0;
virtual const scenery_proto& scenery(StringView name) noexcept(false) = 0;
virtual StringView startup_directory() noexcept = 0;
static StringView strip_prefix(StringView name);
virtual const vobj_info& vobj(StringView name) = 0;
virtual ArrayView<const struct vobj_info> vobj_list() = 0;
- static StringView make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, StringView name);
+ static StringView make_atlas_path(char(&buf)[fm_FILENAME_MAX], StringView dir, StringView name);
[[nodiscard]] static bool check_atlas_name(StringView name) noexcept;
- virtual const wall_info& make_invalid_wall_atlas() = 0;
- virtual const ground_info& make_invalid_ground_atlas() = 0;
- virtual const anim_info& make_invalid_anim_atlas() = 0;
+ virtual const wall_cell& make_invalid_wall_atlas() = 0;
+ virtual const ground_cell& make_invalid_ground_atlas() = 0;
+ virtual const anim_cell& make_invalid_anim_atlas() = 0;
/** \deprecated{internal use only}*/ [[nodiscard]]
std::shared_ptr<class ground_atlas> get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false);