aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
new file mode 100644
index 0000000..98f806a
--- /dev/null
+++ b/src/config.c
@@ -0,0 +1,16 @@
+#include "config.h"
+#include "defaults.h"
+#include <string.h>
+
+struct conf *load_default_conf()
+{
+ struct conf *conf = malloc(sizeof(struct conf));
+ //Bindings.
+ struct binding bindings[] = DEFAULT_BINDINGS;
+ conf->bindings = malloc(sizeof(bindings));
+ memcpy(conf->bindings, bindings, sizeof(bindings));
+ conf->count = sizeof(bindings) / sizeof(struct binding);
+ //Game blocks.
+ set_blocks(&(conf->blocks));
+ return conf;
+} \ No newline at end of file