Changeset 8198 in orxonox.OLD for branches/bsp_model/src/lib
- Timestamp:
- Jun 7, 2006, 3:35:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r8195 r8198 391 391 { 392 392 ::std::string absFileName; 393 char * baseName = "worlds/bsp/"; 394 393 395 char fileName [228]; 394 char ext [ 100];396 char ext [228]; 395 397 struct stat results; 396 398 … … 404 406 if(strlen(fileName) == 0) 405 407 { 408 406 409 // Default Material 407 410 this->Materials[i].mat = new Material(); 408 411 this->Materials[i].mat->setDiffuse(0.1,0.1,1.0); 409 412 this->Materials[i].mat->setAmbient(0.1,0.1,1.0 ); … … 420 423 421 424 // Check for mov 422 strcpy(fileName, &this->textures[8+ 72*i]); 425 strcpy(fileName, baseName); 426 strcpy(ext, &this->textures[8+ 72*i]); 427 strncat(fileName, ext, strlen(fileName)); 423 428 strcpy(ext, ".mov"); 424 429 strncat (fileName, ext, strlen(fileName)); … … 433 438 434 439 // Check for avi 435 strcpy(fileName, &this->textures[8+ 72*i]); 440 strcpy(fileName, baseName); 441 strcpy(ext, &this->textures[8+ 72*i]); 442 strncat(fileName, ext, strlen(fileName)); 436 443 strcpy(ext, ".avi"); 437 444 strncat (fileName, ext, strlen(fileName)); … … 446 453 447 454 // Check for mpg 448 strcpy(fileName, &this->textures[8+ 72*i]); 455 strcpy(fileName, baseName); 456 strcpy(ext, &this->textures[8+ 72*i]); 457 strncat(fileName, ext, strlen(fileName)); 449 458 strcpy(ext, ".mpg"); 450 459 strncat (fileName, ext, strlen(fileName)); … … 459 468 460 469 // Check for tga 461 strcpy(fileName, &this->textures[8+ 72*i]); 470 strcpy(fileName, baseName); 471 strcpy(ext, &this->textures[8+ 72*i]); 472 strncat(fileName, ext, strlen(fileName)); 462 473 strcpy(ext, ".tga"); 463 474 strncat (fileName, ext, strlen(fileName)); … … 471 482 } 472 483 // Check for TGA 473 strcpy(fileName, &this->textures[8+ 72*i]); 484 strcpy(fileName, baseName); 485 strcpy(ext, &this->textures[8+ 72*i]); 486 strncat(fileName, ext, strlen(fileName)); 474 487 strcpy(ext, ".TGA"); 475 488 strncat (fileName, ext, strlen(fileName)); … … 482 495 } 483 496 // Check for jpg 484 strcpy(fileName, &this->textures[8+ 72*i]); 497 strcpy(fileName, baseName); 498 strcpy(ext, &this->textures[8+ 72*i]); 499 strncat(fileName, ext, strlen(fileName)); 485 500 strcpy(ext, ".jpg"); 486 501 strncat (fileName, ext, strlen(fileName)); … … 494 509 495 510 // Check for JPG 496 strcpy(fileName, &this->textures[8+ 72*i]); 511 strcpy(fileName, baseName); 512 strcpy(ext, &this->textures[8+ 72*i]); 513 strncat(fileName, ext, strlen(fileName)); 497 514 strcpy(ext, ".JPG"); 498 515 strncat (fileName, ext, strlen(fileName)); … … 507 524 508 525 // Check for bmp 509 strcpy(fileName, &this->textures[8+ 72*i]); 526 strcpy(fileName, baseName); 527 strcpy(ext, &this->textures[8+ 72*i]); 528 strncat(fileName, ext, strlen(fileName)); 510 529 strcpy(ext, ".bmp"); 511 530 strncat (fileName, ext, strlen(fileName)); … … 519 538 520 539 // Check for BMP 521 strcpy(fileName, &this->textures[8+ 72*i]); 540 strcpy(fileName, baseName); 541 strcpy(ext, &this->textures[8+ 72*i]); 542 strncat(fileName, ext, strlen(fileName)); 522 543 strcpy(ext, ".BMP"); 523 544 strncat (fileName, ext, strlen(fileName));
Note: See TracChangeset
for help on using the changeset viewer.