22
33#include < unordered_set>
44
5- #include < virtualFileSystem.h>
6- #include < virtualFileMountSystem.h>
7-
85#include < boost/detail/winapi/dll.hpp>
96#include < boost/dll/import.hpp>
107
118#include < spdlog/fmt/fmt.h>
129
10+ #include " render_pipeline/rpcore/mount_manager.hpp"
1311#include " render_pipeline/rpcore/render_pipeline.hpp"
1412#include " render_pipeline/rpcore/stage_manager.hpp"
1513#include " render_pipeline/rpcore/pluginbase/day_setting_types.hpp"
@@ -30,8 +28,6 @@ struct PluginManager::Impl
3028 /* * Internal method to load a plugin. */
3129 std::shared_ptr<BasePlugin> load_plugin (const std::string& plugin_id);
3230
33- std::string convert_to_physical_path (const Filename& path) const ;
34-
3531 PluginManager& self_;
3632 RenderPipeline& pipeline_;
3733 std::string plugin_dir_;
@@ -113,31 +109,6 @@ std::shared_ptr<BasePlugin> PluginManager::Impl::load_plugin(const std::string&
113109 // TODO: implement
114110}
115111
116- std::string PluginManager::Impl::convert_to_physical_path (const Filename& path) const
117- {
118- Filename plugin_dir_in_vfs (path);
119- plugin_dir_in_vfs.standardize ();
120-
121- VirtualFileSystem* vfs = VirtualFileSystem::get_global_ptr ();
122- for (int k=0 , k_end=vfs->get_num_mounts (); k < k_end; ++k)
123- {
124- const std::string mount_point = vfs->get_mount (k)->get_mount_point ().to_os_specific ();
125- const std::string plugin_dir_in_vfs_string = plugin_dir_in_vfs.to_os_specific ();
126-
127- // /{mount_point}/...
128- if (mount_point.substr (0 , 2 ) == std::string (" $$" ) && plugin_dir_in_vfs_string.find (mount_point) == 1 )
129- {
130- boost::filesystem::path physical_plugin_dir = DCAST (VirtualFileMountSystem, vfs->get_mount (k))->get_physical_filename ().to_os_specific ();
131- physical_plugin_dir /= plugin_dir_in_vfs_string.substr (1 +mount_point.length ());
132- return physical_plugin_dir.string ();
133- }
134- }
135-
136- self_.error (fmt::format (" Cannot convert to physical path from Panda Path ({})." , path.c_str ()));
137-
138- return " " ;
139- }
140-
141112// ************************************************************************************************
142113
143114PluginManager::PluginManager (RenderPipeline& pipeline): RPObject(" PluginManager" ), impl_(std::make_unique<Impl>(*this , pipeline))
@@ -199,7 +170,7 @@ void PluginManager::load_base_settings(const Filename& plugin_dir)
199170{
200171 trace (fmt::format (" Loading base setting from '{}'" , plugin_dir.c_str ()));
201172
202- impl_->plugin_dir_ = impl_-> convert_to_physical_path (plugin_dir);
173+ impl_->plugin_dir_ = MountManager:: convert_to_physical_path (plugin_dir);
203174 if (impl_->plugin_dir_ .empty ())
204175 {
205176 error (fmt::format (" Cannot find plugin directory ({})." , plugin_dir.c_str ()));
0 commit comments