Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8198 in orxonox.OLD for branches/bsp_model/src/lib/graphics/importer


Ignore:
Timestamp:
Jun 7, 2006, 3:35:13 PM (18 years ago)
Author:
bottac
Message:

name offset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.cc

    r8195 r8198  
    391391{
    392392  ::std::string absFileName;
     393  char * baseName = "worlds/bsp/";
     394 
    393395  char fileName [228];
    394   char ext [100];
     396  char ext [228];
    395397  struct stat results;
    396398
     
    404406    if(strlen(fileName) == 0)
    405407    {
     408     
    406409     //         Default Material
    407       this->Materials[i].mat = new Material();
     410    this->Materials[i].mat = new Material();
    408411    this->Materials[i].mat->setDiffuse(0.1,0.1,1.0);
    409412    this->Materials[i].mat->setAmbient(0.1,0.1,1.0 );
     
    420423
    421424      // 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));
    423428    strcpy(ext, ".mov");
    424429    strncat (fileName, ext, strlen(fileName));
     
    433438
    434439    // 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));
    436443    strcpy(ext, ".avi");
    437444    strncat (fileName, ext, strlen(fileName));
     
    446453
    447454       // 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));
    449458    strcpy(ext, ".mpg");
    450459    strncat (fileName, ext, strlen(fileName));
     
    459468
    460469    // 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));
    462473    strcpy(ext, ".tga");
    463474    strncat (fileName, ext, strlen(fileName));
     
    471482    }
    472483    // 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));
    474487    strcpy(ext, ".TGA");
    475488    strncat (fileName, ext, strlen(fileName));
     
    482495    }
    483496    // 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));
    485500    strcpy(ext, ".jpg");
    486501    strncat (fileName, ext, strlen(fileName));
     
    494509
    495510    // 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));
    497514    strcpy(ext, ".JPG");
    498515    strncat (fileName, ext, strlen(fileName));
     
    507524
    508525    // 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));
    510529    strcpy(ext, ".bmp");
    511530    strncat (fileName, ext, strlen(fileName));
     
    519538
    520539    // 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));
    522543    strcpy(ext, ".BMP");
    523544    strncat (fileName, ext, strlen(fileName));
Note: See TracChangeset for help on using the changeset viewer.