Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Oct 8, 2005, 6:52:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better algorithm for loading the Shader through the ResourceManager
if a fragment-Shader was supplied, but the file did not exist, the Shader gets rejected

File:
1 edited

Legend:

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

    r5323 r5324  
    387387            if(ResourceManager::isFile(fullName))
    388388            {
    389               char* secFullName = NULL;
    390389              if (param1 != NULL)
    391390              {
    392                 secFullName = ResourceManager::getFullName((const char*)param1);
    393                 printf("%s\n", secFullName);
     391                char* secFullName = ResourceManager::getFullName((const char*)param1);
    394392                if (ResourceManager::isFile(secFullName))
    395393                {
    396                   printf("ok:: %s\n", secFullName);
    397394                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
    398395                  strcpy(tmpResource->secFileName, (const char*) param1);
     396                  tmpResource->pointer = new Shader(fullName, secFullName);
    399397                }
    400                 else
    401                 {
    402                   delete[] secFullName;
    403                   secFullName = NULL;
    404                   tmpResource->secFileName = NULL;
    405                 }
     398                delete secFullName;
    406399              }
    407400              else
     401              {
    408402                tmpResource->secFileName = NULL;
    409               printf("%s::%s\n", fullName, secFullName);
    410               tmpResource->pointer = new Shader(fullName, secFullName);
    411               if (secFullName != NULL)
    412                 delete[] secFullName;
     403                tmpResource->pointer = new Shader(fullName, NULL);
     404              }
    413405            }
    414406            break;
Note: See TracChangeset for help on using the changeset viewer.