about summary refs log tree commit diff
path: root/src/engine/config/config.cpp
diff options
context:
space:
mode:
authorJakob Fries <jakob.fries@gmail.com>2007-06-01 11:08:33 +0000
committerJakob Fries <jakob.fries@gmail.com>2007-06-01 11:08:33 +0000
commit9da845061a2fc7f3401c3b7487062f7922ce759f (patch)
treece4be6b79c5ea5719b364eb3d68165d093969cbe /src/engine/config/config.cpp
parent821e6bbe538421556f516c671114b7d748629661 (diff)
downloadzcatch-9da845061a2fc7f3401c3b7487062f7922ce759f.tar.gz
zcatch-9da845061a2fc7f3401c3b7487062f7922ce759f.zip
gui things
Diffstat (limited to 'src/engine/config/config.cpp')
-rw-r--r--src/engine/config/config.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/engine/config/config.cpp b/src/engine/config/config.cpp
new file mode 100644
index 00000000..844158c1
--- /dev/null
+++ b/src/engine/config/config.cpp
@@ -0,0 +1,32 @@
+#include <baselib/system.h>
+
+#include <cstring>
+#include <cstdio>
+
+#include "config.h"
+
+configuration config;
+
+void config_reset()
+{
+    #define MACRO_CONFIG_INT(name,def,min,max) config.name = def;
+    #define MACRO_CONFIG_STR(name,len,def) strncpy(config.name, def, len);
+ 
+    #include "config_define.h" 
+ 
+    #undef MACRO_CONFIG_INT 
+    #undef MACRO_CONFIG_STR 
+
+	puts("woaaa");
+}
+
+void config_load(const char *filename)
+{
+	dbg_msg("config/load", "loading %s", filename);
+}
+
+#define MACRO_CONFIG_INT(name,def,min,max) void 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 set_ ## name (configuration *c, char *str) { strncpy(c->name, def, len-1); c->name[sizeof(c->name)-1] = 0; }
+#include "config_define.h"
+#undef MACRO_CONFIG_INT
+#undef MACRO_CONFIG_STR