Added loading of texturenames (normalmap still to do)

This commit is contained in:
Paolo Cignoni 2005-12-02 00:01:30 +00:00
parent 7bd3c4601a
commit d010453f42
1 changed files with 38 additions and 35 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.19 2005/11/25 10:23:27 cignoni
Added safe zero initialization of index of wedge texture
Revision 1.18 2005/11/23 16:59:55 callieri Revision 1.18 2005/11/23 16:59:55 callieri
corrected protected access methods (camera, similarity) of shot corrected protected access methods (camera, similarity) of shot
@ -772,43 +775,43 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
} }
} }
// // Parsing texture names // Parsing texture names
//textures.clear(); m.textures.clear();
//normalmaps.clear(); m.normalmaps.clear();
//for(int co=0;co<int(pf.comments.size());++co) for(int co=0;co<int(pf.comments.size());++co)
//{ {
// const char * TFILE = "TextureFile"; string TFILE = "TextureFile";
// const char * NFILE = "TextureNormalFile"; string NFILE = "TextureNormalFile";
// const char * c = pf.comments[co]; string &c = pf.comments[co];
// char buf[256]; char buf[256];
// int i,j,n; string bufstr,bufclean;
int i,j,n;
// if( !strncmp(c,TFILE,strlen(TFILE)) ) if( TFILE == c.substr(0,TFILE.length()) )
// { {
// strcpy(buf,c+strlen(TFILE)+1); bufstr = c.substr(TFILE.length()+1);
// n = strlen(buf); n = bufstr.length();
// for(i=j=0;i<n;i++) for(i=0;i<n;i++)
// if( buf[i]!=' ' && buf[i]!='\t' && buf[i]>32 && buf[i]<125 ) buf[j++] = buf[i]; if( bufstr[i]!=' ' && bufstr[i]!='\t' && bufstr[i]>32 && bufstr[i]<125 ) bufclean.push_back(bufstr[i]);
//
// buf[j] = 0; char buf2[255];
// char buf2[255]; ply::interpret_texture_name( bufclean.c_str(),filename,buf2 );
// __interpret_texture_name( buf,filename,buf2 ); m.textures.push_back( string(buf2) );
// textures.push_back( xstring(buf2) ); }
// } /*if( !strncmp(c,NFILE,strlen(NFILE)) )
// if( !strncmp(c,NFILE,strlen(NFILE)) ) {
// { strcpy(buf,c+strlen(NFILE)+1);
// strcpy(buf,c+strlen(NFILE)+1); n = strlen(buf);
// n = strlen(buf); for(i=j=0;i<n;i++)
// for(i=j=0;i<n;i++) if( buf[i]!=' ' && buf[i]!='\t' && buf[i]>32 && buf[i]<125 ) buf[j++] = buf[i];
// if( buf[i]!=' ' && buf[i]!='\t' && buf[i]>32 && buf[i]<125 ) buf[j++] = buf[i];
// buf[j] = 0;
// buf[j] = 0; char buf2[255];
// char buf2[255]; __interpret_texture_name( buf,filename,buf2 );
// __interpret_texture_name( buf,filename,buf2 ); m.normalmaps.push_back( string(buf2) );
// normalmaps.push_back( xstring(buf2) ); }*/
// } }
//}
// vn and fn should be correct but if someone wrongly saved some deleted elements they can be wrong. // vn and fn should be correct but if someone wrongly saved some deleted elements they can be wrong.
m.vn = 0; m.vn = 0;