-
Notifications
You must be signed in to change notification settings - Fork 0
/
wall_sprite_functions_part_two.c
46 lines (42 loc) · 1.47 KB
/
wall_sprite_functions_part_two.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* ************************************************************************** */
/* */
/* :::::::: */
/* wall_sprite_functions_part_two.c :+: :+: */
/* +:+ */
/* By: cschuijt <[email protected]> +#+ */
/* +#+ */
/* Created: 2022/11/22 16:26:23 by cschuijt #+# #+# */
/* Updated: 2022/11/22 16:26:23 by cschuijt ######## odam.nl */
/* */
/* ************************************************************************** */
#include "so_long.h"
uint8_t wall_single_edge_lr(uint8_t surroundings)
{
if (surroundings >> 1 & 1)
return (11);
if (surroundings >> 3 & 1)
return (27);
if (surroundings >> 5 & 1)
return (41);
return (25);
}
uint8_t wall_single_edge_l(uint8_t surroundings)
{
if (surroundings >> 1 & 1)
return (39);
if (surroundings >> 3 & 1)
return (24);
if (surroundings >> 5 & 1)
return (53);
return (8);
}
uint8_t wall_single_edge_r(uint8_t surroundings)
{
if (surroundings >> 1 & 1)
return (38);
if (surroundings >> 3 & 1)
return (9);
if (surroundings >> 5 & 1)
return (54);
return (23);
}