#pragma once #include "loader/loader.hpp" #include #include #include #include #include #include #include #include #include namespace floormat { struct anim_def; struct wall_info; struct ground_info; } 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); Trade::ImageData2D texture(StringView prefix, StringView filename) noexcept(false) override; // >-----> walls >-----> tsl::robin_map wall_atlas_map; std::vector wall_atlas_array; std::vector missing_wall_atlases; Pointer invalid_wall_atlas; std::shared_ptr wall_atlas(StringView name, loader_policy policy) override; ArrayView wall_atlas_list() override; void get_wall_atlas_list(); const wall_info& make_invalid_wall_atlas(); // >-----> tile >-----> tsl::robin_map ground_atlas_map; std::vector ground_atlas_array; std::vector missing_ground_atlases; Pointer invalid_ground_atlas; std::shared_ptr ground_atlas(StringView filename, loader_policy policy) noexcept(false) override; ArrayView ground_atlas_list() noexcept(false) override; void get_ground_atlas_list(); const ground_info& make_invalid_ground_atlas(); // >-----> anim >-----> tsl::robin_map> anim_atlas_map; std::vector anim_atlases; ArrayView anim_atlas_list() override; std::shared_ptr anim_atlas(StringView name, StringView dir) noexcept(false) override; static anim_def deserialize_anim(StringView filename); void get_anim_atlas_list(); // >-----> scenery >-----> std::vector sceneries_array; tsl::robin_map sceneries_map; ArrayView sceneries() override; const scenery_proto& scenery(StringView name) noexcept(false) override; void get_scenery_list(); // >-----> vobjs >-----> tsl::robin_map vobj_atlas_map; std::vector vobjs; std::shared_ptr make_vobj_anim_atlas(StringView name, StringView image_filename); const struct vobj_info& vobj(StringView name) override; ArrayView vobj_list() override; void get_vobj_list(); }; } // namespace floormat::loader_detail