Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5305 in orxonox.OLD


Ignore:
Timestamp:
Oct 7, 2005, 3:34:01 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better implementation of the Texture-loading

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/texture.cc

    r5304 r5305  
    3636  this->bAlpha = false;
    3737  this->texture = 0;
    38   if (imageName)
     38  if (imageName != NULL)
    3939    this->loadImage(imageName);
    4040}
     
    146146  if (GraphicsEngine::texturesEnabled)
    147147    {
    148       if (imageName)
     148      if (imageName != NULL)
    149149        {
    150150          SDL_Surface* tmpSurf;
     
    153153          // load the new Image to memory
    154154          tmpSurf = IMG_Load(imageName);
    155           if(!tmpSurf)
     155          if(tmpSurf == NULL)
    156156            {
    157157              PRINTF(1)("IMG_Load: %s\n", IMG_GetError());
     158              this->texture = 0;
    158159              return false;
    159160            }
    160 
    161           GLubyte* pixels = (GLubyte*)tmpSurf->pixels;
    162 
    163           PRINTF(3)("loading Image %s\n", imageName);
    164           if (tmpSurf)
     161          else
     162          {
     163            PRINTF(3)("loading Image %s\n", imageName);
    165164            loadTexToGL(tmpSurf);
    166 
    167 
    168           SDL_FreeSurface(tmpSurf);
    169           return true;
     165            SDL_FreeSurface(tmpSurf);
     166            return true;
     167          }
    170168        }
    171169      else
    172170        {
    173           PRINTF(2)("Image not Found: %s\n", imageName);
    174171          return false;
    175172        }
    176173    }
     174    return false;
    177175}
  • trunk/src/story_entities/campaign.cc

    r5300 r5305  
    144144      if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) )
    145145        {
    146           PRINTF(0)("Quitting campaing story loop\n");
     146          PRINTF(4)("Quitting campaing story loop\n");
    147147          if(se != NULL)
    148148            delete se;
Note: See TracChangeset for help on using the changeset viewer.