tmp push merge resolution not finished
This commit is contained in:
parent
2568aa69a6
commit
00dc0e9e67
16 changed files with 454 additions and 59 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/11/09 01:11:01 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/11/18 17:14:06 by bgoulard ### ########.fr */
|
||||
/* Updated: 2024/11/28 13:58:48 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -38,11 +38,14 @@ static void cleanup_mlx(t_info *info)
|
|||
mlx_destroy_window(info->mlx_ptr, info->win_ptr);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (info->map.texture[i].img)
|
||||
mlx_destroy_image(info->mlx_ptr, info->map.texture[i].img);
|
||||
if (info->map.texture[i].path)
|
||||
ft_free((void **)&info->map.texture[i].path);
|
||||
if (info->map.texture_[i].img)
|
||||
mlx_destroy_image(info->mlx_ptr, info->map.texture_[i].img);
|
||||
if (info->map.texture_[i].path)
|
||||
ft_free((void **)&info->map.texture_[i].path);
|
||||
if (info->map.texture[i])
|
||||
mlx_destroy_image(info->mlx_ptr, info->map.texture[i]);
|
||||
}
|
||||
|
||||
mlx_destroy_display(info->mlx_ptr);
|
||||
ft_free((void **)&info->mlx_ptr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
|
||||
/* Updated: 2024/11/28 13:55:42 by bgoulard ### ########.fr */
|
||||
/* Updated: 2024/11/28 15:38:55 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,11 +22,30 @@
|
|||
|
||||
void blank(t_info *info);
|
||||
|
||||
void dump_map(t_tile *map, t_ipoint size)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
i = 0;
|
||||
while (i < size.y)
|
||||
{
|
||||
j = 0;
|
||||
while (j < size.x)
|
||||
{
|
||||
printf("%d", map[i * size.x + j].tile_type);
|
||||
j++;
|
||||
}
|
||||
printf("\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// not normed but we'll take care of this as a niceties at the last
|
||||
// possible moment :)
|
||||
void dump_info(t_info *info)
|
||||
{
|
||||
const char *bool_str[2] = {"True", "False"};
|
||||
const char *bool_str[2] = {"False", "True"};
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
|
|
@ -47,6 +66,15 @@ void dump_info(t_info *info)
|
|||
printf("\t\tmap.fraw[%zu]: %s\n", i, info->map.fraw[i]);
|
||||
i++;
|
||||
}
|
||||
printf("\t\ttexture[0]: %p\n", info->map.texture[0]);
|
||||
printf("\t\ttexture[1]: %p\n", info->map.texture[1]);
|
||||
printf("\t\ttexture[2]: %p\n", info->map.texture[2]);
|
||||
printf("\t\ttexture[3]: %p\n", info->map.texture[3]);
|
||||
printf("\t\tmap: %p\n", info->map.map);
|
||||
dump_map(info->map.map, info->map.size);
|
||||
|
||||
printf("\tlast_error: %d\n", info->last_error);
|
||||
printf("\terno_state: %d\n", info->errno_state);
|
||||
}
|
||||
|
||||
void check_err(t_info *info)
|
||||
|
|
@ -65,7 +93,6 @@ void check_err(t_info *info)
|
|||
|
||||
void run_cub3d(t_info *info)
|
||||
{
|
||||
blank(info);
|
||||
if (init_mlx_env(info) != NO_ERROR)
|
||||
return ;
|
||||
parse_map(info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue