Changeset 3087 in orxonox.OLD for orxonox/branches/images/importer
- Timestamp:
- Dec 4, 2004, 7:02:56 PM (20 years ago)
- Location:
- orxonox/branches/images/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/images/importer/material.cc
r3086 r3087 157 157 void Material::setName (char* mtlName) 158 158 { 159 //if (verbose >= 3)159 if (verbose >= 3) 160 160 printf("setting Material Name to %s.\n", mtlName); 161 161 name = new char [strlen(mtlName)]; … … 320 320 321 321 // diffuseTextureSet = loadBMP(dMap, &diffuseTexture); 322 diffuseTextureSet = load JPG(dMap, &diffuseTexture);322 diffuseTextureSet = loadImage(dMap, &diffuseTexture); 323 323 324 324 } … … 350 350 void Material::setBump(char* bump) 351 351 { 352 353 } 354 355 /** 356 \brief Makes the Programm ready to Read-in a texture-File 357 1. Checks what type of Image should be imported 358 2. ToDO: Checks where to find the Image 359 */ 360 bool Material::loadImage(char* imageName, GLuint* texture) 361 { 362 if (!strncmp(imageName+strlen(imageName)-4, ".bmp", 4)) 363 { 364 if (verbose >=2) 365 printf ("Requested bmp-image. Trying to Import.\n"); 366 return loadBMP(imageName, texture); 367 } 368 369 else if (!strncmp(imageName+strlen(imageName)-4, ".jpg", 4) || !strncmp(imageName+strlen(imageName)-5, ".jpg", 5)) 370 { 371 if (verbose >=2) 372 printf ("Requested jpeg-image. Trying to Import\n"); 373 return loadJPG(imageName, texture); 374 } 375 else 376 { 377 if (verbose >=1) 378 printf ("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imageName); 379 return false; 380 } 352 381 353 382 } -
orxonox/branches/images/importer/material.h
r3086 r3087 85 85 86 86 // TEXTURING 87 bool loadImage(char* imageName, GLuint* texture); 88 87 89 bool loadBMP (char* bmpName, GLuint* texture); 90 88 91 bool loadJPG (char* jpgName, GLuint* texture); 89 92 void decodeJPG(jpeg_decompress_struct* cinfo, tImageJPG *pImageData);
Note: See TracChangeset
for help on using the changeset viewer.