style: split structs.h header into multiple, remove from central dir

This commit is contained in:
Khaïs COLIN 2025-07-17 14:57:29 +02:00
parent 38a05423dd
commit 6322d05b22
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
19 changed files with 141 additions and 87 deletions

View file

@ -6,12 +6,11 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
/* Updated: 2025/07/17 14:55:29 by kcolin ### ########.fr */
/* Updated: 2025/07/17 15:52:57 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft/includes/libft.h"
#include "../includes/structs.h"
#include "../mlx/mlx.h"
#include "consts.h"
#include "map/map_checker.h"
@ -34,11 +33,11 @@ int game_loop(t_cub3d_data *data)
{
data->player.x += data->player.movement.x;
data->player.y += data->player.movement.y;
mlx_destroy_image(data->mlx, data->mlx_data->img);
data->mlx_data->img = mlx_new_image(data->mlx, 800, 600);
draw_map(data->map, &data->player, data->mlx_data);
mlx_destroy_image(data->mlx, data->img_data->img);
data->img_data->img = mlx_new_image(data->mlx, 800, 600);
draw_map(data->map, &data->player, data->img_data);
mlx_put_image_to_window(data->mlx, data->mlx_win,
data->mlx_data->img, 0, 0);
data->img_data->img, 0, 0);
mlx_string_put(data->mlx, data->mlx_win, 10, 10, 0x00FFFFFF, COMPILED_TEXT);
return (0);
}
@ -55,11 +54,11 @@ int main(int argc, char **argv)
data.map->error), 1);
data.mlx = mlx_init();
data.mlx_win = mlx_new_window(data.mlx, 800, 600, "Cub3d");
data.mlx_data = ft_calloc(sizeof(t_mlx_data), 1);
data.mlx_data->img = mlx_new_image(data.mlx, 800, 600);
data.mlx_data->addr = mlx_get_data_addr(data.mlx_data->img,
&data.mlx_data->bits_per_pixel, &data.mlx_data->line_length,
&data.mlx_data->endian);
data.img_data = ft_calloc(sizeof(t_img_data), 1);
data.img_data->img = mlx_new_image(data.mlx, 800, 600);
data.img_data->addr = mlx_get_data_addr(data.img_data->img,
&data.img_data->bits_per_pixel, &data.img_data->line_length,
&data.img_data->endian);
init_player(data.map, &(data.player));
mlx_hook(data.mlx_win, KeyPress, KeyPressMask, keypress_handler, &data);
mlx_hook(data.mlx_win, KeyRelease, KeyReleaseMask,