-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoad.cpp
More file actions
41 lines (39 loc) · 694 Bytes
/
Copy pathLoad.cpp
File metadata and controls
41 lines (39 loc) · 694 Bytes
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
40
41
#include "PCH.h"
#include "Load.h"
bool Load::LoadFile()
{
FILE* f;
fopen_s(&f, "save.sav", "r");
if (f == NULL)
return false;
char str[100];
if (!feof(f))
{
fgets(str, sizeof(str), f);
password = str;
password.pop_back(); //remove \n
}
if (!feof(f))
{
fgets(str, sizeof(str), f);
keyIdx = std::stoi(str);
}
if (!feof(f)) {
fgets(str, sizeof(str), f);
port = std::stoi(str);
}
if (!feof(f)) {
fgets(str, sizeof(str), f);
bParameterMultiplexing = std::stoi(str);
}
if (!feof(f)) {
fgets(str, sizeof(str), f);
refreshRate = std::stoi(str);
}
if (!feof(f)) {
fgets(str, sizeof(str), f);
bStartAndHide = std::stoi(str);
}
fclose(f);
return true;
}