Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 23, 2006, 10:34:42 AM (18 years ago)
Author:
bensch
Message:

added new_resource_manager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9789 r9790  
    5353  {
    5454  public:
    55     Type(const ClassID& classID) : _id(-1), _classID(classID) { };
     55    Type(const ClassID& classID);
     56    bool operator==(const ClassID& classID) const { return this->_classID == classID; };
     57    bool operator==(const std::string& resourceName) const { return this->_classID.name() == resourceName; };
    5658
    5759    void addExtension(const std::string& extension);
    5860
    59     void addResourcePath(const std::string& path);
    60     void addResourceSubPath(const std::string& subPath);
     61    bool addResourcePath(const std::string& path);
     62    bool addResourceSubPath(const std::string& subPath);
    6163
    6264    /// Retrieve Functions
    6365    const ClassID& storedClassID() const { return _classID; };
    6466    int id() const { return _id; };
    65     const std::vector<std::string>& resourcePaths() const { return _resourcePaths; };
    66     const std::vector<std::string>& resourceSubPaths() const { return _resourceSubPaths; };
     67    const std::vector<Directory>& resourcePaths() const { return _resourcePaths; };
     68    const std::vector<Directory>& resourceSubPaths() const { return _resourceSubPaths; };
    6769    const std::vector<NewResource::StorePointer*>& storedResources() const { return _storedResources; };
    6870
     
    7375    int                             _id;
    7476    const ClassID&                  _classID;
    75     std::vector<std::string>        _resourcePaths;
    76     std::vector<std::string>        _resourceSubPaths;
     77    std::vector<Directory>          _resourcePaths;
     78    std::vector<Directory>          _resourceSubPaths;
    7779    std::vector<std::string>        _fileExtensions;
    7880
     
    8890  virtual bool unload() { return false; };
    8991
    90   std::string locateFile(const std::string& fileName);
     92  std::string locateFile(const std::string& fileName) const;
    9193
    9294
     
    9597  static void addGlobalPath(const Directory& directory);
    9698
     99  static bool addResourcePath(const std::string& resourceName, const std::string& pathName);
     100  static bool addResourceSubPath(const std::string& resourceName, const std::string& pathName);
    97101
     102  static void registerType(NewResource::Type* type);
     103
     104  static void debug();
    98105protected:
    99106  NewResource::StorePointer* acquireResource(const std::string& loadString);
     
    101108
    102109private:
     110  std::string locateFileInSubDir(const Directory& directory, const std::string& fileName) const;
     111
     112private:
    103113  NewResource::StorePointer*       _pointer;                         //!< Virtual Pointer to the ResourceData.
    104   NewResource::Type*          _type;                            //!< Type of the NewResource.
     114  NewResource::Type*               _type;                            //!< Type of the NewResource.
    105115
    106116
    107   static std::vector<NewResource::Type*>    _resourceTypes;
     117  static std::vector<NewResource::Type*>  _resourceTypes;
    108118
    109119  //! GLOBALS
Note: See TracChangeset for help on using the changeset viewer.