mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
This commit is contained in:
parent
03201a3a6f
commit
f18df70e53
|
@ -76,6 +76,12 @@ void config_save(const char *filename)
|
|||
file.close();
|
||||
}
|
||||
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) int config_get_ ## name (configuration *c) { return c->name; }
|
||||
#define MACRO_CONFIG_STR(name,len,def) const char *config_get_ ## name (configuration *c) { return c->name; }
|
||||
#include "config_variables.h"
|
||||
#undef MACRO_CONFIG_INT
|
||||
#undef MACRO_CONFIG_STR
|
||||
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) void config_set_ ## name (configuration *c, int val) { if (val < min) val = min; if (max != 0 && val > max) val = max; c->name = val; }
|
||||
#define MACRO_CONFIG_STR(name,len,def) void config_set_ ## name (configuration *c, const char *str) { strncpy(c->name, str, len-1); c->name[sizeof(c->name)-1] = 0; }
|
||||
#include "config_variables.h"
|
||||
|
|
|
@ -16,6 +16,12 @@ void config_reset();
|
|||
void config_load(const char *filename);
|
||||
void config_save(const char *filename);
|
||||
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) int config_get_ ## name (configuration *c);
|
||||
#define MACRO_CONFIG_STR(name,len,def) const char *config_get_ ## name (configuration *c);
|
||||
#include "config_variables.h"
|
||||
#undef MACRO_CONFIG_INT
|
||||
#undef MACRO_CONFIG_STR
|
||||
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) void config_set_ ## name (configuration *c, int val);
|
||||
#define MACRO_CONFIG_STR(name,len,def) void config_set_ ## name (configuration *c, const char *str);
|
||||
#include "config_variables.h"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "../game/config_variables.h"
|
||||
#include "../game/game_variables.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue