- void FileDialogs::OpenFileDialog()
- {
- wstring temp;
- levelmaker::OpenFileDialog(GAME_ENGINE->GetWindow(), _T("TXT(*.txt) "), temp, _T("txt"));
- int FileTempArr[1200];
- int FileInteger;
- int teller = 0;
- GridNode *GridNodesArr[MAX];
- ifstream inFile(temp.c_str());
- if(!inFile)
- {
- GAME_ENGINE->MessageBox(String("Cannot open file"));
- }
- while(inFile >> FileInteger)
- {
- FileTempArr[teller] = FileInteger;
- ++teller;
- }
- for(int i = 0; i<1200; i += 3)
- {
- GridNodesArr[i]->SetType(FileTempArr[i + 1]);
- if(FileTempArr[i + 2] == 1)
- {
- GridNodesArr[i]->SetWalkable(true);
- }
- else
- {
- GridNodesArr[i]->SetWalkable(false);
- }
- }
- }

By: array | Date: Feb 10 2010 22:47 | Format: None | Expires: never | Size: 685 B | Hits: 923
Latest pastes
2 hours ago
2 hours ago
2 hours ago
3 hours ago
7 hours ago