Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5366 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Oct 12, 2005, 1:23:08 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more definitions of GLGui.
also a patch to the resource-manager

File:
1 edited

Legend:

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

    r5346 r5366  
    217217BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
    218218{
     219  if (fileName == NULL)
     220    return NULL;
    219221  ResourceType tmpType;
    220222#ifndef NO_MODEL
     
    284286                            void* param1, void* param2, void* param3)
    285287{
     288  if (fileName == NULL)
     289    return NULL;
     290
    286291  // searching if the resource was loaded before.
    287292  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
     
    320325          else
    321326            {
    322               PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
     327              PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir);
    323328              tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
    324329            }
     
    461466bool ResourceManager::unload(void* pointer, ResourcePriority prio)
    462467{
     468  if (pointer == NULL)
     469    return false;
    463470  // if pointer is existent. and only one resource of this type exists.
    464471  Resource* tmpResource = this->locateResourceByPointer(pointer);
    465   if (tmpResource == NULL)
    466     {
    467       PRINTF(2)("Resource not Found %p\n", pointer);
    468       return false;
    469     }
    470   else
     472  if (tmpResource != NULL)
    471473    return unload(tmpResource, prio);
     474  else
     475  {
     476    PRINTF(2)("Resource not Found %p\n", pointer);
     477    return false;
     478  }
    472479}
    473480
Note: See TracChangeset for help on using the changeset viewer.