Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 24, 2006, 12:06:35 PM (18 years ago)
Author:
bensch
Message:

ResourceManager now cleans up too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9798 r9799  
    4444std::string NewResource::locateFile(const std::string& fileName) const
    4545{
    46   if (File(fileName).exists())
    47     return fileName;
    48   else if ((NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() )
     46  if ((NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() )
    4947    return (NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
    5048
     
    5654    return locatedFile;
    5755  }
     56
     57  if (File(fileName).exists())
     58    return fileName;
    5859
    5960  return (NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
     
    114115}
    115116
     117const std::string& Resources::KeepLevel::name() const
     118{
     119  return NewResourceManager::getInstance()->getKeepLevelName(this->_keepLevel);
     120}
     121
    116122
    117123
     
    134140  NewResourceManager::getInstance()->registerType(this);
    135141  PRINTF(4)("Created ResourceType '%s'\n", typeName.c_str());
     142}
     143
     144Resources::Type::~Type()
     145{
     146  NewResourceManager::getInstance()->unregisterType(this);
    136147}
    137148
     
    176187  for (unsigned int i = 0; i < this->_resourcePaths.size(); ++i)
    177188    PRINT(0)("    %s\n", this->_resourcePaths[i].name().c_str());
    178   PRINT(0)("  Sub-Paths:\n");
     189  PRINT(0)("  Sub-Paths:");
    179190  for (unsigned int i = 0; i < this->_resourceSubPaths.size(); ++i)
    180     PRINT(0)("    %s\n", this->_resourceSubPaths[i].name().c_str());
     191    PRINT(0)(" '%s'", this->_resourceSubPaths[i].name().c_str());
     192  PRINT(0)("\n");
    181193
    182194}
Note: See TracChangeset for help on using the changeset viewer.