#pragma once #include "src/pass-mode.hpp" #include #include #include #if defined _WIN32 && !defined FILENAME_MAX #define FILENAME_MAX 260 #endif namespace Magnum { using Vector2ub = Math::Vector2; } namespace floormat { struct serialized_scenery; } namespace Magnum::Trade { template class ImageData; using ImageData2D = ImageData<2>; } // namespace Magnum::Trade namespace floormat { struct tile_atlas; struct anim_atlas; struct scenery_proto; struct vobj_info; struct loader_ { virtual StringView shader(StringView filename) noexcept = 0; virtual Trade::ImageData2D texture(StringView prefix, StringView filename) noexcept(false) = 0; virtual std::shared_ptr tile_atlas(StringView filename, Vector2ub size, Optional pass) noexcept(false) = 0; virtual std::shared_ptr tile_atlas(StringView filename) noexcept(false) = 0; virtual ArrayView anim_atlas_list() = 0; virtual std::shared_ptr anim_atlas(StringView name, StringView dir = ANIM_PATH) noexcept(false) = 0; static void destroy(); static loader_& default_loader() noexcept; static std::vector> tile_atlases(StringView filename, pass_mode p); virtual const std::vector& 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 vobj_list() = 0; static StringView make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, StringView name); loader_(const loader_&) = delete; loader_& operator=(const loader_&) = delete; virtual ~loader_(); static const StringView IMAGE_PATH; static const StringView ANIM_PATH; static const StringView SCENERY_PATH; static const StringView TEMP_PATH; static const StringView VOBJ_PATH; protected: loader_(); }; extern loader_& loader; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) } // namespace floormat