Ignore:
Timestamp:
04/13/09 08:44:22 (15 years ago)
Author:
mattausch
Message:

found error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.cpp

    r3335 r3342  
    523523        vector<Geometry *>::const_iterator it, it_end = mGeometry.end(); 
    524524 
    525         Material defaultMaterial; 
    526  
    527525        for (it = mGeometry.begin(); it != it_end; ++ it) 
    528526        { 
    529  
    530                 /////////////////////// 
    531                 //-- write geometry 
    532  
    533527                WriteGeometry(ofile, *it); 
    534528 
    535529                 
    536530                ///////// 
    537                 //-- write material 
    538  
    539                 Material *mat = (*it)->mMaterial ? (*it)->mMaterial : &defaultMaterial; 
     531                //-- material 
     532 
     533                Material *mat = (*it)->mMaterial; 
     534 
     535                if (!mat) cerr << "error: no material specified!!" << endl; 
    540536 
    541537                ofile.write(reinterpret_cast<char *>(&mat->texture), sizeof(int)); 
     
    544540                //bool cullFaceEnabled = false; 
    545541                bool cullFaceEnabled = true; 
    546  
     542                 
    547543                ofile.write(reinterpret_cast<char *>(&alphaTestEnabled), sizeof(bool)); 
    548544                ofile.write(reinterpret_cast<char *>(&cullFaceEnabled), sizeof(bool)); 
     
    551547                bool hasMaterial = true; 
    552548                ofile.write(reinterpret_cast<char *>(&hasMaterial), sizeof(bool)); 
    553  
     549         
    554550                SimpleVec ambient, diffuse, spec, emm; 
    555551 
    556552                ambient.x = ambient.y = ambient.z = 0.2f; 
    557553                //diffuse.x = diffuse.y = diffuse.z = 1.0f; 
    558                 diffuse.x = mat->rgb[0]; diffuse.y = mat->rgb[1]; diffuse.z = mat->rgb[2]; 
     554                diffuse.x = mat->rgb[0]; diffuse.y =mat->rgb[1]; diffuse.z = mat->rgb[2]; 
    559555                spec.x = spec.y = spec.z = .0f; 
    560556                emm = spec; 
Note: See TracChangeset for help on using the changeset viewer.