Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4139 in orxonox.OLD for orxonox/branches/md2_loader/src/util


Ignore:
Timestamp:
May 10, 2005, 10:39:01 AM (19 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: merged trunk into branche using: svn merge ../trunk/ md2_loader -r 4063:HEAD

Location:
orxonox/branches/md2_loader/src/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/util/object_manager.h

    r4127 r4139  
    1616#include "base_object.h"
    1717
     18#define OM_
     19
     20class WorldEntity;
     21
     22
     23template<class T> class tList;
    1824
    1925//! the object manager itself
     
    2430  virtual ~ObjectManager(void);
    2531
     32  void preLoad();
     33
    2634 private:
    2735  ObjectManager(void);
    2836  static ObjectManager* singletonRef;
     37
     38  tList<WorldEntity>* projectileBuffer;            //!< a list of projectiles that is generated at the beginning to make orx faster
     39
     40
    2941};
    3042
  • orxonox/branches/md2_loader/src/util/resource_manager.cc

    r4065 r4139  
    100100      return false;
    101101    }
     102}
     103
     104/**
     105   \brief checks for the DataDirectory, by looking if
     106   \param fileInside is inisde??
     107*/
     108bool ResourceManager::checkDataDir(const char* fileInside)
     109{
     110  bool retVal;
     111  if (!isDir(this->dataDir))
     112    {
     113      PRINTF(1)("%s is not a directory\n", this->dataDir);
     114      return false;
     115    }
     116 
     117  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
     118  sprintf(testFile, "%s%s", this->dataDir, fileInside);
     119  retVal = isFile(testFile);
     120  delete testFile;
     121  return retVal;
    102122}
    103123
     
    183203  // searching if the resource was loaded before.
    184204  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
    185   if (tmpResource) // if the resource was not loaded before.
     205  if (tmpResource) // if the resource was loaded before.
    186206    {
    187207      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
     
    202222
    203223      // creating the full name. (directoryName + FileName)
    204       char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
    205       sprintf(fullName, "%s%s", this->dataDir, fileName);
    206      
     224      char* fullName = new char[strlen(this->getDataDir())+strlen(fileName)+1];
     225      sprintf(fullName, "%s%s", this->getDataDir(), fileName);
    207226      // Checking for the type of resource \see ResourceType
    208227      switch(type)
     
    214233            tmpResource->modelSize = 1.0;
    215234
    216           if(isFile(fullName))
     235          if(ResourceManager::isFile(fullName))
    217236            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
    218237          else
  • orxonox/branches/md2_loader/src/util/resource_manager.h

    r4063 r4139  
    6565
    6666  bool setDataDir(const char* dataDir);
     67  /** \returns the Name of the data directory */
     68  inline const char*  getDataDir(void) {return this->dataDir;}
     69  bool checkDataDir(const char* fileInside);
    6770  bool addImageDir(char* imageDir);
    6871  void* load(const char* fileName, ResourcePriority prio = RP_NO,
Note: See TracChangeset for help on using the changeset viewer.