Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3667 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Mar 30, 2005, 10:59:02 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: changed all old enumerations to iterations in ResourceManager. Bensch: sorry for interference, since i didn't change anything realy its no big deal.

File:
1 edited

Legend:

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

    r3666 r3667  
    222222          else
    223223            {
    224               tmpDir = imageDirs->enumerate();
     224              tIterator<char>* iterator = imageDirs->getIterator();
     225              tmpDir = iterator->nextElement();
     226              //tmpDir = imageDirs->enumerate();
    225227              while(tmpDir)
    226228                {
     
    230232                    tmpResource->pointer = new Texture(imgName);
    231233                  delete []imgName;
    232                   tmpDir = imageDirs->nextElement();
     234                  tmpDir = iterator->nextElement();
    233235                }
     236              delete iterator;
    234237            }
    235238          if(!tmpResource)
     
    326329
    327330  tIterator<Resource>* iterator = resourceList->getIterator();
    328   //Resource* enumRes = resourceList->enumerate();
    329331  Resource* enumRes = iterator->nextElement();
    330332  while (enumRes)
     
    345347Resource* ResourceManager::locateResourceByName(const char* fileName)
    346348{
    347   Resource* enumRes = resourceList->enumerate();
     349  //  Resource* enumRes = resourceList->enumerate();
     350  tIterator<Resource>* iterator = resourceList->getIterator();
     351  Resource* enumRes = iterator->nextElement();
    348352  while (enumRes)
    349353    {
    350354      if (!strcmp(fileName, enumRes->name))
    351         return enumRes;
    352       enumRes = resourceList->nextElement();
    353     }
     355        {
     356          delete iterator;
     357          return enumRes;
     358        }
     359      enumRes = iterator->nextElement();
     360    }
     361  delete iterator;
    354362  return NULL;
    355363}
     
    362370Resource* ResourceManager::locateResourceByPointer(const void* pointer)
    363371{
    364   Resource* enumRes = resourceList->enumerate();
     372  //  Resource* enumRes = resourceList->enumerate();
     373  tIterator<Resource>* iterator = resourceList->getIterator();
     374  Resource* enumRes = iterator->nextElement();
    365375  while (enumRes)
    366376    {
    367377      if (pointer == enumRes->pointer)
    368         return enumRes;
    369       enumRes = resourceList->nextElement();
    370     }
     378        {
     379          delete iterator;
     380          return enumRes;
     381        }
     382      enumRes = iterator->nextElement();
     383    }
     384  delete iterator;
    371385  return NULL;
    372386}
Note: See TracChangeset for help on using the changeset viewer.