summaryrefslogtreecommitdiff
path: root/libphysics/_map.c
blob: 06d3cad0bf794e9e6495519f625d0edf7685e3c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}