Changeset 9836 in orxonox.OLD for branches/new_class_id
- Timestamp:
- Sep 26, 2006, 5:16:10 PM (18 years ago)
- Location:
- branches/new_class_id/src
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/Makefile.am
r9794 r9836 45 45 \ 46 46 \ 47 lib/util/loading/ resource_manager.cc47 lib/util/loading/old_resource_manager.cc 48 48 49 49 noinst_HEADERS = \ -
branches/new_class_id/src/lib/graphics/importer/Makefile.am
r9831 r9836 35 35 \ 36 36 md2/md2Model.cc \ 37 md2/resource_md2.cc \38 \37 md2/resource_md2.cc 38 # \ 39 39 md3/md3_model.cc \ 40 40 md3/md3_animation.cc \ -
branches/new_class_id/src/lib/graphics/importer/bsp_file.cc
r9833 r9836 22 22 #include "bsp_tree_node.h" 23 23 #include <fstream> 24 #include "util/loading/ new_resource_manager.h"24 #include "util/loading/resource_manager.h" 25 25 26 26 #include <sys/stat.h> … … 466 466 PRINTF(4)("BSP FILE: Name %s . \n", fileName); 467 467 468 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);468 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 469 469 470 470 if(File(absFileName).exists()) { … … 481 481 strncat (fileName, ext, strlen(fileName)); 482 482 483 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);483 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 484 484 485 485 if(File(absFileName).exists()) { … … 496 496 strncat (fileName, ext, strlen(fileName)); 497 497 498 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);498 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 499 499 500 500 if(File(absFileName).exists()) { … … 511 511 strncat (fileName, ext, strlen(fileName)); 512 512 513 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);513 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 514 514 515 515 if(File(absFileName).exists()) { … … 524 524 strcpy(ext, ".TGA"); 525 525 strncat (fileName, ext, strlen(fileName)); 526 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);526 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 527 527 528 528 if(File(absFileName).exists()/*stat( absFileName.c_str() , &results) == 0*/) { … … 537 537 strcpy(ext, ".jpg"); 538 538 strncat (fileName, ext, strlen(fileName)); 539 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);539 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 540 540 if(File(absFileName).exists()) { 541 541 PRINTF(4)("BSP FILE: gefunden . \n"); … … 551 551 strcpy(ext, ".JPG"); 552 552 strncat (fileName, ext, strlen(fileName)); 553 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);553 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 554 554 if(File(absFileName).exists()) { 555 555 PRINTF(4)("BSP FILE: gefunden . \n"); … … 566 566 strcpy(ext, ".bmp"); 567 567 strncat (fileName, ext, strlen(fileName)); 568 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);568 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 569 569 570 570 if(File(absFileName).exists()) { … … 580 580 strcpy(ext, ".BMP"); 581 581 strncat (fileName, ext, strlen(fileName)); 582 absFileName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);582 absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 583 583 584 584 if(File(absFileName).exists()) { … … 611 611 this->testSurf = NULL; 612 612 613 this->testSurf = IMG_Load(Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(mat).c_str());613 this->testSurf = IMG_Load(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(mat).c_str()); 614 614 if(this->testSurf != NULL) { 615 615 if(this->testSurf->format->Amask != 0 ) tmpAMat.alpha = true; -
branches/new_class_id/src/lib/graphics/importer/bsp_manager.cc
r9833 r9836 41 41 #include "world_entity.h" 42 42 43 #include "util/loading/ new_resource_manager.h"43 #include "util/loading/resource_manager.h" 44 44 #include "util/loading/load_param.h" 45 45 #include "util/loading/factory.h" … … 92 92 this->bspFile = new BspFile(); 93 93 this->bspFile->scale = scale; 94 if(this->bspFile->read(Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName).c_str()) == -1)94 if(this->bspFile->read(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName).c_str()) == -1) 95 95 return -1; 96 96 -
branches/new_class_id/src/lib/graphics/importer/media_container.cc
r9833 r9836 25 25 #include "media_container.h" 26 26 27 #include "util/loading/ new_resource_manager.h"27 #include "util/loading/resource_manager.h" 28 28 /* header for debug output */ 29 29 #include "debug.h" … … 91 91 return false; 92 92 // check whether file exists 93 if(!Resources:: NewResourceManager::getInstance()->checkFileInMainPath(filename))93 if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(filename)) 94 94 { 95 95 PRINTF(1)("Could not find %s\n", filename.c_str()); … … 101 101 102 102 // Open video file 103 if (av_open_input_file(&format_context, Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str(), NULL, 0, NULL) !=0 )104 { 105 PRINTF(1)("Could not open %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());103 if (av_open_input_file(&format_context, Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str(), NULL, 0, NULL) !=0 ) 104 { 105 PRINTF(1)("Could not open %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 106 106 return false; 107 107 } … … 110 110 if (av_find_stream_info(format_context) < 0) 111 111 { 112 PRINTF(1)("Could not find stream information in %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());112 PRINTF(1)("Could not find stream information in %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 113 113 return false; 114 114 } … … 119 119 if(video_stream == -1) 120 120 { 121 PRINTF(1)("Could not find a video stream in %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());121 PRINTF(1)("Could not find a video stream in %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 122 122 return false; 123 123 } -
branches/new_class_id/src/lib/graphics/importer/movie_player.cc
r9833 r9836 24 24 // include your own header 25 25 #include "movie_player.h" 26 #include "util/loading/ new_resource_manager.h"26 #include "util/loading/resource_manager.h" 27 27 28 28 // header for debug output … … 89 89 return false; 90 90 // check whether file exists 91 if(!Resources:: NewResourceManager::getInstance()->checkFileInMainPath(filename))91 if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(filename)) 92 92 { 93 93 PRINTF(1)("Could not find %s\n", filename.c_str()); … … 99 99 100 100 // Open video file 101 if (av_open_input_file(&format_context, Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str(), NULL, 0, NULL) !=0 )102 { 103 PRINTF(1)("Could not open %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());101 if (av_open_input_file(&format_context, Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str(), NULL, 0, NULL) !=0 ) 102 { 103 PRINTF(1)("Could not open %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 104 104 return false; 105 105 } … … 108 108 if (av_find_stream_info(format_context) < 0) 109 109 { 110 PRINTF(1)("Could not find stream information in %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());110 PRINTF(1)("Could not find stream information in %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 111 111 return false; 112 112 } … … 117 117 if(video_stream == -1) 118 118 { 119 PRINTF(1)("Could not find a video stream in %s\n", Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str());119 PRINTF(1)("Could not find a video stream in %s\n", Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(filename).c_str()); 120 120 return false; 121 121 } -
branches/new_class_id/src/lib/graphics/text_engine/text.cc
r9833 r9836 18 18 #include "text.h" 19 19 #include "font.h" 20 #include "loading/ resource_manager.h"20 #include "loading/old_resource_manager.h" 21 21 #include "debug.h" 22 22 -
branches/new_class_id/src/lib/gui/gl/glgui_handler.cc
r9833 r9836 23 23 #include "glgui_cursor.h" 24 24 25 #include "loading/ new_resource_manager.h"25 #include "loading/resource_manager.h" 26 26 27 27 #include <cassert> … … 77 77 this->_cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY())); 78 78 79 _cursor->loadTextureSequence(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);79 _cursor->loadTextureSequence(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49); 80 80 81 81 } -
branches/new_class_id/src/lib/gui/gl/glgui_widget.cc
r9833 r9836 25 25 26 26 #include "loading/load_param.h" 27 #include "loading/ new_resource_manager.h"27 #include "loading/resource_manager.h" 28 28 29 29 namespace OrxGui … … 102 102 103 103 if(GLGuiWidget::_defaultFont == NULL) 104 GLGuiWidget::_defaultFont = new Font(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + "/fonts/final_frontier.ttf", 20);104 GLGuiWidget::_defaultFont = new Font(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + "/fonts/final_frontier.ttf", 20); 105 105 106 106 this->_font = *GLGuiWidget::_defaultFont; -
branches/new_class_id/src/lib/network/monitor/network_stats_widget.cc
r9833 r9836 20 20 #include "peer_info.h" 21 21 22 #include "loading/ new_resource_manager.h"22 #include "loading/resource_manager.h" 23 23 24 24 #include "multi_type.h" … … 56 56 { 57 57 if(_font == NULL) 58 _font = new Font(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + "/fonts/arial.ttf", 20);58 _font = new Font(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + "/fonts/arial.ttf", 20); 59 59 60 60 //this->_name.setFont(*_font); -
branches/new_class_id/src/lib/network/network_stream.cc
r9833 r9836 41 41 42 42 #include "loading/factory.h" 43 #include "loading/ new_resource_manager.h"43 #include "loading/resource_manager.h" 44 44 45 45 #include "debug.h" … … 1299 1299 length = remainingBytesToWriteToDict; 1300 1300 1301 std::string fileName = Resources:: NewResourceManager::getInstance()->mainGlobalPath().name();1301 std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name(); 1302 1302 fileName += "/dicts/newdict"; 1303 1303 -
branches/new_class_id/src/lib/network/proxy/network_settings.cc
r9833 r9836 22 22 23 23 #include "loading/load_param.h" 24 #include "loading/ new_resource_manager.h"24 #include "loading/resource_manager.h" 25 25 #include "debug.h" 26 26 … … 64 64 void NetworkSettings::loadData() 65 65 { 66 std::string fileName = Resources:: NewResourceManager::getInstance()->mainGlobalPath().name();66 std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name(); 67 67 fileName += "configs/network_settings.conf"; 68 68 -
branches/new_class_id/src/lib/network/zip.cc
r9833 r9836 15 15 16 16 #include "zip.h" 17 #include "loading/ new_resource_manager.h"17 #include "loading/resource_manager.h" 18 18 #include "debug.h" 19 19 … … 50 50 int Zip::loadDictionary( std::string name ) 51 51 { 52 std::string fileName = Resources:: NewResourceManager::getInstance()->mainGlobalPath().name();52 std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name(); 53 53 //PRINTF(0)("datadir: %s\n", fileName.c_str()); 54 54 fileName = fileName + "/dicts/" + name; -
branches/new_class_id/src/lib/script_engine/script.cc
r9833 r9836 19 19 #include "debug.h" 20 20 21 #include "loading/ new_resource_manager.h"21 #include "loading/resource_manager.h" 22 22 #include "loading/load_param.h" 23 23 #include "parser/tinyxml/tinyxml.h" … … 100 100 bool Script::loadFile(const std::string& filename) 101 101 { 102 std::string filedest(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name());102 std::string filedest(Resources::ResourceManager::getInstance()->mainGlobalPath().name()); 103 103 filedest += "scripts/" + filename; 104 104 -
branches/new_class_id/src/lib/shell/shell_completion_plugin.cc
r9833 r9836 22 22 23 23 #include "helper_functions.h" 24 #include "loading/ new_resource_manager.h"24 #include "loading/resource_manager.h" 25 25 26 26 #include "filesys/directory.h" … … 97 97 if (completionBegin.empty()) // if we do not yet have the beginning of the line, start with the chosen startDir. 98 98 { 99 dir.setFileName(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + this->_subDir);99 dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + this->_subDir); 100 100 dir.open(); 101 101 for(unsigned int i = 0; i < dir.fileCount(); i++ ) … … 112 112 directoryName = completionBegin.substr(0, pos); 113 113 114 dir.setFileName(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + directoryName);114 dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + directoryName); 115 115 dir.open(); 116 116 … … 135 135 continue; 136 136 } 137 printf("%s\n", (Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() + fileName).c_str());137 printf("%s\n", (Resources::ResourceManager::getInstance()->mainGlobalPath().name() + fileName).c_str()); 138 138 if (!nocaseCmp(completionBegin, fileName, completionBegin.size()) && 139 Resources:: NewResourceManager::getInstance()->checkFileInMainPath(fileName))139 Resources::ResourceManager::getInstance()->checkFileInMainPath(fileName)) 140 140 { 141 141 printf("Dir %s\n", fileName.c_str()); -
branches/new_class_id/src/lib/shell/some_shell_commands.cc
r9806 r9836 52 52 ->completionPlugin(0, CompletorFileSystem()); 53 53 54 #include "loading/ new_resource_manager.h"54 #include "loading/resource_manager.h" 55 55 namespace Resources 56 {SHELL_COMMAND(debug, NewResourceManager, debug);}56 {SHELL_COMMAND(debug, ResourceManager, debug);} 57 57 58 58 #include "loading/load_param_class_description.h" -
branches/new_class_id/src/lib/util/Makefile.am
r9794 r9836 15 15 multi_type.cc \ 16 16 \ 17 loading/ new_resource_manager.cc \17 loading/resource_manager.cc \ 18 18 loading/resource.cc \ 19 19 loading/game_loader.cc \ … … 66 66 \ 67 67 loading/resource_manager.h \ 68 loading/new_resource_manager.h \69 68 loading/resource.h \ 70 69 loading/game_loader.h \ -
branches/new_class_id/src/lib/util/loading/game_loader.cc
r9833 r9836 20 20 #include "game_loader.h" 21 21 #include "util/loading/load_param.h" 22 #include "util/loading/ new_resource_manager.h"22 #include "util/loading/resource_manager.h" 23 23 #include "debug.h" 24 24 #include "campaign.h" … … 83 83 { 84 84 ErrorMessage errorCode; 85 std::string campaignName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);85 std::string campaignName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 86 86 if (!campaignName.empty()) 87 87 { … … 103 103 { 104 104 ErrorMessage errorCode; 105 std::string campaignName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);105 std::string campaignName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 106 106 if (!campaignName.empty()) 107 107 { -
branches/new_class_id/src/lib/util/loading/old_resource_manager.cc
r9834 r9836 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD 17 17 18 #include " util/loading/resource_manager.h"18 #include "old_resource_manager.h" 19 19 #include "substring.h" 20 20 #include "debug.h" … … 411 411 tmpResource->param[0] = param0; 412 412 tmpResource->param[1] = param1; 413 tmpResource->pointer = new md3::MD3Data(fullName, tmpResource->param[0].getCString(), tmpResource->param[1].getFloat());413 // tmpResource->pointer = new md3::MD3Data(fullName, tmpResource->param[0].getCString(), tmpResource->param[1].getFloat()); 414 414 } 415 415 break; … … 419 419 tmpResource->param[0] = param0; 420 420 tmpResource->param[1] = param1; 421 tmpResource->pointer = new md3::MD3AnimationCfg(fullName);421 // tmpResource->pointer = new md3::MD3AnimationCfg(fullName); 422 422 } 423 423 break; -
branches/new_class_id/src/lib/util/loading/old_resource_manager.h
r9834 r9836 17 17 */ 18 18 19 #ifndef _ RESOURCE_MANAGER_H20 #define _ RESOURCE_MANAGER_H19 #ifndef _OLD_RESOURCE_MANAGER_H 20 #define _OLD_RESOURCE_MANAGER_H 21 21 22 22 #include "base_object.h" -
branches/new_class_id/src/lib/util/loading/resource.cc
r9800 r9836 17 17 18 18 #include "resource.h" 19 #include " new_resource_manager.h"19 #include "resource_manager.h" 20 20 21 21 #include "debug.h" … … 47 47 std::string NewResource::locateFile(const std::string& fileName) const 48 48 { 49 if (( NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() )50 return ( NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();49 if ((ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() ) 50 return (ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name(); 51 51 52 52 std::string locatedFile; 53 locatedFile = locateFileInSubDir( NewResourceManager::getInstance()->mainGlobalPath(), fileName);53 locatedFile = locateFileInSubDir(ResourceManager::getInstance()->mainGlobalPath(), fileName); 54 54 if (!locatedFile.empty()) 55 55 { … … 61 61 return fileName; 62 62 63 return ( NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();63 return (ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name(); 64 64 } 65 65 … … 115 115 KeepLevel::KeepLevel(const std::string& keepLevelName) 116 116 { 117 this->_keepLevel = NewResourceManager::getInstance()->getKeepLevelID(keepLevelName);117 this->_keepLevel = ResourceManager::getInstance()->getKeepLevelID(keepLevelName); 118 118 } 119 119 120 120 const std::string& KeepLevel::name() const 121 121 { 122 return NewResourceManager::getInstance()->getKeepLevelName(this->_keepLevel);122 return ResourceManager::getInstance()->getKeepLevelName(this->_keepLevel); 123 123 } 124 124 … … 141 141 : _id(-1), _typeName(typeName) 142 142 { 143 NewResourceManager::getInstance()->registerType(this);143 ResourceManager::getInstance()->registerType(this); 144 144 PRINTF(4)("Created ResourceType '%s'\n", typeName.c_str()); 145 145 } … … 147 147 Type::~Type() 148 148 { 149 NewResourceManager::getInstance()->unregisterType(this);149 ResourceManager::getInstance()->unregisterType(this); 150 150 } 151 151 -
branches/new_class_id/src/lib/util/loading/resource_manager.cc
r9835 r9836 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD 17 17 18 #include " new_resource_manager.h"18 #include "resource_manager.h" 19 19 #include "debug.h" 20 20 … … 25 25 namespace Resources 26 26 { 27 ObjectListDefinition( NewResourceManager);28 //! Singleton Reference to the NewResourceManager29 NewResourceManager* NewResourceManager::_singletonRef = NULL;27 ObjectListDefinition(ResourceManager); 28 //! Singleton Reference to the ResourceManager 29 ResourceManager* ResourceManager::_singletonRef = NULL; 30 30 31 31 … … 33 33 * @brief standard constructor 34 34 */ 35 NewResourceManager::NewResourceManager ()35 ResourceManager::ResourceManager () 36 36 { 37 this->registerObject(this, NewResourceManager::_objectList);38 this->setName(" NewResourceManager");37 this->registerObject(this, ResourceManager::_objectList); 38 this->setName("ResourceManager"); 39 39 this->_mainGlobalPath = Directory("./"); 40 40 } … … 44 44 * @brief standard destructor 45 45 */ 46 NewResourceManager::~NewResourceManager ()46 ResourceManager::~ResourceManager () 47 47 { 48 48 // deleting the Resources-List … … 52 52 // PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList.size()); 53 53 54 NewResourceManager::_singletonRef = NULL;54 ResourceManager::_singletonRef = NULL; 55 55 } 56 56 … … 58 58 59 59 60 void NewResourceManager::registerType(Resources::Type* type)60 void ResourceManager::registerType(Resources::Type* type) 61 61 { 62 62 if(type->id() == -1) … … 68 68 } 69 69 70 void NewResourceManager::unregisterType(Resources::Type* type)70 void ResourceManager::unregisterType(Resources::Type* type) 71 71 { 72 72 std::vector<Resources::Type*>::iterator it = std::find (this->_resourceTypes.begin(), this->_resourceTypes.end(), type); … … 79 79 80 80 81 void NewResourceManager::setMainGlobalPath(const Directory& directory)81 void ResourceManager::setMainGlobalPath(const Directory& directory) 82 82 { 83 83 this->_mainGlobalPath = directory; … … 85 85 } 86 86 87 void NewResourceManager::addGlobalPath(const Directory& directory)87 void ResourceManager::addGlobalPath(const Directory& directory) 88 88 { 89 89 std::vector<Directory>::const_iterator it = std::find(this->_globalPaths.begin(), this->_globalPaths.end(), directory); … … 93 93 94 94 95 bool NewResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)95 bool ResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName) 96 96 { 97 97 std::vector<Resources::Type*>::iterator it; … … 103 103 } 104 104 105 bool NewResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)105 bool ResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName) 106 106 { 107 107 std::vector<Resources::Type*>::iterator it; … … 115 115 116 116 117 bool NewResourceManager::checkFileInMainPath(const File& fileInside)117 bool ResourceManager::checkFileInMainPath(const File& fileInside) 118 118 { 119 119 return (this->_mainGlobalPath + fileInside).exists(); 120 120 } 121 121 122 std::string NewResourceManager::prependAbsoluteMainPath(const std::string& fileName)122 std::string ResourceManager::prependAbsoluteMainPath(const std::string& fileName) 123 123 { 124 124 return (this->_mainGlobalPath + File(fileName)).name(); … … 126 126 127 127 128 unsigned int NewResourceManager::addKeepLevelName(const std::string& keepLevelName)128 unsigned int ResourceManager::addKeepLevelName(const std::string& keepLevelName) 129 129 { 130 130 this->_keepLevelNames.push_back(keepLevelName); … … 132 132 } 133 133 134 unsigned int NewResourceManager::getKeepLevelID(const std::string& keepLevelName) const134 unsigned int ResourceManager::getKeepLevelID(const std::string& keepLevelName) const 135 135 { 136 136 for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i) … … 142 142 } 143 143 144 const std::string& NewResourceManager::getKeepLevelName(unsigned int keepLevelID) const144 const std::string& ResourceManager::getKeepLevelName(unsigned int keepLevelID) const 145 145 { 146 146 assert(keepLevelID < this->_keepLevelNames.size()); … … 150 150 151 151 /** 152 * @brief outputs debug information about the NewResourceManager152 * @brief outputs debug information about the ResourceManager 153 153 */ 154 void NewResourceManager::debug() const154 void ResourceManager::debug() const 155 155 { 156 156 PRINT(0)("=RM===================================\n"); -
branches/new_class_id/src/lib/util/loading/resource_manager.h
r9835 r9836 1 1 /*! 2 * @file new_resource_manager.h2 * @file resource_manager.h 3 3 */ 4 4 5 #ifndef _ NEW_RESOURCE_MANAGER_H6 #define _ NEW_RESOURCE_MANAGER_H5 #ifndef _RESOURCE_MANAGER_H 6 #define _RESOURCE_MANAGER_H 7 7 8 8 #include "resource.h" … … 13 13 { 14 14 15 class NewResourceManager : public BaseObject15 class ResourceManager : public BaseObject 16 16 { 17 ObjectListDeclaration( NewResourceManager);17 ObjectListDeclaration(ResourceManager); 18 18 public: 19 19 /** @returns a Pointer to the only object of this Class */ 20 inline static NewResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new NewResourceManager(); return _singletonRef; };20 inline static ResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new ResourceManager(); return _singletonRef; }; 21 21 /** @brief deletes the Instance if it exists. */ 22 22 inline static void deleteInstance() { if (_singletonRef) delete _singletonRef; }; … … 54 54 static bool isInDataDir(const std::string& fileName); 55 55 private: 56 NewResourceManager();57 virtual ~ NewResourceManager();56 ResourceManager(); 57 virtual ~ResourceManager(); 58 58 59 59 private: 60 static NewResourceManager* _singletonRef; //!< singleton Reference60 static ResourceManager* _singletonRef; //!< singleton Reference 61 61 62 62 Directory _mainGlobalPath; //!< The main include directory (default at "./") -
branches/new_class_id/src/orxonox.cc
r9817 r9836 41 41 #include "sound_engine.h" 42 42 #include "util/loading/resource_manager.h" 43 #include "util/loading/ new_resource_manager.h"43 #include "util/loading/old_resource_manager.h" 44 44 45 45 #include "cd_engine.h" … … 129 129 130 130 // handlers 131 Resources:: NewResourceManager::deleteInstance(); // deletes the Resource Manager131 Resources::ResourceManager::deleteInstance(); // deletes the Resource Manager 132 132 133 133 // engines … … 257 257 GraphicsEngine::getInstance()->initFromPreferences(); 258 258 259 std::string iconName = Resource Manager::getFullName("pictures/fighter-top-32x32.bmp");259 std::string iconName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath("pictures/fighter-top-32x32.bmp"); 260 260 if (!iconName.empty()) 261 261 { … … 341 341 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "") 342 342 { 343 Resources:: NewResourceManager::getInstance()->setMainGlobalPath(dataPath) ;344 if(!Resources:: NewResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))343 Resources::ResourceManager::getInstance()->setMainGlobalPath(dataPath) ; 344 if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE))) 345 345 { 346 346 PRINTF(1)("Data Could not be located in %s\n", dataPath.c_str()); 347 347 } 348 348 } 349 while (!Resources:: NewResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))349 while (!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE))) 350 350 { 351 351 352 352 PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \ 353 353 "!!! Please Change in File %s Section %s Entry %s to a suitable value !!!\n", 354 Resources:: NewResourceManager::getInstance()->mainGlobalPath().name().c_str(),354 Resources::ResourceManager::getInstance()->mainGlobalPath().name().c_str(), 355 355 this->configFileName.c_str(), 356 356 CONFIG_SECTION_GENERAL, … … 361 361 return(-1); 362 362 delete gui; 363 Resources:: NewResourceManager::getInstance()->setMainGlobalPath(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""));363 Resources::ResourceManager::getInstance()->setMainGlobalPath(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, "")); 364 364 } 365 365 … … 367 367 368 368 //! @todo this is a hack and should be loadable 369 Resources:: NewResourceManager::getInstance()->addResourceSubPath("Texture", "maps");370 Resources:: NewResourceManager::getInstance()->addResourceSubPath("Texture", "pictures");371 372 Resources:: NewResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "sound");373 Resources:: NewResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "music");374 375 Resources:: NewResourceManager::getInstance()->addKeepLevelName("Imediately");376 Resources:: NewResourceManager::getInstance()->addKeepLevelName("LevelEnd");377 Resources:: NewResourceManager::getInstance()->addKeepLevelName("CampaignEnd");378 Resources:: NewResourceManager::getInstance()->addKeepLevelName("GameEnd");379 380 381 Resources:: NewResourceManager::getInstance()->debug();369 Resources::ResourceManager::getInstance()->addResourceSubPath("Texture", "maps"); 370 Resources::ResourceManager::getInstance()->addResourceSubPath("Texture", "pictures"); 371 372 Resources::ResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "sound"); 373 Resources::ResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "music"); 374 375 Resources::ResourceManager::getInstance()->addKeepLevelName("Imediately"); 376 Resources::ResourceManager::getInstance()->addKeepLevelName("LevelEnd"); 377 Resources::ResourceManager::getInstance()->addKeepLevelName("CampaignEnd"); 378 Resources::ResourceManager::getInstance()->addKeepLevelName("GameEnd"); 379 380 381 Resources::ResourceManager::getInstance()->debug(); 382 382 // DynamicLoader::loadDyLib("libtest.so"); 383 383 return 0; -
branches/new_class_id/src/story_entities/game_world_data.cc
r9833 r9836 25 25 26 26 #include "util/loading/game_loader.h" 27 #include "util/loading/ new_resource_manager.h"27 #include "util/loading/resource_manager.h" 28 28 29 29 #include "world_entity.h" … … 379 379 { 380 380 PRINTF(3)("Setting Sound Track to %s\n", name.c_str()); 381 std::string oggFile = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(name);381 std::string oggFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name); 382 382 this->music = new OrxSound::OggPlayer(oggFile); 383 383 if (this->localPlayer != NULL) -
branches/new_class_id/src/story_entities/story_entity.cc
r9833 r9836 23 23 24 24 #include "loading/load_param.h" 25 #include "loading/ new_resource_manager.h"25 #include "loading/resource_manager.h" 26 26 27 27 #include "debug.h" … … 107 107 } 108 108 else 109 this->loadFile = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);109 this->loadFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 110 110 111 111 this->grabWorldInfo(); -
branches/new_class_id/src/world_entities/bsp_entity.cc
r9833 r9836 17 17 18 18 #include "debug.h" 19 #include "loading/ new_resource_manager.h"19 #include "loading/resource_manager.h" 20 20 21 21 #include "class_id_DEPRECATED.h" … … 71 71 72 72 // Check wether file exists.... 73 if ( File(Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists() ) {73 if ( File(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists() ) { 74 74 75 75 this->bspManager = new BspManager(this); -
branches/new_class_id/src/world_entities/terrain.cc
r9833 r9836 18 18 #include "terrain.h" 19 19 20 #include "util/loading/ new_resource_manager.h"20 #include "util/loading/resource_manager.h" 21 21 #include "util/loading/load_param.h" 22 22 #include "util/loading/factory.h" … … 144 144 this->heightMap = NULL; 145 145 146 std::string hmName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile);147 std::string hmColorName = Resources:: NewResourceManager::getInstance()->prependAbsoluteMainPath(colorMap);146 std::string hmName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile); 147 std::string hmColorName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(colorMap); 148 148 149 149 -
branches/new_class_id/src/world_entities/world_entity.cc
r9832 r9836 20 20 #include "shell_command.h" 21 21 22 #include "util/loading/ new_resource_manager.h"22 #include "util/loading/resource_manager.h" 23 23 #include "resource_obj.h" 24 24 #include "md2/md2Model.h" … … 162 162 std::string name = fileName; 163 163 164 if ( name.find( Resources:: NewResourceManager::getInstance()->mainGlobalPath().name() ) == 0 )165 { 166 name.erase(Resources:: NewResourceManager::getInstance()->mainGlobalPath().name().size());164 if ( name.find( Resources::ResourceManager::getInstance()->mainGlobalPath().name() ) == 0 ) 165 { 166 name.erase(Resources::ResourceManager::getInstance()->mainGlobalPath().name().size()); 167 167 } 168 168 … … 180 180 { 181 181 lodFile[offset] = 48+(int)i; 182 if (Resources:: NewResourceManager::getInstance()->checkFileInMainPath( lodFile))182 if (Resources::ResourceManager::getInstance()->checkFileInMainPath( lodFile)) 183 183 this->loadModel(lodFile, scaling, i); 184 184 } … … 220 220 { 221 221 PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str()); 222 Model* m = new md3::MD3Model(fileName, this->scaling);223 this->setModel(m, 0);222 // Model* m = new md3::MD3Model(fileName, this->scaling); 223 // this->setModel(m, 0); 224 224 225 225 // if( m != NULL)
Note: See TracChangeset
for help on using the changeset viewer.