-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.h
77 lines (61 loc) · 2.78 KB
/
settings.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
Copyright 2020 Hydr8gon
This file is part of NooDS.
NooDS is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
NooDS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with NooDS. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include <string>
#include <vector>
struct Setting
{
Setting(std::string name, void *value, bool isString): name(name), value(value), isString(isString) {}
std::string name;
void *value;
bool isString;
};
class Settings
{
public:
static bool add(std::vector<Setting> platformSettings);
static bool load(std::string filename = "noods.ini");
static bool save(std::string filename = "noods.ini");
static int getDirectBoot() { return directBoot; }
static int getFpsLimiter() { return fpsLimiter; }
static int getThreaded2D() { return threaded2D; }
static int getThreaded3D() { return threaded3D; }
static std::string getBios9Path() { return bios9Path; }
static std::string getBios7Path() { return bios7Path; }
static std::string getFirmwarePath() { return firmwarePath; }
static std::string getGbaBiosPath() { return gbaBiosPath; }
static void setDirectBoot(int value) { directBoot = value; }
static void setFpsLimiter(int value) { fpsLimiter = value; }
static void setThreaded2D(int value) { threaded2D = value; }
static void setThreaded3D(int value) { threaded3D = value; }
static void setBios9Path(std::string value) { bios9Path = value; }
static void setBios7Path(std::string value) { bios7Path = value; }
static void setFirmwarePath(std::string value) { firmwarePath = value; }
static void setGbaBiosPath(std::string value) { gbaBiosPath = value; }
private:
Settings() {} // Private to prevent instantiation
static bool loaded;
static int directBoot;
static int fpsLimiter;
static int threaded2D;
static int threaded3D;
static std::string bios9Path;
static std::string bios7Path;
static std::string firmwarePath;
static std::string gbaBiosPath;
static std::vector<Setting> settings;
};
#endif // SETTINGS_H