Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2006, 10:17:56 AM (18 years ago)
Author:
bensch
Message:

more nice comments, and also updated the KeepLevel loading (if you want to load a Resource to a KeepLevel just append it at loadtime:
eg.:
Texture tex = ResourceTexture(orxonox.png, GL_TEXTURE_2D, GameEnd);
where GameEnd is the KeepLevel as defined in orxonox.cc→initResources()

File:
1 edited

Legend:

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

    r9851 r9854  
    1717    ObjectListDeclaration(ResourceManager);
    1818  public:
     19    ///////////////////////
     20    //// INSTANZIATION ////
    1921    /** @returns a Pointer to the only object of this Class */
    2022    inline static ResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new ResourceManager();  return _singletonRef; };
     
    2224    inline static void deleteInstance() { if (_singletonRef) delete _singletonRef; };
    2325
    24 
     26    ////////////////////////
     27    //// RESOURCE PATHS ////
    2528    void setMainGlobalPath(const Directory& directory);
    2629    void addGlobalPath(const Directory& directory);
     
    3134    void unregisterType(Resources::Type* type);
    3235
    33     unsigned int addKeepLevelName(const std::string& keepLevelName);
    34     unsigned int getKeepLevelID(const std::string& keepLevelName) const;
    35     const std::string& getKeepLevelName(unsigned int keepLevelID) const;
    36 
    37     /** @returns the Types of Resources */
    38     const std::vector<Resources::Type*> resourceTypes() const { return _resourceTypes; };
    3936    /** @returns the main global search Path */
    4037    const Directory& mainGlobalPath() const { return _mainGlobalPath; };
     
    4239    const std::vector<Directory>& globalPaths() const { return _globalPaths; };
    4340
     41    ////////////////////
     42    //// KEEPLEVELS ////
     43    unsigned int addKeepLevelName(const std::string& keepLevelName);
     44    unsigned int getKeepLevelID(const std::string& keepLevelName) const;
     45    const std::string& getKeepLevelName(unsigned int keepLevelID) const;
     46    void setDefaultKeepLevel(const KeepLevel& keepLevel) { this->_defaultKeepLevel = keepLevel; };
     47    const KeepLevel& defaultKeepLevel() const { return this->_defaultKeepLevel; };
     48
     49    //////////////////////////
     50    //// GENERAL QUERIES ////
     51    /** @returns the Types of Resources */
     52    const std::vector<Resources::Type*> resourceTypes() const { return _resourceTypes; };
    4453
    4554    bool checkFileInMainPath(const File& fileInside);
    4655    std::string prependAbsoluteMainPath(const std::string& fileName);
    4756
     57    ////////////////////////////////////////
     58    //// RESOURCE LOADING AND UNLOADING ////
     59    void loadFromLoadString(const std::string& resourceTypeName, const std::string& loadString, const KeepLevel& keepLevel = KeepLevel());
     60    void loadFromLoadStringHACK(const std::string& resourceTypeName, const std::string& loadString) { this->loadFromLoadString(resourceTypeName, loadString); };
     61
    4862    void unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel);
    4963    void unloadAllBelowKeepLevelINT(unsigned int level) { unloadAllBelowKeepLevel(level); };
    50     void loadFromLoadString(const std::string& resourceTypeName, const std::string& loadString);
    5164
     65    ///////////////
     66    //// DEBUG ////
    5267    void debug() const;
    5368
    54     // utility functions for handling files in and around the data-directory
    55     static std::string getFullName(const std::string& fileName);
    56     static bool isInDataDir(const std::string& fileName);
    5769  private:
    5870    ResourceManager();
     
    6678
    6779    std::vector<Resources::Type*>      _resourceTypes;      //!< A Vector of all the stored ResourceTypes @see Resources::Type
     80
    6881    std::vector<std::string>           _keepLevelNames;     //!< Names of KeepLevels @see Resources::KeepLevel
     82    KeepLevel                          _defaultKeepLevel;   //!< The default KeepLevel.
    6983  };
    7084
Note: See TracChangeset for help on using the changeset viewer.