summaryrefslogtreecommitdiff
path: root/libphysics/_map.c
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:02:56 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:02:56 -0300
commit97702f11ea016ca2e395f71f03c3fc3a2ee929ca (patch)
tree20380f895ee422c48b970c7da5b921e046e35da4 /libphysics/_map.c
parent5c6b3c19172948cf2e1800a9333cfcd858ee829c (diff)
adicionado libphysics
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);
+}