-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove_tet.c
31 lines (28 loc) · 1.28 KB
/
remove_tet.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* :::::::: */
/* remove_tet.c :+: :+: */
/* +:+ */
/* By: aholster <aholster@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2019/03/24 16:59:04 by lgutter #+# #+# */
/* Updated: 2019/03/24 18:45:39 by aholster ######## odam.nl */
/* */
/* ************************************************************************** */
#include "fillit.h"
int remove_tet(unsigned int *tet, unsigned short *map, unsigned short di)
{
unsigned char *offx;
unsigned char *offy;
short hash;
hash = 0;
offx = (unsigned char *)(tet) + 3;
offy = (unsigned char *)(tet) + 2;
while (hash < 4)
{
map[(*offy + ((*tet >> (hash * 4)) & 3))] &= \
(65535 - (1 << (*offx + ((*tet >> (hash * 4 + 2)) & 3))));
hash++;
}
return (increment_offset(tet, di));
}