Changeset 5305 in orxonox.OLD for trunk/src/lib/graphics/importer
- Timestamp:
- Oct 7, 2005, 3:34:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture.cc
r5304 r5305 36 36 this->bAlpha = false; 37 37 this->texture = 0; 38 if (imageName )38 if (imageName != NULL) 39 39 this->loadImage(imageName); 40 40 } … … 146 146 if (GraphicsEngine::texturesEnabled) 147 147 { 148 if (imageName )148 if (imageName != NULL) 149 149 { 150 150 SDL_Surface* tmpSurf; … … 153 153 // load the new Image to memory 154 154 tmpSurf = IMG_Load(imageName); 155 if( !tmpSurf)155 if(tmpSurf == NULL) 156 156 { 157 157 PRINTF(1)("IMG_Load: %s\n", IMG_GetError()); 158 this->texture = 0; 158 159 return false; 159 160 } 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); 165 164 loadTexToGL(tmpSurf); 166 167 168 SDL_FreeSurface(tmpSurf); 169 return true; 165 SDL_FreeSurface(tmpSurf); 166 return true; 167 } 170 168 } 171 169 else 172 170 { 173 PRINTF(2)("Image not Found: %s\n", imageName);174 171 return false; 175 172 } 176 173 } 174 return false; 177 175 }
Note: See TracChangeset
for help on using the changeset viewer.