#pragma once #include "loader/loader.hpp" #include #include #include #include #include #include #include #include #include namespace floormat { struct anim_def; struct wall_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(); 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, bool fail_ok = true) noexcept(false) override; // >-----> walls >-----> struct wall_index { uint32_t val = (uint32_t)-1; }; 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, bool fail_ok = true) override; ArrayView wall_atlas_list() override; void get_wall_atlas_list(); const wall_info& make_invalid_wall_atlas(); std::shared_ptr get_wall_atlas(StringView name, StringView path); // >-----> tile >-----> tsl::robin_map> tile_atlas_map; std::vector> tile_atlas_array; ArrayView> tile_atlases(StringView filename) noexcept(false) override; std::shared_ptr tile_atlas(StringView filename, Vector2ub size, pass_mode pass) noexcept(false) override; std::shared_ptr tile_atlas(StringView filename) noexcept(false) override; // >-----> 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