summaryrefslogtreecommitdiff
path: root/libphysics/_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'libphysics/_map.c')
-rw-r--r--libphysics/_map.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libphysics/_map.c b/libphysics/_map.c
new file mode 100644
index 0000000..06d3cad
--- /dev/null
+++ b/libphysics/_map.c
@@ -0,0 +1,20 @@
+#include <vecmath.h>
+#include <physics.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "dat.h"
+
+int *phxmapbuffer;
+int phxmapwidth, phxmapheight;
+
+void
+phxsetmap(int w, int h, int *tiles)
+{
+ if(phxmapbuffer)
+ free(phxmapbuffer);
+
+ phxmapbuffer = malloc(w * h * sizeof(phxmapbuffer[0]));
+ memcpy(phxmapbuffer, tiles, sizeof(phxmapbuffer[0]) * w * h);
+}