forked from prototype99/dsfix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Settings.h
42 lines (42 loc) · 1.22 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
#pragma once
#include <string>
#include <Windows.h>
class Settings {
static Settings instance;
bool inited, langOverridden;
unsigned curFPSlimit;
void read(char* source, bool& value);
void read(char* source, int& value);
void read(char* source, unsigned& value);
void read(char* source, float& value);
void read(char* source, std::string& value);
void log(const char* name, bool value);
void log(const char* name, int value);
void log(const char* name, unsigned value);
void log(const char* name, float value);
void log(const char* name, const std::string& value);
#define SETTING(_type, _var, _inistring, _defaultval) \
private: _type _var; \
public: _type get##_var() const { return _var; };
#include "Settings.def"
#undef SETTING
public:
static Settings& get() {
return instance;
}
void load();
void performLanguageOverride();
void report();
void init();
void shutdown();
void undoLanguageOverride();
Settings() : inited(false), langOverridden(false) {
#define SETTING(_type, _var, _inistring, _defaultval) \
_var = _defaultval;
#include "Settings.def"
#undef SETTING
}
unsigned getCurrentFPSLimit();
void setCurrentFPSLimit(unsigned limit);
void toggle30FPSLimit();
};