- Timestamp:
- May 3, 2006, 5:20:13 PM (19 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r7511 r7524 45 45 int size; 46 46 struct stat results; 47 name = "/ root/data/Kanti175.bsp";47 name = "/home/stefalie/svn/orxonox/data/Kanti175.bsp"; 48 48 49 49 if (stat( name , &results) == 0) { … … 384 384 // Check for tga 385 385 strcpy(fileName, &this->textures[8+ 72*i]); 386 strcpy (absFileName,"/ root/data/trunk/");386 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 387 387 strcpy(ext, ".tga"); 388 388 strncat (fileName, ext, strlen(fileName)); … … 397 397 // Check for TGA 398 398 strcpy(fileName, &this->textures[8+ 72*i]); 399 strcpy (absFileName,"/ root/data/trunk/");399 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 400 400 strcpy(ext, ".TGA"); 401 401 strncat (fileName, ext, strlen(fileName)); … … 410 410 // Check for jpg 411 411 strcpy(fileName, &this->textures[8+ 72*i]); 412 strcpy (absFileName,"/ root/data/trunk/");412 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 413 413 strcpy(ext, ".jpg"); 414 414 strncat (fileName, ext, strlen(fileName)); … … 424 424 // Check for JPG 425 425 strcpy(fileName, &this->textures[8+ 72*i]); 426 strcpy (absFileName,"/ root/data/trunk/");426 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 427 427 strcpy(ext, ".JPG"); 428 428 strncat (fileName, ext, strlen(fileName)); … … 437 437 // Check for jpeg 438 438 strcpy(fileName, &this->textures[8+ 72*i]); 439 strcpy (absFileName,"/ root/data/trunk/");439 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 440 440 strcpy(ext, ".jpeg"); 441 441 strncat (fileName, ext, strlen(fileName)); … … 451 451 // Check for JPEG 452 452 strcpy(fileName, &this->textures[8+ 72*i]); 453 strcpy (absFileName,"/ root/data/trunk/");453 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 454 454 strcpy(ext, ".JPEG"); 455 455 strncat (fileName, ext, strlen(fileName)); … … 465 465 // Check for bmp 466 466 strcpy(fileName, &this->textures[8+ 72*i]); 467 strcpy (absFileName,"/ root/data/trunk/");467 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 468 468 strcpy(ext, ".bmp"); 469 469 strncat (fileName, ext, strlen(fileName)); … … 479 479 // Check for BMP 480 480 strcpy(fileName, &this->textures[8+ 72*i]); 481 strcpy (absFileName,"/ root/data/trunk/");481 strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/"); 482 482 strcpy(ext, ".BMP"); 483 483 strncat (fileName, ext, strlen(fileName)); … … 485 485 // absFileName = ResourceManager::getFullName(fileName); 486 486 487 if( stat( absFileName , &results) == 0) {487 if(false /*stat( absFileName , &results) == 0*/) { 488 488 PRINTF(0)("BSP FILE: gefunden . \n"); 489 489 this->Materials[i] = this->loadMat(fileName); -
branches/bsp_model/src/lib/graphics/importer/material.cc
r7513 r7524 167 167 glActiveTexture(Material::glTextureArbs[i]); 168 168 glEnable(GL_TEXTURE_2D); 169 if(this->textures[i]->hasAlpha()) 170 { 171 glEnable(GL_BLEND); 172 } 169 173 glBindTexture(GL_TEXTURE_2D, this->textures[i]->getTexture()); 170 174 } … … 355 359 356 360 /** 361 * Sets the Materials Diffuse Map 362 * @param surface pointer to SDL_Surface which shall be used as texture 363 */ 364 void Material::setSDLDiffuseMap(SDL_Surface *surface, GLenum target, unsigned int textureNumber) 365 { 366 assert(textureNumber < Material::getMaxTextureUnits()); 367 368 369 if (this->textures.size() > textureNumber && this->textures[textureNumber] != NULL) 370 ResourceManager::getInstance()->unload(this->textures[textureNumber]); 371 372 if (this->textures.size() <= textureNumber) 373 this->textures.resize(textureNumber+1, NULL); 374 375 if(surface != NULL) 376 { 377 this->textures[textureNumber] = &Texture(surface, GL_TEXTURE_2D); 378 } 379 else 380 { 381 this->textures[textureNumber] = NULL; 382 } 383 384 } 385 386 387 /** 357 388 * Sets the Materials Ambient Map 358 389 * @param aMap the Name of the Image to Use -
branches/bsp_model/src/lib/graphics/importer/material.h
r7513 r7524 10 10 #include "base_object.h" 11 11 12 12 13 #if HAVE_CONFIG_H 13 14 #include <config.h> … … 15 16 16 17 #include <vector> 17 18 #include "SDL_image.h" 18 19 19 20 #include "texture.h" … … 53 54 // MAPPING // 54 55 void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0); 56 void setSDLDiffuseMap(SDL_Surface *surface, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0); 55 57 56 58 void setAmbientMap(const std::string& aMap, GLenum target = GL_TEXTURE_2D);
Note: See TracChangeset
for help on using the changeset viewer.