Advertisement
ThirteenAG

Untitled

Oct 13th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. void ReadCoordsFile(char *filename)
  2. {
  3. fstream ide_txt;
  4. ide_txt.open(filename, ios_base::in);
  5. if (ide_txt.is_open())
  6. {
  7. string s;
  8. while (getline(ide_txt, s))
  9. {
  10. if(atoi(s.c_str()))
  11. {
  12. for ( string::iterator it = s.begin(); it != s.end(); it++ )
  13. {
  14. if ( *it == ',' ) { *it = ' '; }
  15. }
  16. sscanf(s.c_str(), "%d %*s %*d %f %f %f", &CoronasArray[i].modelID, &CoronasArray[i].pos.x, &CoronasArray[i].pos.y, &CoronasArray[i].pos.z);
  17. i++;
  18. }
  19. }
  20.  
  21. }
  22. ide_txt.close();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement