Advertisement
Benjamin_Loison

Load map LemnosLife

Jun 30th, 2017 (edited)
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. void loadMap(string elements)
  2. {
  3.     vector<string> elementsVector = split(elements, "\n");
  4.     nameMap = elementsVector[0];
  5.     for(int i = 1; i < (int)elementsVector.size(); i++)
  6.     {
  7.         vector<string> inf = split(elementsVector[i], " ");
  8.         double tex[4][2], vertex[4][3];
  9.         for(int x = 0; x < 4; x++)
  10.         {
  11.             vector<string> texVector = split(inf[3 + x], ";");
  12.             for(int y = 0; y < 2; y++)
  13.                 tex[x][y] = convertStrToDouble(texVector[y]);
  14.         }
  15.         for(int x = 0; x < 4; x++)
  16.         {
  17.             vector<string> vertexVector = split(inf[5 + x], ";");
  18.             for(int y = 0; y < 3; y++)
  19.                 tex[x][y] = convertStrToDouble(vertexVector[y]);
  20.         }
  21.         objects[i - 1] = Gl_object(convertStrToInt(inf[0]), inf[1], inf[2], tex, vertex);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement