Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jan 21, 2006, 4:56:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: totally remastered the ResourceManager.
Now it takes MultiTypes instead of (void*) as parameters

  1. This is TypeSafe
  2. This is easier to use
  3. This makes much more sense, and is objectOriented

also made some minor adjustments to the MultiType, some comparisons

also fixed the loading in all the Other classes like material md2 and so on

File:
1 edited

Legend:

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

    r6642 r6645  
    2121
    2222#include "base_object.h"
    23 
     23#include "multi_type.h"
    2424
    2525#include <vector>
     
    7474  ResourcePriority  prio;              //!< The Priority of this resource. (This will only be increased)
    7575
    76   // more specific
    77   union {
    78 #ifndef NO_MODEL
    79   float             modelSize;         //!< the size of the model (OBJ/PRIM)
    80   char*             secFileName;       //!< a seconf fileName
    81 #endif /* NO_MODEL */
    82 #ifndef NO_TEXT
    83   unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
    84 #endif /* NO_TEXT */
    85 #ifndef NO_TEXTURES
    86   GLenum            texTarget;
    87 #endif /* NO_TEXTURES */
    88   };
     76  MultiType         param[3];          //!< The Parameters given to this Resource.
    8977};
    9078
     
    117105
    118106  void cache(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
    119              void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     107             const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
    120108
    121109  BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO,
    122                void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     110                   const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
    123111  BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
    124                void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     112                   const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
    125113  bool unload(void* pointer, ResourcePriority prio = RP_NO);
    126114  bool unload(Resource* resource, ResourcePriority = RP_NO);
    127115  bool unloadAllByPriority(ResourcePriority prio);
    128116
    129   Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3) const;
     117  Resource* locateResourceByInfo(const char* fileName, ResourceType type,
     118                                 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()) const;
    130119  Resource* locateResourceByPointer(const void* pointer) const;
    131120
     
    148137  ResourceManager();
    149138  Resource* loadResource(const char* fileName, ResourceType type, ResourcePriority prio,
    150                      void* param1, void* param2, void* param3);
     139                         const MultiType& param0, const MultiType& param1, const MultiType& param2);
    151140
    152141 private:
Note: See TracChangeset for help on using the changeset viewer.