only write variables with non-default values to saved.cfg

This commit is contained in:
ac-stef
2015-02-23 18:52:34 +01:00
parent f75f0c0af4
commit 71ac04c129
2 changed files with 19 additions and 9 deletions
+7 -5
View File
@@ -39,22 +39,24 @@ struct ident
{
void (*getfun)(); // ID_SVAR (called /before/ reading the value string, as a chance for last-minute updates)
char *executing; // ID_ALIAS
};
int defaultval; // ID_VAR
float defaultvalf; // ID_FVAR
};
short context;
bool persist;
ident() {}
// ID_VAR
ident(int type, const char *name, int minval, int maxval, int *i, void (*fun)(), bool persist, int context)
ident(int type, const char *name, int minval, int maxval, int *i, int defval, void (*fun)(), bool persist, int context)
: type(type), name(name), isconst(false), minval(minval), maxval(maxval), fun(fun),
sig(NULL), action(NULL), executing(NULL), context(context), persist(persist)
sig(NULL), action(NULL), defaultval(defval), context(context), persist(persist)
{ storage.i = i; }
// ID_FVAR
ident(int type, const char *name, float minval, float maxval, float *f, void (*fun)(), bool persist, int context)
ident(int type, const char *name, float minval, float maxval, float *f, float defval, void (*fun)(), bool persist, int context)
: type(type), name(name), isconst(false), minvalf(minval), maxvalf(maxval), fun(fun),
sig(NULL), action(NULL), executing(NULL), context(context), persist(persist)
sig(NULL), action(NULL), defaultvalf(defval), context(context), persist(persist)
{ storage.f = f; }
// ID_SVAR