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.h

    r9852 r9854  
    2626  {
    2727  public:
    28     /** @param keepLevel the level to set. */
    29     inline KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; };
     28    KeepLevel();
     29    KeepLevel(unsigned int keepLevel);
    3030    KeepLevel(const std::string& keepLevelName);
    3131
     
    9393    bool operator==(const std::string& typeName) const { return this->_typeName == typeName; };
    9494
     95    ////////////////////
     96    //// EXTENSIONS ////
    9597    void addExtension(const std::string& extension);
    9698
     99    ///////////////
     100    //// PATHS ////
    97101    bool addResourcePath(const std::string& path);
    98102    bool addResourceSubPath(const std::string& subPath);
     
    109113    const std::vector<Resources::StorePointer*>& storedResources() const { return _storedResources; };
    110114
    111     virtual void createFromString(const std::string& loadString) = 0;
    112 
     115    ///////////////////////////////
     116    //// LOADING AND UNLOADING ////
     117    virtual void createFromString(const std::string& loadString, const KeepLevel& keepLevel = KeepLevel()) = 0;
    113118    void unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel);
    114119
     120    ///////////////////
     121    //// INTERNALS ////
    115122    void addResource(Resources::StorePointer* resource);
    116123
     124    ///////////////
     125    //// DEBUG ////
    117126    void debug() const;
    118127
     
    144153    tType(const std::string& typeName) : Type(typeName) {};
    145154    /** @param loadString the String to load a Resource with @brief tries to create a Resource of Type T with a loadString */
    146     virtual void createFromString(const std::string& loadString) { T::createFromString(loadString); }
     155    virtual void createFromString(const std::string& loadString, const KeepLevel& keepLevel = KeepLevel()) { T::createFromString(loadString, keepLevel); }
    147156  };
    148157
Note: See TracChangeset for help on using the changeset viewer.