Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4465 in orxonox.OLD for orxonox/trunk/src/util/resource_manager.h


Ignore:
Timestamp:
Jun 2, 2005, 1:21:18 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: resource manager in new design :)
no no just kidding… only doxy-tags :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/resource_manager.h

    r4462 r4465  
    2020
    2121//! An eumerator for different fileTypes the resourceManager supports
    22 typedef enum ResourceType { OBJ,
    23                             PRIM,
    24                             MD2,
    25                             WAV,
    26                             MP3,
    27                             OGG,
    28                             TTF,
    29                             IMAGE };
     22typedef enum ResourceType { OBJ,          //!< loading .obj file
     23                            PRIM,         //!< loading primitive model
     24                            MD2,          //!< loading md2-file
     25                            WAV,          //!< loading wav
     26                            MP3,          //!< loading mp3
     27                            OGG,          //!< loading ogg
     28                            TTF,          //!< loading a TrueTypeFont
     29                            IMAGE };      //!< loading an image
    3030
    3131//! An enumerator for different UNLOAD-types.
     
    4444struct Resource
    4545{
    46   void* pointer;             //!< Pointer to the Resource.
    47   int count;                 //!< How many times this Resource has been loaded.
     46  void*             pointer;           //!< Pointer to the Resource.
     47  int               count;             //!< How many times this Resource has been loaded.
    4848 
    49   char* name;                //!< Name of the Resource.
    50   ResourceType type;         //!< ResourceType of this Resource.
    51   ResourcePriority prio;     //!< The Priority of this resource. (This will only be increased)
     49  char*             name;              //!< Name of the Resource.
     50  ResourceType      type;              //!< ResourceType of this Resource.
     51  ResourcePriority  prio;              //!< The Priority of this resource. (This will only be increased)
    5252
    5353  // more specific
    54   float modelSize;
    55   unsigned int ttfSize;
    56   unsigned char ttfColorR;
    57   unsigned char ttfColorG;
    58   unsigned char ttfColorB;
    59   char* skinFileName;
     54  float             modelSize;         //!< the size of the model (OBJ/PRIM)
     55  unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
     56  unsigned char     ttfColorR;         //!< red Color (TTF)
     57  unsigned char     ttfColorG;         //!< green Color (TTF)
     58  unsigned char     ttfColorB;         //!< blue Color (TTF)
     59  char*             skinFileName;      //!< skinFileName (MD2)
    6060};
    6161
     
    7373{
    7474 public:
     75  virtual ~ResourceManager();
     76
    7577  static ResourceManager* getInstance();
    76   virtual ~ResourceManager();
    7778
    7879  bool setDataDir(const char* dataDir);
     
    8990  bool unload(Resource* resource, ResourcePriority = RP_NO);
    9091  bool unloadAllByPriority(ResourcePriority prio);
    91 
     92 
    9293  void debug(void);
     94 
    9395
    9496  // utility functions of this class
     
    102104 private:
    103105  ResourceManager();
    104   static ResourceManager* singletonRef;
    105 
    106   tList<Resource>* resourceList;       //!< The List of Resources, that has already been loaded.
    107   char* dataDir;                       //!< The Data Directory, where all relevant Data is stored.
    108   tList<char>* imageDirs;              //!< A list of directories in which images are stored.
    109 
    110106
    111107  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
    112   Resource* locateResourceByPointer(const void* pointer);
    113  
     108  Resource* locateResourceByPointer(const void* pointer); 
     109
     110 private:
     111  static ResourceManager*  singletonRef;       //!< singleton Reference
     112
     113  tList<Resource>*         resourceList;       //!< The List of Resources, that has already been loaded.
     114  char*                    dataDir;            //!< The Data Directory, where all relevant Data is stored.
     115  tList<char>*             imageDirs;          //!< A list of directories in which images are stored.
     116
    114117};
    115118
Note: See TracChangeset for help on using the changeset viewer.