Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9836 in orxonox.OLD for branches/new_class_id


Ignore:
Timestamp:
Sep 26, 2006, 5:16:10 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: Taken out the old ResourceManager.
On the way, i had to desintegrate the old MD3-model loading process (via ResourceManager) MD3 is untouched, but also not loaded anymore neither from ResourceMangers nor from the WorldEntity

@patrick: MD3-ModelLoading class must be implemented… this should be quite easy, with the way MD3 is, and the new Resource-paradigm
cheers

Location:
branches/new_class_id/src
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/Makefile.am

    r9794 r9836  
    4545                \
    4646                \
    47                 lib/util/loading/resource_manager.cc
     47                lib/util/loading/old_resource_manager.cc
    4848
    4949noinst_HEADERS = \
  • branches/new_class_id/src/lib/graphics/importer/Makefile.am

    r9831 r9836  
    3535                \
    3636                md2/md2Model.cc \
    37                 md2/resource_md2.cc \
    38                 \
     37                md2/resource_md2.cc
     38#               \
    3939                md3/md3_model.cc \
    4040                md3/md3_animation.cc \
  • branches/new_class_id/src/lib/graphics/importer/bsp_file.cc

    r9833 r9836  
    2222#include "bsp_tree_node.h"
    2323#include <fstream>
    24 #include "util/loading/new_resource_manager.h"
     24#include "util/loading/resource_manager.h"
    2525
    2626#include <sys/stat.h>
     
    466466    PRINTF(4)("BSP FILE: Name %s . \n", fileName);
    467467
    468     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     468    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    469469
    470470    if(File(absFileName).exists()) {
     
    481481    strncat (fileName, ext, strlen(fileName));
    482482
    483     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     483    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    484484
    485485    if(File(absFileName).exists()) {
     
    496496    strncat (fileName, ext, strlen(fileName));
    497497
    498     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     498    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    499499
    500500    if(File(absFileName).exists()) {
     
    511511    strncat (fileName, ext, strlen(fileName));
    512512
    513     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     513    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    514514
    515515    if(File(absFileName).exists()) {
     
    524524    strcpy(ext, ".TGA");
    525525    strncat (fileName, ext, strlen(fileName));
    526     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     526    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    527527
    528528    if(File(absFileName).exists()/*stat( absFileName.c_str() , &results) == 0*/) {
     
    537537    strcpy(ext, ".jpg");
    538538    strncat (fileName, ext, strlen(fileName));
    539     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     539    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    540540    if(File(absFileName).exists()) {
    541541      PRINTF(4)("BSP FILE: gefunden . \n");
     
    551551    strcpy(ext, ".JPG");
    552552    strncat (fileName, ext, strlen(fileName));
    553     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     553    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    554554    if(File(absFileName).exists()) {
    555555      PRINTF(4)("BSP FILE: gefunden . \n");
     
    566566    strcpy(ext, ".bmp");
    567567    strncat (fileName, ext, strlen(fileName));
    568     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     568    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    569569
    570570    if(File(absFileName).exists()) {
     
    580580    strcpy(ext, ".BMP");
    581581    strncat (fileName, ext, strlen(fileName));
    582     absFileName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     582    absFileName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    583583
    584584    if(File(absFileName).exists()) {
     
    611611  this->testSurf = NULL;
    612612
    613   this->testSurf = IMG_Load(Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(mat).c_str());
     613  this->testSurf = IMG_Load(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(mat).c_str());
    614614  if(this->testSurf != NULL) {
    615615    if(this->testSurf->format->Amask != 0 ) tmpAMat.alpha = true;
  • branches/new_class_id/src/lib/graphics/importer/bsp_manager.cc

    r9833 r9836  
    4141#include "world_entity.h"
    4242
    43 #include "util/loading/new_resource_manager.h"
     43#include "util/loading/resource_manager.h"
    4444#include "util/loading/load_param.h"
    4545#include "util/loading/factory.h"
     
    9292  this->bspFile = new BspFile();
    9393  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)
    9595    return -1;
    9696
  • branches/new_class_id/src/lib/graphics/importer/media_container.cc

    r9833 r9836  
    2525#include "media_container.h"
    2626
    27 #include "util/loading/new_resource_manager.h"
     27#include "util/loading/resource_manager.h"
    2828/* header for debug output */
    2929#include "debug.h"
     
    9191    return false;
    9292  // check whether file exists
    93   if(!Resources::NewResourceManager::getInstance()->checkFileInMainPath(filename))
     93  if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(filename))
    9494  {
    9595    PRINTF(1)("Could not find %s\n", filename.c_str());
     
    101101
    102102  // 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());
    106106    return false;
    107107  }
     
    110110  if (av_find_stream_info(format_context) < 0)
    111111  {
    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());
    113113    return false;
    114114  }
     
    119119  if(video_stream == -1)
    120120  {
    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());
    122122    return false;
    123123  }
  • branches/new_class_id/src/lib/graphics/importer/movie_player.cc

    r9833 r9836  
    2424// include your own header
    2525#include "movie_player.h"
    26 #include "util/loading/new_resource_manager.h"
     26#include "util/loading/resource_manager.h"
    2727
    2828// header for debug output
     
    8989    return false;
    9090  // check whether file exists
    91   if(!Resources::NewResourceManager::getInstance()->checkFileInMainPath(filename))
     91  if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(filename))
    9292  {
    9393    PRINTF(1)("Could not find %s\n", filename.c_str());
     
    9999
    100100  // 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());
    104104    return false;
    105105  }
     
    108108  if (av_find_stream_info(format_context) < 0)
    109109  {
    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());
    111111    return false;
    112112  }
     
    117117  if(video_stream == -1)
    118118  {
    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());
    120120    return false;
    121121  }
  • branches/new_class_id/src/lib/graphics/text_engine/text.cc

    r9833 r9836  
    1818#include "text.h"
    1919#include "font.h"
    20 #include "loading/resource_manager.h"
     20#include "loading/old_resource_manager.h"
    2121#include "debug.h"
    2222
  • branches/new_class_id/src/lib/gui/gl/glgui_handler.cc

    r9833 r9836  
    2323#include "glgui_cursor.h"
    2424
    25 #include "loading/new_resource_manager.h"
     25#include "loading/resource_manager.h"
    2626
    2727#include <cassert>
     
    7777    this->_cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
    7878
    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);
    8080
    8181  }
  • branches/new_class_id/src/lib/gui/gl/glgui_widget.cc

    r9833 r9836  
    2525
    2626#include "loading/load_param.h"
    27 #include "loading/new_resource_manager.h"
     27#include "loading/resource_manager.h"
    2828
    2929namespace OrxGui
     
    102102
    103103    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);
    105105
    106106    this->_font = *GLGuiWidget::_defaultFont;
  • branches/new_class_id/src/lib/network/monitor/network_stats_widget.cc

    r9833 r9836  
    2020#include "peer_info.h"
    2121
    22 #include "loading/new_resource_manager.h"
     22#include "loading/resource_manager.h"
    2323
    2424#include "multi_type.h"
     
    5656{
    5757  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);
    5959
    6060  //this->_name.setFont(*_font);
  • branches/new_class_id/src/lib/network/network_stream.cc

    r9833 r9836  
    4141
    4242#include "loading/factory.h"
    43 #include "loading/new_resource_manager.h"
     43#include "loading/resource_manager.h"
    4444
    4545#include "debug.h"
     
    12991299    length = remainingBytesToWriteToDict;
    13001300
    1301   std::string fileName = Resources::NewResourceManager::getInstance()->mainGlobalPath().name();
     1301  std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name();
    13021302  fileName += "/dicts/newdict";
    13031303
  • branches/new_class_id/src/lib/network/proxy/network_settings.cc

    r9833 r9836  
    2222
    2323#include "loading/load_param.h"
    24 #include "loading/new_resource_manager.h"
     24#include "loading/resource_manager.h"
    2525#include "debug.h"
    2626
     
    6464void NetworkSettings::loadData()
    6565{
    66   std::string fileName = Resources::NewResourceManager::getInstance()->mainGlobalPath().name();
     66  std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name();
    6767  fileName += "configs/network_settings.conf";
    6868
  • branches/new_class_id/src/lib/network/zip.cc

    r9833 r9836  
    1515
    1616#include "zip.h"
    17 #include "loading/new_resource_manager.h"
     17#include "loading/resource_manager.h"
    1818#include "debug.h"
    1919
     
    5050int Zip::loadDictionary( std::string name )
    5151{
    52   std::string fileName = Resources::NewResourceManager::getInstance()->mainGlobalPath().name();
     52  std::string fileName = Resources::ResourceManager::getInstance()->mainGlobalPath().name();
    5353  //PRINTF(0)("datadir: %s\n", fileName.c_str());
    5454  fileName = fileName + "/dicts/" + name;
  • branches/new_class_id/src/lib/script_engine/script.cc

    r9833 r9836  
    1919#include "debug.h"
    2020
    21 #include "loading/new_resource_manager.h"
     21#include "loading/resource_manager.h"
    2222#include "loading/load_param.h"
    2323#include "parser/tinyxml/tinyxml.h"
     
    100100bool Script::loadFile(const std::string& filename)
    101101 {
    102    std::string filedest(Resources::NewResourceManager::getInstance()->mainGlobalPath().name());
     102   std::string filedest(Resources::ResourceManager::getInstance()->mainGlobalPath().name());
    103103   filedest += "scripts/" + filename;
    104104
  • branches/new_class_id/src/lib/shell/shell_completion_plugin.cc

    r9833 r9836  
    2222
    2323#include "helper_functions.h"
    24 #include "loading/new_resource_manager.h"
     24#include "loading/resource_manager.h"
    2525
    2626#include "filesys/directory.h"
     
    9797    if (completionBegin.empty()) // if we do not yet have the beginning of the line, start with the chosen startDir.
    9898    {
    99       dir.setFileName(Resources::NewResourceManager::getInstance()->mainGlobalPath().name() + this->_subDir);
     99      dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + this->_subDir);
    100100      dir.open();
    101101      for(unsigned int i = 0; i < dir.fileCount(); i++ )
     
    112112        directoryName = completionBegin.substr(0, pos);
    113113
    114       dir.setFileName(Resources::NewResourceManager::getInstance()->mainGlobalPath().name() + directoryName);
     114      dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + directoryName);
    115115      dir.open();
    116116
     
    135135          continue;
    136136        }
    137         printf("%s\n", (Resources::NewResourceManager::getInstance()->mainGlobalPath().name() + fileName).c_str());
     137        printf("%s\n", (Resources::ResourceManager::getInstance()->mainGlobalPath().name() + fileName).c_str());
    138138        if (!nocaseCmp(completionBegin, fileName, completionBegin.size()) &&
    139              Resources::NewResourceManager::getInstance()->checkFileInMainPath(fileName))
     139             Resources::ResourceManager::getInstance()->checkFileInMainPath(fileName))
    140140        {
    141141          printf("Dir %s\n", fileName.c_str());
  • branches/new_class_id/src/lib/shell/some_shell_commands.cc

    r9806 r9836  
    5252->completionPlugin(0, CompletorFileSystem());
    5353
    54 #include "loading/new_resource_manager.h"
     54#include "loading/resource_manager.h"
    5555namespace Resources
    56 {SHELL_COMMAND(debug, NewResourceManager, debug);}
     56{SHELL_COMMAND(debug, ResourceManager, debug);}
    5757
    5858#include "loading/load_param_class_description.h"
  • branches/new_class_id/src/lib/util/Makefile.am

    r9794 r9836  
    1515                multi_type.cc \
    1616                \
    17                 loading/new_resource_manager.cc \
     17                loading/resource_manager.cc \
    1818                loading/resource.cc \
    1919                loading/game_loader.cc \
     
    6666                \
    6767                loading/resource_manager.h \
    68                 loading/new_resource_manager.h \
    6968                loading/resource.h \
    7069                loading/game_loader.h \
  • branches/new_class_id/src/lib/util/loading/game_loader.cc

    r9833 r9836  
    2020#include "game_loader.h"
    2121#include "util/loading/load_param.h"
    22 #include "util/loading/new_resource_manager.h"
     22#include "util/loading/resource_manager.h"
    2323#include "debug.h"
    2424#include "campaign.h"
     
    8383{
    8484  ErrorMessage errorCode;
    85   std::string campaignName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     85  std::string campaignName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    8686  if (!campaignName.empty())
    8787  {
     
    103103{
    104104  ErrorMessage errorCode;
    105   std::string campaignName = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     105  std::string campaignName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    106106  if (!campaignName.empty())
    107107  {
  • branches/new_class_id/src/lib/util/loading/old_resource_manager.cc

    r9834 r9836  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
    1717
    18 #include "util/loading/resource_manager.h"
     18#include "old_resource_manager.h"
    1919#include "substring.h"
    2020#include "debug.h"
     
    411411        tmpResource->param[0] = param0;
    412412        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());
    414414      }
    415415      break;
     
    419419        tmpResource->param[0] = param0;
    420420        tmpResource->param[1] = param1;
    421         tmpResource->pointer = new md3::MD3AnimationCfg(fullName);
     421//        tmpResource->pointer = new md3::MD3AnimationCfg(fullName);
    422422      }
    423423      break;
  • branches/new_class_id/src/lib/util/loading/old_resource_manager.h

    r9834 r9836  
    1717*/
    1818
    19 #ifndef _RESOURCE_MANAGER_H
    20 #define _RESOURCE_MANAGER_H
     19#ifndef _OLD_RESOURCE_MANAGER_H
     20#define _OLD_RESOURCE_MANAGER_H
    2121
    2222#include "base_object.h"
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9800 r9836  
    1717
    1818#include "resource.h"
    19 #include "new_resource_manager.h"
     19#include "resource_manager.h"
    2020
    2121#include "debug.h"
     
    4747  std::string NewResource::locateFile(const std::string& fileName) const
    4848  {
    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();
    5151
    5252    std::string locatedFile;
    53     locatedFile = locateFileInSubDir(NewResourceManager::getInstance()->mainGlobalPath(), fileName);
     53    locatedFile = locateFileInSubDir(ResourceManager::getInstance()->mainGlobalPath(), fileName);
    5454    if (!locatedFile.empty())
    5555    {
     
    6161      return fileName;
    6262
    63     return (NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
     63    return (ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
    6464  }
    6565
     
    115115  KeepLevel::KeepLevel(const std::string& keepLevelName)
    116116  {
    117     this->_keepLevel = NewResourceManager::getInstance()->getKeepLevelID(keepLevelName);
     117    this->_keepLevel = ResourceManager::getInstance()->getKeepLevelID(keepLevelName);
    118118  }
    119119
    120120  const std::string& KeepLevel::name() const
    121121  {
    122     return NewResourceManager::getInstance()->getKeepLevelName(this->_keepLevel);
     122    return ResourceManager::getInstance()->getKeepLevelName(this->_keepLevel);
    123123  }
    124124
     
    141141      : _id(-1), _typeName(typeName)
    142142  {
    143     NewResourceManager::getInstance()->registerType(this);
     143    ResourceManager::getInstance()->registerType(this);
    144144    PRINTF(4)("Created ResourceType '%s'\n", typeName.c_str());
    145145  }
     
    147147  Type::~Type()
    148148  {
    149     NewResourceManager::getInstance()->unregisterType(this);
     149    ResourceManager::getInstance()->unregisterType(this);
    150150  }
    151151
  • branches/new_class_id/src/lib/util/loading/resource_manager.cc

    r9835 r9836  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
    1717
    18 #include "new_resource_manager.h"
     18#include "resource_manager.h"
    1919#include "debug.h"
    2020
     
    2525namespace Resources
    2626{
    27   ObjectListDefinition(NewResourceManager);
    28   //! Singleton Reference to the NewResourceManager
    29   NewResourceManager* NewResourceManager::_singletonRef = NULL;
     27  ObjectListDefinition(ResourceManager);
     28  //! Singleton Reference to the ResourceManager
     29  ResourceManager* ResourceManager::_singletonRef = NULL;
    3030
    3131
     
    3333   * @brief standard constructor
    3434  */
    35   NewResourceManager::NewResourceManager ()
     35  ResourceManager::ResourceManager ()
    3636  {
    37     this->registerObject(this, NewResourceManager::_objectList);
    38     this->setName("NewResourceManager");
     37    this->registerObject(this, ResourceManager::_objectList);
     38    this->setName("ResourceManager");
    3939    this->_mainGlobalPath = Directory("./");
    4040  }
     
    4444   * @brief standard destructor
    4545  */
    46   NewResourceManager::~NewResourceManager ()
     46  ResourceManager::~ResourceManager ()
    4747  {
    4848    // deleting the Resources-List
     
    5252    //     PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList.size());
    5353
    54     NewResourceManager::_singletonRef = NULL;
     54    ResourceManager::_singletonRef = NULL;
    5555  }
    5656
     
    5858
    5959
    60   void NewResourceManager::registerType(Resources::Type* type)
     60  void ResourceManager::registerType(Resources::Type* type)
    6161  {
    6262    if(type->id() == -1)
     
    6868  }
    6969
    70   void NewResourceManager::unregisterType(Resources::Type* type)
     70  void ResourceManager::unregisterType(Resources::Type* type)
    7171  {
    7272    std::vector<Resources::Type*>::iterator it = std::find (this->_resourceTypes.begin(), this->_resourceTypes.end(), type);
     
    7979
    8080
    81   void NewResourceManager::setMainGlobalPath(const Directory& directory)
     81  void ResourceManager::setMainGlobalPath(const Directory& directory)
    8282  {
    8383    this->_mainGlobalPath = directory;
     
    8585  }
    8686
    87   void NewResourceManager::addGlobalPath(const Directory& directory)
     87  void ResourceManager::addGlobalPath(const Directory& directory)
    8888  {
    8989    std::vector<Directory>::const_iterator it = std::find(this->_globalPaths.begin(), this->_globalPaths.end(), directory);
     
    9393
    9494
    95   bool NewResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)
     95  bool ResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)
    9696  {
    9797    std::vector<Resources::Type*>::iterator it;
     
    103103  }
    104104
    105   bool NewResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)
     105  bool ResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)
    106106  {
    107107    std::vector<Resources::Type*>::iterator it;
     
    115115
    116116
    117   bool NewResourceManager::checkFileInMainPath(const File& fileInside)
     117  bool ResourceManager::checkFileInMainPath(const File& fileInside)
    118118  {
    119119    return (this->_mainGlobalPath + fileInside).exists();
    120120  }
    121121
    122   std::string NewResourceManager::prependAbsoluteMainPath(const std::string& fileName)
     122  std::string ResourceManager::prependAbsoluteMainPath(const std::string& fileName)
    123123  {
    124124    return (this->_mainGlobalPath + File(fileName)).name();
     
    126126
    127127
    128   unsigned int NewResourceManager::addKeepLevelName(const std::string& keepLevelName)
     128  unsigned int ResourceManager::addKeepLevelName(const std::string& keepLevelName)
    129129  {
    130130    this->_keepLevelNames.push_back(keepLevelName);
     
    132132  }
    133133
    134   unsigned int NewResourceManager::getKeepLevelID(const std::string& keepLevelName) const
     134  unsigned int ResourceManager::getKeepLevelID(const std::string& keepLevelName) const
    135135  {
    136136    for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i)
     
    142142  }
    143143
    144   const std::string& NewResourceManager::getKeepLevelName(unsigned int keepLevelID) const
     144  const std::string& ResourceManager::getKeepLevelName(unsigned int keepLevelID) const
    145145  {
    146146    assert(keepLevelID < this->_keepLevelNames.size());
     
    150150
    151151  /**
    152    * @brief outputs debug information about the NewResourceManager
     152   * @brief outputs debug information about the ResourceManager
    153153   */
    154   void NewResourceManager::debug() const
     154  void ResourceManager::debug() const
    155155  {
    156156    PRINT(0)("=RM===================================\n");
  • branches/new_class_id/src/lib/util/loading/resource_manager.h

    r9835 r9836  
    11/*!
    2  * @file new_resource_manager.h
     2 * @file resource_manager.h
    33 */
    44
    5 #ifndef _NEW_RESOURCE_MANAGER_H
    6 #define _NEW_RESOURCE_MANAGER_H
     5#ifndef _RESOURCE_MANAGER_H
     6#define _RESOURCE_MANAGER_H
    77
    88#include "resource.h"
     
    1313{
    1414
    15   class NewResourceManager : public BaseObject
     15  class ResourceManager : public BaseObject
    1616  {
    17     ObjectListDeclaration(NewResourceManager);
     17    ObjectListDeclaration(ResourceManager);
    1818  public:
    1919    /** @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; };
    2121    /** @brief deletes the Instance if it exists. */
    2222    inline static void deleteInstance() { if (_singletonRef) delete _singletonRef; };
     
    5454    static bool isInDataDir(const std::string& fileName);
    5555  private:
    56     NewResourceManager();
    57     virtual ~NewResourceManager();
     56    ResourceManager();
     57    virtual ~ResourceManager();
    5858
    5959  private:
    60     static NewResourceManager*         _singletonRef;       //!< singleton Reference
     60    static ResourceManager*         _singletonRef;       //!< singleton Reference
    6161
    6262    Directory                          _mainGlobalPath;     //!< The main include directory (default at "./")
  • branches/new_class_id/src/orxonox.cc

    r9817 r9836  
    4141#include "sound_engine.h"
    4242#include "util/loading/resource_manager.h"
    43 #include "util/loading/new_resource_manager.h"
     43#include "util/loading/old_resource_manager.h"
    4444
    4545#include "cd_engine.h"
     
    129129
    130130  // handlers
    131   Resources::NewResourceManager::deleteInstance(); // deletes the Resource Manager
     131  Resources::ResourceManager::deleteInstance(); // deletes the Resource Manager
    132132
    133133  // engines
     
    257257  GraphicsEngine::getInstance()->initFromPreferences();
    258258
    259   std::string iconName = ResourceManager::getFullName("pictures/fighter-top-32x32.bmp");
     259  std::string iconName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath("pictures/fighter-top-32x32.bmp");
    260260  if (!iconName.empty())
    261261  {
     
    341341  if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "")
    342342  {
    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)))
    345345    {
    346346      PRINTF(1)("Data Could not be located in %s\n", dataPath.c_str());
    347347    }
    348348  }
    349   while (!Resources::NewResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))
     349  while (!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))
    350350  {
    351351
    352352    PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
    353353              "!!!  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(),
    355355              this->configFileName.c_str(),
    356356              CONFIG_SECTION_GENERAL,
     
    361361      return(-1);
    362362    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, ""));
    364364  }
    365365
     
    367367
    368368  //! @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();
    382382  //  DynamicLoader::loadDyLib("libtest.so");
    383383  return 0;
  • branches/new_class_id/src/story_entities/game_world_data.cc

    r9833 r9836  
    2525
    2626#include "util/loading/game_loader.h"
    27 #include "util/loading/new_resource_manager.h"
     27#include "util/loading/resource_manager.h"
    2828
    2929#include "world_entity.h"
     
    379379  {
    380380    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);
    382382    this->music = new OrxSound::OggPlayer(oggFile);
    383383    if (this->localPlayer != NULL)
  • branches/new_class_id/src/story_entities/story_entity.cc

    r9833 r9836  
    2323
    2424#include "loading/load_param.h"
    25 #include "loading/new_resource_manager.h"
     25#include "loading/resource_manager.h"
    2626
    2727#include "debug.h"
     
    107107  }
    108108  else
    109     this->loadFile = Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
     109    this->loadFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    110110
    111111  this->grabWorldInfo();
  • branches/new_class_id/src/world_entities/bsp_entity.cc

    r9833 r9836  
    1717
    1818#include "debug.h"
    19 #include "loading/new_resource_manager.h"
     19#include "loading/resource_manager.h"
    2020
    2121#include "class_id_DEPRECATED.h"
     
    7171
    7272  // Check wether file exists....
    73   if ( File(Resources::NewResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists()  ) {
     73  if ( File(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists()  ) {
    7474
    7575    this->bspManager = new BspManager(this);
  • branches/new_class_id/src/world_entities/terrain.cc

    r9833 r9836  
    1818#include "terrain.h"
    1919
    20 #include "util/loading/new_resource_manager.h"
     20#include "util/loading/resource_manager.h"
    2121#include "util/loading/load_param.h"
    2222#include "util/loading/factory.h"
     
    144144  this->heightMap = NULL;
    145145
    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);
    148148
    149149
  • branches/new_class_id/src/world_entities/world_entity.cc

    r9832 r9836  
    2020#include "shell_command.h"
    2121
    22 #include "util/loading/new_resource_manager.h"
     22#include "util/loading/resource_manager.h"
    2323#include "resource_obj.h"
    2424#include "md2/md2Model.h"
     
    162162  std::string name = fileName;
    163163
    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());
    167167  }
    168168
     
    180180      {
    181181        lodFile[offset] = 48+(int)i;
    182         if (Resources::NewResourceManager::getInstance()->checkFileInMainPath( lodFile))
     182        if (Resources::ResourceManager::getInstance()->checkFileInMainPath( lodFile))
    183183          this->loadModel(lodFile, scaling, i);
    184184      }
     
    220220    {
    221221      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);
    224224
    225225      //       if( m != NULL)
Note: See TracChangeset for help on using the changeset viewer.