Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

trunk: cache bools

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.