-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxpm.c
27 lines (24 loc) · 1.22 KB
/
xpm.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* xpm.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sadamant <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/09 20:45:48 by sadamant #+# #+# */
/* Updated: 2018/05/09 20:50:14 by sadamant ### ########.fr */
/* */
/* ************************************************************************** */
#include "wolf3d.h"
t_image *new_xpm_image(t_env *e, char *name, int w, int h)
{
t_image *xpm;
if (!(xpm = (t_image *)malloc(sizeof(t_image))))
exit_id(1);
xpm->w = w;
xpm->h = h;
xpm->id = mlx_xpm_file_to_image(e->mlx, name, &w, &h);
xpm->bitmap = (int *)mlx_get_data_addr(xpm->id, &(xpm->bpp), &(xpm->sline),
&(xpm->endian));
return (xpm);
}