Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4166 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 11, 2005, 3:07:34 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: resourceManager has some new functions

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/subprojects/benchmark.cc

    r4131 r4166  
    463463#else
    464464
     465#include "debug.h"
     466
    465467int startBenchmarks()
    466468{
  • orxonox/trunk/src/track_manager.cc

    r4017 r4166  
    2929
    3030using namespace std;
    31 
    32 CREATE_FACTORY(TrackManager);
    3331
    3432/**
     
    405403
    406404*/
    407 TrackManager::TrackManager( TiXmlElement* root)
     405bool TrackManager::load( TiXmlElement* root)
    408406{
    409407
  • orxonox/trunk/src/track_manager.h

    r4017 r4166  
    153153  static TrackManager* getInstance(void);
    154154
    155   TrackManager(TiXmlElement* root);
     155  bool load(TiXmlElement* root);
    156156
    157157  // Methods to change the Path (initialisation)
  • orxonox/trunk/src/util/resource_manager.cc

    r4116 r4166  
    584584}
    585585
     586/**
     587   \brief touches a File on the disk (thereby creating it)
     588   \param fileName The file to touch
     589*/
    586590bool ResourceManager::touchFile(const char* fileName)
    587591{
     
    599603}
    600604
     605/**
     606   \brief deletes a File from disk
     607   \param fileName the File to delete
     608*/
    601609bool ResourceManager::deleteFile(const char* fileName)
    602610{
     
    606614}
    607615
     616/**
     617    \param fileName the Name of the file to check
     618    \returns The name of the file, including the HomeDir
     619    IMPORTANT: this has to be deleted from the outside
     620*/
    608621char* ResourceManager::homeDirCheck(const char* name)
    609622{
     
    628641}
    629642
     643/**
     644    \param fileName the Name of the File to check
     645    \returns The full name of the file, including the DataDir
     646    IMPORTANT: this has to be deleted from the outside
     647*/
     648char* ResourceManager::getFullName(const char* fileName)
     649{
     650  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(fileName)+1];
     651  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
     652  return retName;
     653}
    630654
    631655
  • orxonox/trunk/src/util/resource_manager.h

    r4115 r4166  
    1818
    1919//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
    20 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
     20enum ResourceType {OBJ,
     21                   PRIM,
     22                   WAV,
     23                   MP3,
     24                   OGG,
     25                   TTF,
     26                   IMAGE};
    2127//! An enumerator for different UNLOAD-types.
    2228/**
     
    2632   RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox)
    2733*/
    28 enum ResourcePriority {RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3};
     34enum ResourcePriority {RP_NO = 0,
     35                       RP_LEVEL = 1,
     36                       RP_CAMPAIGN = 2,
     37                       RP_GAME = 3};
    2938
    3039//! A Struct that keeps track about A resource its name its Type, and so on
     
    6675  bool setDataDir(const char* dataDir);
    6776  /** \returns the Name of the data directory */
    68   inline const char*  getDataDir(void) {return this->dataDir;}
     77  inline const char* getDataDir(void) const {return this->dataDir;}
     78
    6979  bool checkDataDir(const char* fileInside);
    7080  bool addImageDir(char* imageDir);
     
    8494  static bool touchFile(const char* fileName);
    8595  static bool deleteFile(const char* fileName);
    86   static char* homeDirCheck(const char* name);
     96  static char* homeDirCheck(const char* fileName);
     97  static char* getFullName(const char* fileName);
    8798
    8899 private:
Note: See TracChangeset for help on using the changeset viewer.