Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3677 in orxonox.OLD for orxonox/trunk/src/lib/util


Ignore:
Timestamp:
Mar 30, 2005, 6:15:46 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: more output info, some fixes in resourceManager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/util/resource_manager.cc

    r3676 r3677  
    175175  // searching if the resource was loaded before.
    176176  Resource* tmpResource = this->locateResourceByName(fileName);
    177   if (!tmpResource) // if the resource was not loaded before.
     177  if (tmpResource) // if the resource was not loaded before.
     178    {
     179      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
     180      tmpResource->count++;
     181      if(tmpResource->prio < prio)
     182        tmpResource->prio = prio;
     183    }
     184  else
    178185    {
    179186      char* tmpDir;
     
    252259      delete []fullName;
    253260    }
    254   else
    255     {
    256       PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
    257       tmpResource->count++;
    258       if(tmpResource->prio < prio)
    259         tmpResource->prio = prio;
    260     }
    261261
    262262  return tmpResource->pointer;
     
    330330    {
    331331      if (enumRes->prio <= prio)
    332         unload(enumRes, prio);
     332        if (enumRes->count == 0)
     333          unload(enumRes, prio);
     334        else
     335          PRINTF(2)("unable to unload %s because there are still %d references to it\n",
     336                   enumRes->name, enumRes->count);
    333337      //enumRes = resourceList->nextElement();
    334338      enumRes = iterator->nextElement();
Note: See TracChangeset for help on using the changeset viewer.