-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (38 loc) · 895 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Win.h"
#include <fstream>
#include <unistd.h>
#include <sstream>
int main()
{
char* cwd = getcwd(NULL, 0);
stringstream ss;
ss << cwd;
string direct;
ss >> direct;
direct += "/files/";
cout << direct << endl;
char buf[1024];
string message;
ifstream infile;
infile.open(direct+"board_config.cfg", ios::in);
windowSize sizeFile;
if (infile.is_open())
{
infile.getline(buf, 1024);
sizeFile.col = strtol(buf,nullptr,10);
infile.getline(buf, 1024);
sizeFile.row = strtol(buf, nullptr, 10);
infile.getline(buf, 1024);
sizeFile.mines = strtol(buf, nullptr, 10);
}
else
{
cout << "no such cfg file" << endl;
}
welcomWindow wel(sizeFile);
wel.display(direct);
//cout << filePath << endl;
return 0;
}