-
Notifications
You must be signed in to change notification settings - Fork 0
/
collectible_rendering.c
32 lines (29 loc) · 1.43 KB
/
collectible_rendering.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
/* ************************************************************************** */
/* */
/* :::::::: */
/* collectible_rendering.c :+: :+: */
/* +:+ */
/* By: cschuijt <[email protected]> +#+ */
/* +#+ */
/* Created: 2022/12/29 16:19:37 by cschuijt #+# #+# */
/* Updated: 2022/12/29 16:19:37 by cschuijt ######## odam.nl */
/* */
/* ************************************************************************** */
#include "so_long.h"
void render_collectibles(t_map *map)
{
t_collectible *collectible;
mlx_instance_t *instance;
t_sprite *sprite;
collectible = map->collectibles;
sprite = find_or_create_sprite(map, map->bg_sprites, 178);
while (collectible)
{
collectible->instance = mlx_image_to_window(map->mlx, sprite->image, \
render_x_pos(map, collectible->pos), \
render_y_pos(map, collectible->pos));
instance = &sprite->image->instances[collectible->instance];
mlx_set_instance_depth(instance, layer_collectibles);
collectible = collectible->next;
}
}