Changeset 5626 for code/branches/libraries/src
- Timestamp:
- Aug 11, 2009, 10:22:55 PM (15 years ago)
- Location:
- code/branches/libraries/src
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libraries/src/SpecialConfig.h.in
r5625 r5626 87 87 const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE); 88 88 #else 89 const char ORXONOX_PLUGIN_DEV_PATH[] = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@"; 89 90 const char ORXONOX_CONFIG_DEV_PATH[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@"; 90 91 const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@"; -
code/branches/libraries/src/core/CMakeLists.txt
r3370 r5626 23 23 ConfigValueContainer.cc 24 24 Core.cc 25 DynLib.cc 26 DynLibManager.cc 25 27 Event.cc 26 28 Game.cc -
code/branches/libraries/src/core/Core.cc
r5625 r5626 40 40 #include <cstdlib> 41 41 #include <cstdio> 42 #include <boost/version.hpp> 42 43 #include <boost/filesystem.hpp> 43 44 #include <OgreRenderWindow.h> … … 68 69 #include "ConfigValueIncludes.h" 69 70 #include "CoreIncludes.h" 71 #include "DynLibManager.h" 70 72 #include "Factory.h" 71 73 #include "GameMode.h" … … 80 82 #include "input/InputManager.h" 81 83 84 // Boost 1.36 has some issues with deprecated functions that have been omitted 85 #if (BOOST_VERSION == 103600) 86 # define BOOST_LEAF_FUNCTION filename 87 #else 88 # define BOOST_LEAF_FUNCTION leaf 89 #endif 90 82 91 namespace orxonox 83 92 { … … 260 269 this->setFixedPaths(); 261 270 262 // TODO: Load plugins 271 // Create a new dynamic library manager 272 this->dynLibManager_.reset(new DynLibManager()); 273 274 // Load plugins 275 try 276 { 277 // We search for helper files with the following extension 278 std::string pluginextension = ".plugin"; 279 size_t pluginextensionlength = pluginextension.size(); 280 281 // Search in the directory of our executable 282 boost::filesystem::path searchpath = this->getRootPath() / ORXONOX_PLUGIN_INSTALL_PATH; 283 284 boost::filesystem::directory_iterator file(searchpath); 285 boost::filesystem::directory_iterator end; 286 287 // Iterate through all files 288 while (file != end) 289 { 290 std::string filename = file->BOOST_LEAF_FUNCTION(); 291 292 // Check if the file ends with the exension in question 293 if (filename.size() > pluginextensionlength) 294 { 295 if (filename.substr(filename.size() - pluginextensionlength) == pluginextension) 296 { 297 // We've found a helper file - now load the library with the same name 298 std::string library = filename.substr(0, filename.size() - pluginextensionlength); 299 boost::filesystem::path librarypath = searchpath / library; 300 301 this->dynLibManager_->load(librarypath.string()); 302 } 303 } 304 305 ++file; 306 } 307 } 308 catch (const std::exception& e) 309 { 310 COUT(1) << "An error occurred while loading plugins: " << e.what() << std::endl; 311 } 312 catch (...) 313 { 314 COUT(1) << "An error occurred while loading plugins." << std::endl; 315 } 263 316 264 317 // Parse command line arguments AFTER the plugins have been loaded (static code!) -
code/branches/libraries/src/core/Core.h
r5625 r5626 119 119 120 120 // Mind the order for the destruction! 121 scoped_ptr<DynLibManager> dynLibManager_; 121 122 scoped_ptr<SignalHandler> signalHandler_; 122 123 SimpleScopeGuard identifierDestroyer_; -
code/branches/libraries/src/core/CorePrereqs.h
r3370 r5626 112 112 class ConsoleCommand; 113 113 class Core; 114 class DynLib; 115 class DynLibManager; 114 116 struct Event; 115 117 class EventContainer;
Note: See TracChangeset
for help on using the changeset viewer.