-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrt_quit.c
31 lines (29 loc) · 1.25 KB
/
rt_quit.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rt_quit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: snicolet <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/07/21 15:01:01 by snicolet #+# #+# */
/* Updated: 2016/09/05 20:01:37 by snicolet ### ########.fr */
/* */
/* ************************************************************************** */
#include "rt.h"
#include "draw.h"
int rt_quit(t_rt *rt, int retcode)
{
if (rt->settings.cfgbits & RT_CFGB_FREESCREEN)
{
SDL_FreeSurface(rt->sys.screen);
rt->sys.screen = NULL;
}
if (rt->render_screen)
SDL_FreeSurface(rt->render_screen);
if (rt->sys.screen)
draw_quit(&rt->sys);
textures_free(*rt->textures);
rt_node_free(rt->root);
free(rt->textures);
return (retcode);
}