forked from Ports/perfect_dark
port: rework config system a bit
This commit is contained in:
1 parent
479c0335f3
commit
fbae610a3b
12 files changed
+238
-253
No files matched your search
+5
-15
@@ -13,18 +13,8 @@ s32 configLoad(const char *fname);
|
||||
// saves config to file (path extensions such as ! apply)
|
||||
s32 configSave(const char *fname);
|
||||
|
||||
// get value of a config variable or create a new one with specified default
|
||||
// key is a string of the form "SECTION.KEY"
|
||||
s32 configGetInt(const char *key, s32 defval);
|
||||
f32 configGetFloat(const char *key, f32 defval);
|
||||
const char *configGetString(const char *key, const char *defval);
|
||||
|
||||
// get value as above and clamp it in between minval, maxval
|
||||
s32 configGetIntClamped(const char *key, s32 defval, s32 minval, s32 maxval);
|
||||
f32 configGetFloatClamped(const char *key, f32 defval, f32 minval, f32 maxval);
|
||||
|
||||
// set value of a config variable, will create it if it doesn't exist
|
||||
// key is a string of the form "SECTION.KEY"
|
||||
void configSetInt(const char *key, s32 val);
|
||||
void configSetFloat(const char *key, f32 val);
|
||||
void configSetString(const char *key, const char *val);
|
||||
// registers a variable in the config file
|
||||
// this should be done before configInit() is called, preferably in a module constructor
|
||||
void configRegisterInt(const char *key, s32 *var, s32 min, s32 max);
|
||||
void configRegisterFloat(const char *key, f32 *var, f32 min, f32 max);
|
||||
void configRegisterString(const char *key, char *var, u32 maxstr);
|
||||
@@ -167,7 +167,7 @@ void inputMouseEnable(s32 enabled);
|
||||
void inputUpdate(void);
|
||||
|
||||
// call this before configSave()
|
||||
void inputSaveConfig(void);
|
||||
void inputSaveBinds(void);
|
||||
|
||||
void inputSetDefaultKeyBinds(void);
|
||||
|
||||
|
||||
@@ -38,6 +38,4 @@ s32 videoFramebuffersSupported(void);
|
||||
void videoResetTextureCache(void);
|
||||
void videoFreeCachedTexture(const void *texptr);
|
||||
|
||||
void videoSaveConfig(void);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user