Public paste
array
By: array | Date: Feb 10 2010 22:47 | Format: None | Expires: never | Size: 685 B | Hits: 804

  1. void FileDialogs::OpenFileDialog()
  2. {
  3.         wstring temp;
  4.         levelmaker::OpenFileDialog(GAME_ENGINE->GetWindow(), _T("TXT(*.txt)"), temp, _T("txt"));
  5.  
  6.         int FileTempArr[1200];
  7.         int FileInteger;
  8.         int teller = 0;
  9.  
  10.         GridNode *GridNodesArr[MAX];
  11.  
  12.         ifstream inFile(temp.c_str());
  13.         if(!inFile)
  14.         {
  15.                 GAME_ENGINE->MessageBox(String("Cannot open file"));
  16.         }
  17.         while(inFile >> FileInteger)
  18.         {
  19.                         FileTempArr[teller] = FileInteger;
  20.                         ++teller;
  21.         }
  22.  
  23.         for(int i = 0; i<1200; i += 3)
  24.         {
  25.                 GridNodesArr[i]->SetType(FileTempArr[i + 1]);
  26.  
  27.                 if(FileTempArr[i + 2] == 1)
  28.                 {
  29.                         GridNodesArr[i]->SetWalkable(true);
  30.                 }
  31.                 else
  32.                 {
  33.                         GridNodesArr[i]->SetWalkable(false);
  34.                 }
  35.         }
  36. }