#pragma once #include "loader/loader.hpp" #include "compat/safe-ptr.hpp" #include "compat/borrowed-ptr-fwd.hpp" #include "atlas-loader-fwd.hpp" #include #include #include #include #include #include #include #include namespace floormat::loader_detail { struct loader_impl final : loader_ { explicit loader_impl(); ~loader_impl() override; // >-----> system >-----> String original_working_directory; void set_application_working_directory(); StringView startup_directory() noexcept override; static void system_init(); void destroy() override; static bool chdir(StringView pathname); // >-----> plugins >-----> Optional> importer_plugins; Containers::Pointer image_importer; Containers::Pointer tga_importer; void ensure_plugins(); // >-----> resources >-----> Optional shader_res; StringView shader(StringView filename) noexcept override; Trade::ImageData2D make_error_texture(Vector2ui size) override; Trade::ImageData2D make_error_texture(Vector2ui size, Vector4ub color) override; Trade::ImageData2D texture(StringView prefix, StringView filename) noexcept(false) override; // >-----> ground >-----> [[nodiscard]] static atlas_loader* make_ground_atlas_loader(); safe_ptr> _ground_loader{ make_ground_atlas_loader() }; const bptr& ground_atlas(StringView filename, loader_policy policy) noexcept(false) override; ArrayView ground_atlas_list() noexcept(false) override; const ground_cell& invalid_ground_atlas() override; bptr get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) override; // >-----> walls >-----> [[nodiscard]] static atlas_loader* make_wall_atlas_loader(); safe_ptr> _wall_loader{ make_wall_atlas_loader() }; const bptr& wall_atlas(StringView name, loader_policy policy) override; ArrayView wall_atlas_list() override; bptr get_wall_atlas(StringView filename) noexcept(false) override; const wall_cell& invalid_wall_atlas() override; // >-----> anim >-----> [[nodiscard]] static atlas_loader* make_anim_atlas_loader(); safe_ptr> _anim_loader{ make_anim_atlas_loader() }; ArrayView anim_atlas_list() override; bptr anim_atlas(StringView name, StringView dir, loader_policy policy) noexcept(false) override; const anim_cell& invalid_anim_atlas() override; bptr get_anim_atlas(StringView path) noexcept(false) override; // >-----> scenery >-----> [[nodiscard]] static atlas_loader* make_scenery_atlas_loader(); safe_ptr> _scenery_loader{ make_scenery_atlas_loader() }; ArrayView scenery_list() override; const struct scenery_proto& scenery(StringView name, loader_policy policy) override; const scenery_cell& invalid_scenery_atlas() override; struct scenery_proto get_scenery(StringView filename, const scenery_cell& c) noexcept(false) override; // >-----> vobjs >-----> tsl::robin_map vobj_atlas_map; std::vector vobjs; bptr make_vobj_anim_atlas(StringView name, StringView image_filename); const struct vobj_cell& vobj(StringView name) override; ArrayView vobj_list() override; void get_vobj_list(); }; } // namespace floormat::loader_detail