Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6650 in orxonox.OLD for trunk/src/util/loading


Ignore:
Timestamp:
Jan 21, 2006, 7:16:30 PM (19 years ago)
Author:
bensch
Message:

trunk: cache bools

Location:
trunk/src/util/loading
Files:
2 edited

Legend:

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

    r6648 r6650  
    299299 * @see load;
    300300 *
     301 * @brief returns true if ok, false otherwise.
    301302 * This function loads a Resource without applying it to an Object.
    302303 * This is for loading purposes, e.g, when the user is loading a Resource
    303304 * during the initialisation instead of at Runtime.
    304305 */
    305 void ResourceManager::cache(const char* fileName, ResourceType type, ResourcePriority prio,
     306bool ResourceManager::cache(const char* fileName, ResourceType type, ResourcePriority prio,
    306307                            const MultiType& param0, const MultiType& param1, const MultiType& param2)
    307308{
     
    317318  // return cached pointer.
    318319  if (tmpResource != NULL) // if the resource was loaded before.
     320  {
    319321    if(tmpResource->prio < prio)
    320322      tmpResource->prio = prio;
     323    return true;
     324  }
     325  else
     326    return false;
    321327}
    322328
     
    799805                RP_LEVEL);
    800806  else if (splits.getCount() == 3)
    801     this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
     807    return this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
    802808                RP_LEVEL, splits[2]);
    803809  else if (splits.getCount() == 4)
    804     this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
     810    return this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
    805811                RP_LEVEL, splits[2], splits[3]);
    806812  else if (splits.getCount() == 5)
    807     this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
     813    return this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]),
    808814                RP_LEVEL, splits[2], splits[3], splits[4]);
    809815}
  • trunk/src/util/loading/resource_manager.h

    r6649 r6650  
    105105  bool addImageDir(const char* imageDir);
    106106
    107   void cache(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
     107  bool cache(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
    108108             const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
    109109
Note: See TracChangeset for help on using the changeset viewer.