Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

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

    r4534 r4597  
    1 /*! 
     1/*!
    22    \file resource_manager.h
    33    \brief The Resource Manager checks if a file/resource is loaded.
    44
    5     If a file/resource was already loaded the resourceManager will 
     5    If a file/resource was already loaded the resourceManager will
    66    return a void pointer to the desired resource.
    77    Otherwise it will instruct the coresponding resource-loader to load,
     
    99
    1010    it is possible to compile the resource Manager without some modules by
    11     just adding the compile flag -D.... 
     11    just adding the compile flag -D....
    1212    (NO_MODEL)
    1313    (NO_AUDIO)
     
    2323#include "stdlibincl.h"
    2424
    25 // FORWARD DEFINITION 
     25// FORWARD DEFINITION
    2626template<class T> class tList;
    2727
    2828//! An eumerator for different fileTypes the resourceManager supports
    29 typedef enum ResourceType {
     29typedef enum ResourceType
     30{
    3031#ifndef NO_MODEL
    3132  OBJ,                  //!< loading .obj file
     
    4647};
    4748
    48 //! An enumerator for different UNLOAD-types. 
     49//! An enumerator for different UNLOAD-types.
    4950/**
    5051   RP_NO:        will be unloaded on request
     
    5354   RP_GAME:      will be unloaded at the end of the whole Game (when closing orxonox)
    5455*/
    55 typedef enum ResourcePriority { RP_NO        =   0,
    56                                 RP_LEVEL     =   1,
    57                                 RP_CAMPAIGN  =   2,
    58                                 RP_GAME      =   4 };
     56typedef enum ResourcePriority
     57{
     58  RP_NO        =   0,
     59  RP_LEVEL     =   1,
     60  RP_CAMPAIGN  =   2,
     61  RP_GAME      =   4
     62};
    5963
    6064//! A Struct that keeps track about A resource its name its Type, and so on
     
    6367  void*             pointer;           //!< Pointer to the Resource.
    6468  int               count;             //!< How many times this Resource has been loaded.
    65  
     69
    6670  char*             name;              //!< Name of the Resource.
    6771  ResourceType      type;              //!< ResourceType of this Resource.
     
    8488//! The ResourceManager is a class, that decides if a file/resource should be loaded
    8589/**
    86    If a file/resource was already loaded the resourceManager will 
     90   If a file/resource was already loaded the resourceManager will
    8791   return a void pointer to the desired resource.
    8892   Otherwise it will instruct the corresponding resource-loader to load,
     
    9195   It does it by looking, if a desired file has already been loaded.
    9296*/
    93 class ResourceManager : public BaseObject 
     97class ResourceManager : public BaseObject
    9498{
    9599 public:
     
    105109  bool addImageDir(const char* imageDir);
    106110  void* load(const char* fileName, ResourcePriority prio = RP_NO,
    107              void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     111             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
    108112  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
    109              void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     113             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
    110114  bool unload(void* pointer, ResourcePriority prio = RP_NO);
    111115  bool unload(Resource* resource, ResourcePriority = RP_NO);
    112116  bool unloadAllByPriority(ResourcePriority prio);
    113  
     117
    114118  void debug(void);
    115  
     119
    116120
    117121  // utility functions of this class
     
    127131
    128132  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
    129   Resource* locateResourceByPointer(const void* pointer); 
     133  Resource* locateResourceByPointer(const void* pointer);
    130134
    131135 private:
Note: See TracChangeset for help on using the changeset viewer.